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 | |
// Download this snippet as a plugin and more at: https://wordbits.io/snippet/add-h1-to-blog-listing-page/ | |
// Created by: Liam Dempsey | |
?> | |
<?php function prefix_your_function() { | |
if ( is_home() ) { | |
echo '<h1>Hey everyone!</h1>'; |
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 | |
// Download this snippet as a plugin and more at: https://wordbits.io/snippet/extend-public-post-preview/ | |
// Created by: Liam Dempsey | |
?> | |
<?php | |
add_filter( 'ppp_nonce_life', 'my_nonce_life' ); | |
function my_nonce_life() { | |
return 60 * 60 * 24 * 5; // 5 days | |
} |
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 | |
// Download this snippet as a plugin and more at: https://wordbits.io/snippet/paginate-pages/ | |
// Created by: Liam Dempsey | |
?> | |
<?php | |
function paginate_child_pages( $post ) { | |
$page_id = $post->ID; | |
$args = array( |
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 | |
// Download this snippet as a plugin and more at: https://wordbits.io/snippet/display-the-last-updated-date-of-posts/ | |
// Created by: Liam Dempsey | |
?> | |
<?php | |
function wpb_last_updated_date( $content ) { | |
$u_time = get_the_time('U'); | |
$u_modified_time = get_the_modified_time('U'); |
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 | |
// Download this snippet as a plugin and more at: https://wordbits.io/snippet/a-fun-bit-of-code/ | |
// Created by: Liam Dempsey | |
?> | |
<?php | |
// Some fun filler stuff | |
?> |
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 | |
// Download this snippet as a plugin and more at: https://wordbits.io/snippet/extend-the-public-post-preview-plugin/ | |
// Created by: Lauren Pittenger | |
?> | |
<?php | |
/** | |
* Public post preview pugin: extend expiration to 10 days | |
*/ | |
add_filter( 'ppp_nonce_life', 'fans4thecure_nonce_life' ); |
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 | |
// Download this snippet as a plugin and more at: https://wordbits.io/snippet/change-to-read-more/ | |
// Created by: Liam Dempsey | |
?> | |
<?php | |
//* Modify the Genesis content limit read more link | |
add_filter( 'get_the_content_more_link', 'sp_read_more_link' ); | |
function sp_read_more_link() { | |
return '... <a class="more-link" href="' . get_permalink() . '">[Read More »]</a>'; |
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 | |
// Download this snippet as a plugin and more at: https://wordbits.io/snippet/add-gtm-ga-other-code-to-site-header-and-or-body/ | |
// Created by: Fernando Ayala | |
?> | |
<?php | |
function hook_insert_in_header() { | |
/* Example for Google Tag Manager | |
Simply replace the code snippet below with the snippet that needs to be | |
in the header of your site. |
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 | |
// Download this snippet as a plugin and more at: https://wordbits.io/snippet/add-url-prefix-for-blog-posts/ | |
// Created by: Mark Vi | |
?> | |
<?php | |
/** | |
* Add new rewrite rule | |
**/ | |
function create_new_url_querystring() { |
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 | |
// Download this snippet as a plugin and more at: https://wordbits.io/snippet/auto-login-after-registration/ | |
// Created by: Ravi Patel | |
?> | |
<?php | |
function auto_login_new_user( $user_id ) { | |
wp_set_current_user($user_id); | |
wp_set_auth_cookie($user_id); | |
wp_redirect( home_url() ); |
NewerOlder