Skip to content

Instantly share code, notes, and snippets.

View bulentsakarya's full-sized avatar
🎯
Focusing

Bülent Sakarya bulentsakarya

🎯
Focusing
View GitHub Profile
<?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;
}
$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
$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.",
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');
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
@bulentsakarya
bulentsakarya / gist:931a5a953a94cbc9327468fff11e812c
Created October 23, 2018 13:25 — forked from Marian0/gist:4d689c33164bc9daf0e1
Disable wordpress Frontend by htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !/wp-admin
RewriteCond %{REQUEST_URI} !/wp-includes
RewriteCond %{REQUEST_URI} !/wp-login\.php$
RewriteCond %{REQUEST_URI} !/wp-content
RewriteCond %{REQUEST_URI} !/feed
@bulentsakarya
bulentsakarya / Vps Kurulumu
Created October 25, 2018 09:16
Ubuntu + Apache + MySQL + Php + Let's Encrypt + Mod Pagespeed + WordPress
sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoclean
sudo apt-get autoremove
adduser sakarya
usermod -aG sudo sakarya
ufw app list
ufw allow OpenSSH
<?php
/**
* Template Name: Contact Form
*
* The contact form page template displays the a
* simple contact form in your website's content area.
*
* @package WooFramework
* @subpackage Template
*/
@bulentsakarya
bulentsakarya / kinsta-share-users.php
Created December 18, 2018 14:10 — forked from carlodaniele/kinsta-share-users.php
A plugin to share users and usermeta tables between independent WordPress installations. This plugin requires CUSTOM_USER_TABLE and CUSTOM_USER_META_TABLE defined into wp-config file
<?php
/**
* @package Kinsta_Share_Users
* @version 1.0
*/
/*
Plugin Name: Kinsta Share Users
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin for Kinsta blog readers
Author: Carlo Daniele
@bulentsakarya
bulentsakarya / like-it-enqueue.php
Created August 10, 2019 16:00 — forked from shizhua/like-it-enqueue.php
Add a like button without a plugin in WordPress
add_action( 'wp_enqueue_scripts', 'pt_like_it_scripts' );
function pt_like_it_scripts() {
if( is_single() ) {
wp_enqueue_style( 'like-it', trailingslashit( plugin_dir_url( __FILE__ ) ).'css/like-it.css' );
if (!wp_script_is( 'jquery', 'enqueued' )) {
wp_enqueue_script( 'jquery' );// Comment this line if you theme has already loaded jQuery
}
wp_enqueue_script( 'like-it', trailingslashit( plugin_dir_url( __FILE__ ) ).'js/like-it.js', array('jquery'), '1.0', true );