Exclude category from Tag Template

Have you tried using a normal loop in your tag template like this <?php while ( have_posts() ) : the_post() ?> //add content code or template <?php endwhile; ?> And then using the pre_get_posts filter like this function exclude_category( $query ) { if ( $query->is_tag() && $query->is_main_query() ) { $query->set( ‘cat’, ‘-433’ ); } } … Read more

Use another author.php if different multisite subsite?

This was the solution.. // different author template */ add_filter( ‘template_include’, ‘author_template’, 99 ); function author_template( $template ) { if( !is_main_site() and is_author( ) ) { $new_template = locate_template( array( ‘other-author.php’ ) ); if ( ” != $new_template ) { return $new_template ; } } return $template; }

How can I get WP to use templates in lower-level subfolder?

Whilst you’re correct in saying WP will only scan directories 1 level deep for templates, since 4.4 you have complete control over the theme_page_templates filter (you can now add to as well as remove from the list): add_filter( ‘theme_page_templates’, function( $templates ) { $templates[‘page-templates/another/directory/template.php’] = ‘Another Directory Template’; return $templates; });

How to remove wp_link_pages() from template

No you don’t remove it from /wp-includes/post-template.php. This is a WordPress core file and you should never edit any WordPress core file. The answer is talking about removing the call of wp_link_pages function within a template file. Which template file to edit depends on the theme and the URL you are visiting. Typically it should … Read more

When a link doesn’t exist, how to tell WordPress what to do? (404 Error Page)

The conditional you use to output get_template_part(‘content’, ‘none’); is only triggered if there is no post in the main loop, for example, when a category has no posts in it: if (have_posts()){ while(have_posts()) { the_post(); // If the category has a post and we are on a category page, then show the posts get_template_part(‘content’, ‘archive’); … Read more

How to get the HTML until ?

Front end styling is usually a theme territory that plugins should avoid. There is no simple way to know how anything is styled without actually doing the full styling, as some of it will depend on the content itself, and since the styling is basically random from the plugin author POV, you are unlikely to … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)