Tag Info

Hot answers tagged

3

I think it's not exactly possible the way you want to achieve. It's really annoying to not getting a filter there to alter template files names :( I have a workaround on it though. Let use content.php for the comparison. // content.php file $format = get_post_format(); if( '' != $format ){ get_template_part( 'content-'. $format ); } else{ ...


3

There is no hook to do this. Copy the index.php to the child theme and make the single line change. Also, tell the parent theme's author that they should make the same change in their theme, for flexibility.


2

Use below code for getting post format, simple made condition if post format ="standard" then load your preferred template $format = get_post_format(); if($format ="video") { get_template_part( 'format', $format ); } Something like this.


1

If you are referring to the categories from the post type post (the blog) then this would do the trick: For a drop-down: wp_dropdown_categories() For a list: wp_list_categories() child_of Only display categories that are children of the category identified by this parameter. There is no default for this parameter. <?php // Put the parent ...


1

You are not wrong about conceptual limitation, but any development convention is inherently about constraints. Constraints are "bad", but they are also often good and important. In this specific case it's slightly soured by Settings API being especially nasty snowflake, which historically led people to reinvent this particular wheel a lot. However, your ...


1

See, It's quite difficult to have path like site/books/product_category/horror/ site/movies/product_category/horror/ As wordpress functionality will conflict between custom_post_type & their taxonomy if try to keep url like you mentioned. I suggest you consider the I mentioned below as a solution of your problem. ...


1

Define your template name in the custom template file. <?php /* Template Name: demo */ ?> After this the select template option will be available on the edit screen. You can choose the desired name you want.



Only top voted, non community-wiki answers of a minimum length are eligible