Howdy WP developer! In this snippet, I will describe three different techniques to alter the WordPress default query with an example showing how to add a secondary page to the front page in the Customizr theme Those are quite advanced WordPress programming techniques, so before diving into it make sure you […]
Hook: WordPress hooks
By default, the latest posts list on the front page gets displayed in reverse chronological order and that is what latest posts is. Can you customize it further? Can you display random posts on the front page? Add this small bit of code to your child theme’s functions.php and you […]
In the alternate thumbnails layout, the default display shows the excerpt with a […] at the end. The thumbnail and the title are linked to the post. If you want to add a “Read More” link or a “Read More” button, here is how your do it. To replace the […]
To use Dashicons (the default set used in the WP backend) we need to enable them also for the front-end of our WordPress site, because by default WP allows Dashicons only for the back-end or for registered admins. Paste this code into your functions.php file /********************************************************/ // Adding Dashicons in […]
This text can be altered with a WordPress filter hook comment_form_defaults In the following code, simply replace Custom leave a comment by your own text : add_filter(‘comment_form_defaults’, ‘set_my_comment_title’, 20); function set_my_comment_title( $defaults ){ $defaults[‘title_reply’] = __(‘Custom leave a comment’, ‘customizr-child’); return $defaults; }
Updated February 24, 2016: Added the option to output either some text or a Font Awesome icon. In case you want to change the default word “Home” in the breadcrumb trail, to something different, this snippet will allow to change it. To use standard characters: just paste this function into […]
If you want your featured pages titles be a link to the featured pages, this snippet is what you need. You do not need to copy both versions, choose the one you like best! 1) Javascript version Compatible with FPU plugin, FP plugin, Customizr, Customizr-Pro add_action(‘wp_footer’, ‘fp_titles_linkizr’, 200); function […]
There are several ways to override the default comments view of the Customizr WordPress theme. 1) Overriding the comments.php template with a child theme. You can make a copy of the comments.php file of the theme, paste it into your child theme and add custom code there. The Child theme template […]
Updated August 2015: Added an option to automatically loop youtube videos (default true) and code updated to work with Customizr-Pro 1.2+ and Customizr 3.4+ Updated April 2015: Added an option to prevent the related videos showing (youtube). Updated March 2015: Added unmute on hover. This snippet works also with Customizr-Pro […]
WordPress offers built-in functions to display the previous and next post link. next_post_link( $format, $link, $in_same_term = false, $excluded_terms = ”, $taxonomy = ‘category’ ); previous_post_link( $format, $link, $in_same_term = false, $excluded_terms = ”, $taxonomy = ‘category’ ); As you can see there’s a boolean parameter named ‘in_same_term’. This […]
The Customizr theme displays by default your post titles as links pointing to the single post. Here’s a simple way (using some javascript) to remove those links if you ever need to. Paste the following code in your functions.php : add_action(‘wp_head’ , ‘remove_post_list_title_links’); function remove_post_list_title_links() { ?> <script id=”remove-links-in-title” type=”text/javascript”> […]
Following a user request on the Customizr support forum, I have worked on a simple solution to display your existing content as sections. The whole idea here is to use a selection of the pages and posts already existing in your website, and combine them on a single page. This allow to easily create […]