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 | |
if ( shortcode_exists( 'image_gallery' ) ) { | |
echo 'The [image_gallery] shortcode already exists'; | |
} | |
if ( !shortcode_exists( 'image_gallery' ) ) { | |
echo 'The [image_gallery] shortcode does not exist'; | |
} |
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 'The current logged in user ID is: '.get_current_user_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 | |
//Remove Query Strings From Static Resources | |
function smartwp_remove_query_strings_from_static_resources( $src ) { | |
if( strpos( $src, '?v=' ) ){ | |
$src = remove_query_arg( 'v', $src ); | |
} | |
if( strpos( $src, '?ver=' ) ){ | |
$src = remove_query_arg( 'ver', $src ); | |
} | |
return $src; |
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 | |
//Reverse comment order | |
function smartwp_reverse_comment_order( $comments ) { | |
return array_reverse( $comments ); | |
} | |
add_filter ('comments_array', 'smartwp_reverse_comment_order'); |
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 custom CSS to WordPress login page | |
function smartwp_login_page_custom_css() { | |
?> | |
<style> | |
#backtoblog { | |
display: none !important; | |
} | |
</style> | |
<?php |
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 | |
//Disable the WordPress site admin email verification screen | |
add_filter( 'admin_email_check_interval', '__return_false' ); |
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 | |
//Displays the featured image in a <img> tag (use this in a loop) | |
echo get_the_post_thumbnail(); |
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 | |
//Display the featured post URL (you can replace 'medium' with a different image size) | |
echo get_the_post_thumbnail_url( get_the_ID(), 'medium' ); |
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 | |
//Enable theme support for featured images | |
add_theme_support('post-thumbnails'); |
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 | |
//Display the WordPress version number | |
echo get_bloginfo( 'version' ); |