Skip to content

Instantly share code, notes, and snippets.

View bulentsakarya's full-sized avatar
🎯
Focusing

Bülent Sakarya bulentsakarya

🎯
Focusing
View GitHub Profile
function wpse_131562_redirect() {
if ( ! is_user_logged_in() && is_checkout() ) ) {
// feel free to customize the following line to suit your needs
wp_redirect(home_url('/uye-girisi'));
exit;
}
}
add_action('template_redirect', 'wpse_131562_redirect');
<?php
$type = 'yacht';
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
if(isset($_GET)) {
if($liman != 0) {
$limanq = "
array(
'key' => 'yat_limanı',
'value' => ".$liman.",
$i = 0;
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts(array(
'post_type' => 'post',
'paged' => $paged,
'posts_per_page' => 6
));
while (have_posts()) : the_post(); $i++; ?>
...
<?php
$sehiri = get_queried_object();
if($sehiri->parent != 0 ) {
$ilce_selected = get_queried_object()->slug;
$yazi = get_queried_object()->name ." İlanlar";
} else {
$sehir_selected = get_queried_object()->slug;
$yazi = get_queried_object()->name ." İlanlar";
$child = get_queried_object()->term_id;
}
public function cariyazdir($id)
{
$cari = Cari::where('musteriler_id', '=', $id)->orderBy('id', 'DESC')->get();
$borc = Cari::where('musteriler_id', '=', $id)->sum('borc');
$alacak = Cari::where('musteriler_id', '=', $id)->sum('alacak');
$durum = $borc - $alacak;
$durum = number_format($durum,2,",",".");
$musteri = Musteriler::find($id);
$html = '<html lang="tr-TR"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>';
function sc_draw_calendar( $month, $year ){
//start draw table
$calendar = '<table cellpadding="0" cellspacing="0" class="calendar">';
$day_names = array(
0 => __('Pazar', 'pippin_sc'),
1 => __('Pazartesi', 'pippin_sc'),
2 => __('Salı', 'pippin_sc'),
3 => __('Çarşamba', 'pippin_sc'),
@bulentsakarya
bulentsakarya / custom-admin.php
Created October 21, 2017 00:44
admin panel özelleştirme
<?php
/*
Plugin Name: Admin Menu
Description: Admin paneli ve mneü özelleştirme
Version: 0.1
License: GPL
Author: Bülent Sakarya
Author URI: http://www.nivothemes.com
*/
@bulentsakarya
bulentsakarya / editor-custom-field.php
Created October 17, 2017 09:36
Editörü özel alana ekleme
class dd_slider_meta {
public function __construct() {
if ( is_admin() ) {
add_action( 'load-post.php', array( $this, 'init_metabox' ) );
add_action( 'load-post-new.php', array( $this, 'init_metabox' ) );
}
}
<?php
$lpa_az_args = array(
'posts_per_page' => -1,
'post_type' => 'urunler',
'orderby' => 'title',
'order' => 'ASC'
);
$lpa_az_posts = get_posts( $lpa_az_args );
@bulentsakarya
bulentsakarya / custom-sidebar-class.php
Created September 26, 2017 18:18
istediğiniz sayfaya özel sidebar oluşturma.
<?php
/**
* Nivoshop Custom Sidebar
*
* Özel sidebar metabox değeri true olan sayfaların sidebar'larının oluşturulduğu kod.
*
* @author Nivo Themes
* @since 1.0
* @package nivoshop