Linked Questions

52
votes
9answers
99k views

How do you find out which template page is serving the current page?

When you activate a wordpress theme, it's always a hassle to find out which file to go to change things. Any idea how to simplify things? But on the other hand, considering the get_template_part ...
9
votes
4answers
7k views

Best way to detect if you are in a SINGLE POST page

So this may seem like a pretty menial thing, but follow me here. I'm trying to add some logic through the pre_get_posts action. This is the entire WP_Query object given to me. (see the end) Things I ...
8
votes
4answers
2k views

Is there a variable for a template parts name?

One you have called a template with get_template_part() (or locate_template()) is there a way to know what template you are in. For example if you call get_template_part('loop','archive'); from ...
5
votes
3answers
424 views

Is there a hook or function I can use to display all theme files being used on a current page?

Basically I want to be able to see the names of files on the front-end - not just templates e.g. category/page templates, but the actual theme files like header.php/sidebar.php/footer.php and so on. ...
1
vote
4answers
4k views

How can I see what template parts are being called for rendering the viewable page?

I have a theme where the developer used get_tempalate_part() a lot, and these parts are scattered across theme subdirectories as well as in directories in a plugin that was created to assist with the ...
0
votes
3answers
7k views

How to use if (is_page_template (''))

i use the following code in my functions.php. I want to exclude all pages which use the single.php template. function cat_menu() { if (!is_page_template('single.php')) { $cur_cat = get_query_var('...
2
votes
3answers
2k views

Add parent template name to body class filter when visiting subpage or single post

how would I go about creating a filter for the body_class() tag that allows me to add the the parent pages slug name as a class to the body whenever visiting a subpage or post?
0
votes
1answer
2k views

Why get_page_template() doesn't show taxonomy template file name?

I made a custom taxonomy called - work-category and a template file for it called - taxonomy-work-category.php. That part work just fine. For a purpose I did put get_page_template() in that taxonomy-...
0
votes
1answer
443 views

Force WordPress to NOT display the manual excerpt

I'm forced to use manual excerpts on a number of my posts to integrate them with a shortcode plugin. However, this is interfering with how they're being displayed on an archive page (using a page ...
0
votes
2answers
629 views

How to identify which template WordPress's default search-form retrieves in my theme

I have a problem with the style of my search page, and I'd like to fix it. However, I'm not sure which template I need to modify. How do I find out which template is being called by my theme when I ...
0
votes
2answers
175 views

What is the best way to figure out which template file that a “pretty permalink” is using?

I'm new at wordpress, so maybe this question is very basic, but I looked at Google and I searched for tutorials and I didn't find anything... The question is simple. I have a "page", and this page is ...
0
votes
1answer
56 views

Strange Behavior of Page Template Dropdown

My wordpress is updated to latest version 3.4.1 and I noticed a strange function of it - in the Page attributes block page template dropdown has the value: (.*)\n)siU",$template_contents,$...
0
votes
1answer
32 views

Is there a way to retrieve the calling template part?

If I include a template part within header.php like this: <?php get_template_part('templates/social-icons'); ?> Is there a way to retrieve the template name header.php within this template ...