This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Do not copy the above php tag. | |
if( is_attachment( 1780 ) ) { | |
/* do something... */ | |
} else { | |
/* ... */ | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Do not copy the above php tag. | |
if( is_page( 1780 ) ) { | |
/* Do something... */ | |
} else { | |
/* ... */ | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Do not copy the above php tag. | |
if( is_single( 1780 ) ) { | |
/* ... */ | |
} else { | |
/* ... */ | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $wp_query; | |
echo $wp_query->post->ID; | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $post; | |
echo $post->ID; | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form method=”get” action=”<?php bloginfo(‘home’); ?>/”> | |
<input type=”hidden” name=”cat” id=”cat” value=”8″ /> <!-- cahnge category value to your category id --> | |
<input type=”text” size=”14″ name=”s” value=”Search” /> | |
<input type=”submit” value=”Search” /> | |
</form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form role="search" method="get" class="search-form" action="<?php echo home_url( '/' ); ?>"> | |
<div class="form-group"> | |
<div class="input-group"> | |
<input type="search" class="form-control form-input" | |
placeholder="<?php echo esc_attr_x( 'Search for T-Shirts…', 'placeholder' ) ?>" | |
value="<?php echo get_search_query() ?>" name="s" | |
title="<?php echo esc_attr_x( 'Search for:', 'label' ) ?>" /> | |
<input type="hidden" name="post_type" value="t-shirts" /> <!-- Change value from "t-shirts" to whatever your custom post type name --> | |
<div class="input-group-addon"><button class="form-btn" ><i class="fa fa-search" aria-hidden="true"></i></button></div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Do not copy the opening php tag. | |
/* | |
*@title: Search only Post or Pages | |
*@link: http://extracatchy.net/wordpress-limit-search-results/ | |
*/ | |
function SearchFilter($query) { | |
if ($query->is_search) { | |
$query->set('post_type',array('post','page')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<files wp-config.php> | |
order allow,deny | |
deny from all | |
</files> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Do not copy the opening php tag */ | |
/* | |
@title: Load Jquery in Footer | |
@link: http://extracatchy.net/load-jquery-in-footer/ | |
*/ | |
function jquery_in_footer($scripts) { | |
if ( ! is_admin() ) |