Search Results
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 |
Within the context of WordPress Theme-ing, the term 'template' refers to PHP files used to display content.
0
votes
Accepted
WP plugin calls for custom pages
You don't have to "include" plugins. Plugins operate, or should operate, by means of the extensive "hook" system built into WordPress core. Once activated, a plugin should not require much else (with …
2
votes
Loop through custom posts by taxonomy and display the titles in a list, it is repeating 8 times
You've hard-coded the term into the second query. Of course you are seeing the same thing every time:
$terms = get_terms(
'model',
array(
'orderby' => 'count',
'hide_empty' => 0
)
…
1
vote
How to customize core admin pages within a theme?
To my knowledge, you can't. The backend is not "theme-able" beyond enqueuing stylesheets and JavaScript. You can make significant changes that way, but the basic structure will stay the same.
All yo …
0
votes
Filter widget outputs
The stock "category" widget uses wp_list_categories() and passes the arguments though widget_categories_args in the process.
716 /**
717 * Filter the arguments for th …
2
votes
Accepted
get_month_link uses what wordpress template?
get_month_link() doesn't use any template. It just creates a link to date based archives. The actual template used is decided by a rather complicated template hierarchy system managed by Core. Essenti …
0
votes
How to pass a variable from a template page to the child theme functions.php
The theme's functions.php file loads first, before any other templates load. You can't pass variables backwards to something that has already loaded. …
1
vote
Accepted
Register Page Template from Plugin
You misunderstand what page_template does. It does not create a new template that you will "show up" somewhere and that you can use. It replaces the page.php template provided by the theme.
I think …
0
votes
Accepted
Convert HTML5/CSS3 site to Wordpress Theme (need a lot of plugins) or just use the API?
I don't really know what you mean by "using the Wordpress API in a site as opposed to making it a theme" but I am assuming you mean something like "use the backend but not the front facing stuff". So, …
0
votes
Show posts from all categories
You need get_categories() with an include argument:
if (isset($_GET['cat'])) {
$this_category = get_categories(
array(
'include' => $_GET['cat']
)
);
var_dump($this_category);
}
…
0
votes
Accepted
Custom Post Type homepage template
I am thinking you probably want get_template_part() to load CPT specific pieces of code. For example (from the Codex):
get_template_part( 'nav', 'single' ); // Navigation bar to use in single pages ( …
1
vote
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';
}
}
}
ad …
0
votes
Load different template for CPT (in loop) in my plugin?
There are no hooks in the load sequence triggered by get_template_part() that will help you.
get_template_part()
locate_template
load_template
And locate_template() is hard-coded to look at theme …
1
vote
Change site template from php
wp_get_themes() returns a WP_Theme object, one of the methods of which, get_stylesheet() will return the value you need to pass to switch_theme()
You are not likely to get "the variable" to echo late …
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()) {
…
3
votes
Is there any hook for theme activation ? or something similar?
I would suggest that writing files to the theme directory is the wrong way to approach this. You could potentially create multiple duplicate files, which is wasteful of disk space, and it is also poss …