Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 21376

Within the context of WordPress Theme-ing, the term 'template' refers to PHP files used to display content.

-1 votes

how to create template path for external (include) .js file

The solution you found is almost correct but that ASP-like <?= may not be terribly reliable, especially pre-PHP.5.4.0. function add_templateUrl_var() { ?> <script type="text/javascript"> …
s_ha_dum's user avatar
  • 65.5k
0 votes

Remove Items from Template Homepage

As long as you don't break the PHP or the HTML markup you can delete anything you want. I'd recommend building a child theme over editing one, and you'd want to steer clear of commercial themes that h …
s_ha_dum's user avatar
  • 65.5k
2 votes
Accepted

How do you modify Page Template?

That is how custom templates work. Altering the output those templates is a code edit except where the templates have been written to include the post body, or meta fields, etc. …
s_ha_dum's user avatar
  • 65.5k
2 votes
Accepted

Change the template when the user is not logged in using page_template filter (it does not w...

Your code doesn't really do any "user logged in" check, and you aren't using a couple of the globals you import. function restrict_access_to_unlogged_users($template) { if (!is_user_logged_in()) { …
s_ha_dum's user avatar
  • 65.5k
1 vote
Accepted

How do I define a lookup table that will work across all PHP elements of the template?

. // define global $trans_home; $trans_home = array('en' => 'Home','it' => 'Home','de' => 'Home','zh' => '首页','es' => 'Página de inicio','fr' => 'Page d\'accueil'); // and use in your templates global …
s_ha_dum's user avatar
  • 65.5k
0 votes

Page.php vs Single.php

What should I check to fix this issue? Your header.php. Your Widgets. Your sidebar code. Even your CSS could lead to the appearance that the <div>s don't nest. Identical code does not produce d …
s_ha_dum's user avatar
  • 65.5k
1 vote
Accepted

My template won't apply, theme still fallback to index.php

codex_custom_init() { $args = array( 'public' => true, 'label' => 'Books' ); register_post_type( 'book', $args ); } add_action( 'init', 'codex_custom_init' ); WordPress will then use these two templates
s_ha_dum's user avatar
  • 65.5k
1 vote

Generate Catalog Of Posts Based On Template

$templates = $wpdb->get_results("SELECT * FROM {$wpdb->postmeta} WHERE meta_key = '_wp_page_template'"); var_dump($templates); ... to get your templates... … '"); var_dump($templates); You cannot get the automagically assigned templates this way, if that is what you need. …
s_ha_dum's user avatar
  • 65.5k
0 votes

Template with Custom Post Type (Custom Tables) does not work

Question #1: I don't really understand this question, but what you have done looks alright. I might add the pre_get_posts filter in the same place as register the post type-- presumably a plugin file- …
s_ha_dum's user avatar
  • 65.5k
1 vote

How to retrieve depth of menu into template

how to get the relation between the page and the menu item ? = is there a WP function telling this page is linked to this menu item which has or hasn't a parent Inside the walker, inside the …
s_ha_dum's user avatar
  • 65.5k
0 votes

Prevent private post 404

You are not seeing a redirect, to confirm your own observation, so much as you are seeing just what it looks like-- a "File Not Found". Take a look at the query in the source around line 2438 (among o …
s_ha_dum's user avatar
  • 65.5k
2 votes
Accepted

How can I make front page to display custom taxonomy page?

I agree with @KrzysiekDróżdż While you should probably be able to do this it might be unnecessary work. However, this works with I test it, just change the category/term name and the template name (t …
s_ha_dum's user avatar
  • 65.5k
1 vote

Post Templates and Post ID's

But for some reason my posts get overridden instead of displaying new data. The problem is here: $announcements->query('showposts=1&cat=$category_id'); You are trying to use a variable inside …
s_ha_dum's user avatar
  • 65.5k
0 votes
Accepted

Given a page ID, how to display entire page (header/content/footer/sidebars) from a plugin hook

I would like to know if it is possible to display the entire page given a page ID Yes, http://site.com/?p=ID or http://site.com/index.php?p=ID. Request that address via AJAX or the HTTP API. Wo …
s_ha_dum's user avatar
  • 65.5k
0 votes

Show admin page, only if function is being used

I would like to suggest that you are doing at least a couple of things wrong. First, if you want to "share" functions between themes copying functions.php is not a very robust way to do it. You will …
s_ha_dum's user avatar
  • 65.5k

15 30 50 per page