Skip to content

Instantly share code, notes, and snippets.

View cagriuckan's full-sized avatar
🏠
Working from home

Çağrı Üçkan cagriuckan

🏠
Working from home
View GitHub Profile
@cagriuckan
cagriuckan / searchform.php
Created August 10, 2016 15:47
Wordpress standart searchform.php
<!-- uckan.net - Standart Wordpress Search Form -->
<form class="search" action="<?php echo home_url( '/' ); ?>">
<input type="search" name="s" placeholder="Arama">
<input type="submit" value="Search">
</form>
@cagriuckan
cagriuckan / post-type-searchform.php
Created August 10, 2016 15:50
Custom post type search form
<!-- uckan.net - WordpressCustom Post Tyle Search Form -->
<form class="search" action="<?php echo home_url( '/' ); ?>">
<input type="search" name="s" placeholder="Search&hellip;">
<input type="submit" value="Search">
<input type="hidden" name="post_type" value="post-type-ismi">
</form>
@cagriuckan
cagriuckan / search.php
Created August 10, 2016 15:59
Wordpress custom post tyle search.php
<?php
$post_type = $_GET['post_type'];
if ( isset( $post_type ) && locate_template( 'search-' . $post_type . '.php' ) ) {
get_template_part( 'search', $post_type );
exit;
}
?>
if(function_exists('register_sidebar')) {
register_sidebar(array(
'name' => 'Sidebar',
'before_widget' => '<aside id="%1$s" class="widgets %2$s">',
'after_widget' => '</aside>',
'before_title' => '<div class="widget-title"><h2 class="title">',
'after_title' => '</h2></div>',
));
register_sidebar(array(
'name' => 'Sidebar2',
<div class="sidebar">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('sidebar') ) : endif; ?>
</div>
<div class="sidebar-2">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('sidebar2') ) : endif; ?>
</div>
<?php get_header(); ?>
<!-- Sidebar -->
<?php get_sidebar(); ?>
<!-- End Sidebar -->
<?php get_footer(); ?>
<?php get_header(); ?>
<!-- Sidebar -->
<?php include("sidebar2.php"); ?>
<!-- End Sidebar -->
<?php get_footer(); ?>
@cagriuckan
cagriuckan / functions.php
Created August 14, 2016 16:48
add post type support publicize with functions.php
add_action('init', 'uckan_init');
function uckan_init() {
add_post_type_support( 'product', 'publicize' );
}
// Register Custom Post Type
function custom_post_type() {
$labels = array(
'name' => _x( 'Products', 'Post Type General Name', 'uckan' ),
);
$args = array(
'label' => __( 'product', 'uckan' ),
// Publicize supports
'supports' => array( 'title', 'editor', 'publicize', 'wpcom-markdown' ),