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 […]
Function: add_filter()
In this simple example, I ‘ll show you how to widgetized the home page of the Customizr theme by placing a widget area above the featured pages. In the following snippet, the widget area is added before the featured pages of the home page with the action hook named ‘__before_fp’. […]
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 […]
Let’s say you have created a slider named “my-slider” and you want to display it in your 404 page or in your search pages. Since there’s no option to style those pages from the WP admin, you’ll have to code something. Here’s a short snippet to do it. add_filter(‘tc_show_slider’ , […]
Hi, This short snippet allows you to replace the featured page image background by an embedded video. It uses the filter hook named : fp_img_src for which you can specify 2 parameters : the featured page name (one, two, three) and the id of the post used as a featured page. In […]
By default in the Customizr theme, the featured pages images use by priority : the page featured images if the featured image is not set, then it uses the first image (ordered by date) attached to this page. (in other words, the first images that has been inserted in the WYSIWYG […]
Updated March 2015 This snippet applies to Customizr > 3.3.1 and Customizr-Pro > 1.0.12. If you’re running an older version replace ‘tc_show_excerpt’ with ‘tc_show_post_list_excerpt’ The Customizr theme allows you to set the length of the posts content (full content or excerpt) in list of posts (blog page, home, archives, …) […]
Let’s say you’ve setup three beautiful featured pages on your home page. Now you might want to display this block of featured pages in another post or page of your website. This snippet will show you how to do it. Note : Customizr-Pro and Featured Pages Unlimited users should replace `__get_option` with […]
Those last days I have had a recurrring request on how to remove the text describing the HTML tags allowed in comments : “You may use these HTML tags and attributes …“. This is pretty simple to remove this note in WordPress since it is declared in an array assigned to a […]
Following the excellent javascript snippet from Rocco describing how to change the order of the content and the thumbnail, I’ll describe here the PHP way to hook into the property handling the post layout in post lists (archives, search results, …) and set new custom values, including mobile viewport detection. By […]
Learn how to add a navbar widget, so that you can put a Polylang Language Switcher dropdown in it
If you need to add Scrollspy to the Navbar: Where to copy/paste this code? We strongly recommend you create a child theme. Everything you need to know about creating a child theme with Customizr here. /* START OF Add Scrollspy to the Navbar (Needs additional php code in Child Theme […]