How to use wp_list_categories with plugin category?

I just tried the plugin you mentioned. You need to use following code to get categories from that plugin: wp_list_categories(‘title_li=Carousel%20Categories&orderby=name&taxonomy=carousel_category&hide_empty=0′); Notice the ‘taxonomy’ parameter in the querystring, it has the value of custom taxonomy registered by plugin. The default value is ‘category’ which is WordPress default category. For any other custom taxonomy you need to … Read more

Add pagination to a template loaded by query variable

After a bit of digging over the weekend, I found the solution and indeed, it is a rewrite rule with the paged variable added add_rewrite_rule(‘collection/men/page/([^/]+)/?$’,’index.php?post_type=collection&men=yes&paged=$matches[1]’,’top’); Pagination now works in the custom template loaded by query variable. i.e. localhost/sample-site/collection/men/page/2 loads the next page instead of a 404 error

Gravity Forms merge tags in templates?

The ability to use Gravity Forms’ merge tags in your post content might be helpful to you here: http://gravitywiz.com/gravity-forms-post-content-merge-tags/ If you need more specific control, you can fetch an entry like so: $entry = GFAPI::get_entry( $entry_id ); And echo out a specific field’s value from that entry like so: echo $entry[1]; // replace “1” with … Read more

Template code to split a post and print a custom field?

I’d suggest doing it this way to avoid running into problems where you split within a sentence/paragraph. Try splitting on <p> – then put the first element (first paragraph) into <div class=”content-first-half”> and the rest (if any) into <div class=”content-second-half”> in your template. It should be something like this (assuming $content has the html for … Read more

Splitting the_content() by size?

The function assumes wpautop filter on the_content is sitting at priority 10, where WP adds it. If, for any reason, it has been moved at another priority, the filter below should be adjusted to happen after wpautop. The function filters the_content if we are in frontend and we are on a singular post/page (feel free … Read more

Using page-something.php as static front page

Use ‘front-page.php’ for your template. You can read more about it at https://codex.wordpress.org/Creating_a_Static_Front_Page Or create a page template that you set in the editor. This will allow you to set it on any page and you’re not tied to the ID. https://developer.wordpress.org/themes/template-files-section/page-template-files/page-templates/ <?php /* Template Name: Example Template */ ?>

Get template part with CPT and Custom Taxonomy conditionals

Your order of your if/else statement is wrong. You would want to have your complex condition (or most important condition) at the top and the simplest (or least important condition) at the bottom. if/else statements work on the basis that the first condition that hits true will be executed. In your example above, if you … Read more