This file contains 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 | |
echo "Hello World"; | |
?> |
This file contains 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 | |
function return_page_title() { | |
return true; | |
} | |
add_filter('woocommerce_show_page_title', 'return_page_title'); | |
?> |
This file contains 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 | |
//In functions.php | |
function getHits($postID){ | |
$hits_token = 'post_views_hits'; | |
$hits = get_post_meta($postID, $hits_token, true); | |
if($hits==''){ | |
delete_post_meta($postID, $hits_token); | |
add_post_meta($postID, $hits_token, '0'); | |
return "0 View"; | |
} |
This file contains 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
<IfModule mod_headers.c> | |
<FilesMatch "\.(eot|font.css|otf|ttc|ttf|woff)$"> | |
Header set Access-Control-Allow-Origin "*" | |
</FilesMatch> | |
</IfModule> |
This file contains 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 | |
$show_after_p = 2; | |
$content = apply_filters('the_content', $post->post_content); | |
if(substr_count($content, '<p>') > $show_after_p) | |
{ | |
$contents = explode("</p>", $content); | |
$p_count = 1; | |
foreach($contents as $content) | |
{ | |
echo $content; |
This file contains 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 | |
add_action( 'pre_get_posts', 'wpsites_remove_posts_from_home_page' ); | |
function wpsites_remove_posts_from_home_page( $query ) { | |
if( $query->is_main_query() && $query->is_home() ) { | |
$query->set( 'post__not_in', array(your_post_id) ); | |
} | |
} | |
?> |
This file contains 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 | |
/** | |
* Control excerpt length. | |
*/ | |
function custom_excerpt_length( $length ) { | |
return 15; | |
} | |
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); | |
?> |
This file contains 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 | |
/** | |
* Change the excerpt more string. | |
* @param string $more | |
* @return string | |
*/ | |
function custom_excerpt_more( $more ) { | |
return '…'; | |
} | |
add_filter( 'excerpt_more', 'custom_excerpt_more' ); |
OlderNewer