problem including page template

I think you meant to use: get_template_directory() Codex: Absolute path to the directory of the current theme (without the trailing slash). (link) instead of: get_template_directory_uri() Codex: Retrieve template directory URI for the current theme. Checks for SSL. (link) if you’re using include() for PHP code. But you should rather consider using: get_page_template() Codex: Retrieve path … Read more

Content vs Template on custom post

You can not replace half of a template by using filters and hooks if the template itself doesn’t support so. The template_include will override an entire template, it means header, body, content, sidebar, footer, and everything. Now you have these options: Style Your Template Create a full single-my_member.php file and then style it by CSS … Read more

How do I go about looping through a advanced custom field on a particular page inside of another page

Figured it out just had to do this , the page-custom-field.php is included to shorten the code. <?php $query = new WP_Query( array( ‘pagename’ => ‘features’ ) ); ?> <?php while ( $query->have_posts() ) : $query->the_post(); ?> <?php include page-custom-field.php’ ?> <?php endwhile; ?> <?php wp_reset_postdata(); ?>

Put CSS inside a PHP file and include it the right way

You might try conditional classes instead. In your regular “style.css” file you would include both classes: .theme-header-title.green { color:green; } .theme-header-title.blue { color:blue; } (Tip 1: avoid !important, just use a more specific style if needed – for example, h1.theme-header-title.green.) Then in your HTML, which is likely in your “header.php” file, you’d use the Customizer … Read more

For custom templates, is it better to use `template_include` or `type_template`?

{type}_template is a filter inside the get_query_template function. That function is called by a series of functions called get_home_template, get_category_template and so on. It allows you to very specifically target templates. You can see it in action in template-loader.php, where the $tag_templates variable is defined, binding conditions like is_home, is_category and so on to the … Read more