Tag Info

Hot answers tagged

2

As the codex page of get_template_part() says: get_template_part doesn't return a value and doesn't warn if it fails to find a matching template file. Additionally: If you want to hear about failures, use: <?php assert( "locate_template( array('$name-$slug.php', '$name.php'), true, false )" ); ?> So no wonder you are get nothing back. ...


2

From my comment to the OP My opinion, use what you are comfortable with. If there are any performance difference it will be minute/irrelevant. My preference, use the filter To come to your real concern/question, in my opinion, the best approach will be to use the parent category ID and work from there. It will be the least resource intensive to work ...


2

Technically speaking all you need is the Theme Name in your stylesheet header. This will identify your theme. All the other info is need-to-know info and can be omitted. If your theme is a child theme, you will need to have Template as well as this will be the path to the parent theme.


2

To be honest, there is no correct or wrong answer here. I do believe that templates are theme territory, although custom post types and taxonomies belongs in a plugin The reasoning behind this is HTML mark up across the theme should be uniform. For instance, if you have templates in a plugin, and you have customized it for the current theme, it will most ...


2

Basic how and why Extending on my blog post about that topic: When you enter a password into a form built by get_the_password_form(), the form targets ~/wp-login.php with a query argument named postpass which is the $action the login file uses to switch. There the PasswordHash class gets into use and a cookie gets set [...] When does it happen? The ...


1

A hierarchical custom taxonomy works is the same exact way as would the build-in taxonomy category. On the other hand, non hierarchical taxonomies would work exactly like the build-in taxonomy post_tag You have to add terms to your taxonomy in the same way as you would add "categories" in the category screen back end. The template taxonomy-locations.php ...


1

Templates in general have a strict naming convention according to the Template Hierarchy, regardless of sidebars included or not. Wordpress uses template names according to this hierarchy to decide what template should be dished up for the specific page being viewed. Any template not following this naming conventions set out by the template hierarchy is ...


1

If you need to change the template used, you can use the template_include filter (change "itermediate-template.php" and "page.php" with correct file names of your template files): add_filter( 'template_include', 'cyb_exclude_template_for_editors', 99 ); function cyb_exclude_template_for_editors( $template ) { $user = wp_get_current_user(); if( ...


1

So long as a plugin / theme doesn't use the dreaded !important rule in their CSS files, you should be quite alright to include your own CSS, and over-ride their settings. However some very badly written plugins / themes do use the !important rule, which unfortunately makes it difficult or even impossible to over-ride their styling. In situations like this, ...


1

You could try the loop_start hook depending on what position you want the image and use the code in your functions file. add_action('loop_start', function() { if(is_page(10)) { echo do_shortcode('[plugin_shortcode 1 .....]'); } else if (is_page(11)) { echo do_shortcode('[plugin_shortcode 2 .....]'); } else if (is_page(15)) { echo ...



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