Adding text to the footer of each post based on tags or categories

I would suggest a filter on the_content much like: function conditional_footer_wpse_165930() { if (is_single()) { if (has_category(‘cat’)) { return ‘This is the cat footer’; } } } add_filter(‘the_content’,’conditional_footer_wpse_165930′,PHP_INT_MAX); I am not sure about all of the details you require. You may need to tweak that code.

Page Template with Sidebar Naming Convention?

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 … Read more

Can i exclude certain page templates for a specific role?

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( in_array( “editor”, (array) $user->roles ) && is_page_template( “itermediate-template.php” ) ) { $new_template = locate_template( array( … Read more

How are the HTML classes generated?

By default WordPress adds lots of CSS classes in body tag automatically. These body classes are very useful for styling different sections/pages of site without needing to edit theme files unnecessarily. For example WordPress add home CSS class on website front page and blog class on blog posts index page. Similarly in your case, since … Read more

Will placing custom templates in sub directory break any native WordPress functionality

Since WP 3.4 page templates can be stored in theme root folder or direct sub-directoryr, that is no problem. But rename page templates, which include moving files to other directories, will unassign that page templates for all pages currently using it. To reassign the page template, simply edit the page, and reselect the desired template. … Read more

use a custom page to display search results

I noticed that your goal is to have an editable content on the search result. You can use another method to do that, by calling the content of the page from your search.php file. You can start by creating a page with the slug search-page as usual. You can also add post meta / custom … Read more

Import a header template from another theme

As you have now stated that both Theme A and Theme B are already Child Themes, perhaps you could try adding this to your funcions.php file in Theme B – add_action(‘wp_enqueue_scripts’, ‘enqueue_front_scripts’); function enqueue_front_scripts(){ /** Switch to the parent blog */ switch_to_blog(1); // You may need to change the ID, I don’t know what ID … Read more

How to use another file instead of home.php

You could filter home_template, check for the presence whatever $_GET var is reliably set for each of those requests, and load a different template for those cases. function wpd_home_template( $home_template=”” ){ if( isset( $_GET[‘search_type’] ) ){ $home_template = locate_template( ‘homesearch.php’, false ); } return $home_template; } add_filter( ‘home_template’, ‘wpd_home_template’ ); EDIT- fixed incorrect var test.

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