Tagged Questions

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

learn more… | top users | synonyms (1)

0
votes
1answer
771 views

Redirecting posts in Wordpress to a specific page

I created a page so that it would appear in my navigation menu. This page would however be my posts page (i.e. all posts would go here) and would also be my front page. I am unable to find anything ...
0
votes
1answer
239 views

Taxonomy Parent Name

Was just wondering how I would modify this piece of code: <?php $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); echo $term->parent; ?> ...to display ...
1
vote
1answer
3k views

tag.php doesn't work with tags on a custom post type post?

here's another stumper. I have a tag.php page. It works fine, unless you click a tag that is in a post associated with a custom post type. Then it doesn't work. Its like that tag, doesn't exist. But ...
1
vote
1answer
151 views

Plugin settings page template

When creating plug-ins for WordPress, there are times when you need to make a settings panel. Sometimes, you need more than one page, and they can be quite complicated. So far, I have been ...
0
votes
1answer
124 views

output custom Posts on a Page

I'm trying to write a function that will output a set of posts on a page. Because I want to display more than just the post titles, wp_get_archives() won't do (I think). The function to add the post ...
1
vote
3answers
928 views

if statement in sidebar.php checking page id or template or title

I have the following code in my sidebar.php file: <ul class="list-posts"> <?php $lastposts = get_posts('numberposts=5&orderby=date&cat=-52'); foreach($lastposts ...
0
votes
1answer
46 views

odd behaviours from template tags

Some of my template tags are playing up, and they have left me confused. On one site, that has been live for over a year without any of these issues, on all the pages that have custom query loops, ...
0
votes
1answer
239 views

Form post to Wordpress page = wrong template

I'm using permalinks and I have a page with a slug like this: http://www.mysite.com/jobs/ The page uses a specific template for itself. On another page I have a form that I submit as POST to ...
1
vote
1answer
435 views

Why are 404s not triggering my 404.php template?

404s are not triggering my 404.php template. The header status code, checked in firebug, is a 404, but the page that gets displayed is like a loop with 0 items (as if this were simply an archive page ...
0
votes
1answer
154 views

Show Homepage (only) Hits Count

I need a counter to put in my theme (using php) or widget to show homepage view counts I've tried "Cystats" but i couldn't get 'only' homepage hits by it how can I do this ? (there is a idea to show ...
0
votes
2answers
3k views

get_query_var() and permalinks

I have a permalink structure that looks like this, %category%/%postname% I have a category.php template coded up and and trying to pull of the post of a certain category, so for example my URL may ...
0
votes
1answer
399 views

Creating / Editing a post from within site template

I am developing a website that will allow multiple users to author short posts (Kind of like a job board) and I want to know how they can author or edit these posts from within the site template (Ie; ...
2
votes
1answer
1k views

Creating a wordpress plugin where users can override templates

I see plugins where users can override the plugin templates by creating files inside of their own theme folder, how does this work? Is this a built-in part of wordpress or does it have to be written ...
0
votes
1answer
340 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 ...
11
votes
1answer
14k views

How to create custom URL routes?

I have a very peculiar requirement, hopefully I can explain it without being too confusing. I created a page template where I list some properties I get from an external XML file, so far no problems, ...
4
votes
2answers
2k views

Use [embed] filter in template files

WordPress autmatically embeds a youtube video's if I use: [embed] http://www.youtube.com/watch?v=Xog1T5dUxcw [/embed ] This is great, but it doesn't work if I use it in an template file. I have a ...
0
votes
1answer
63 views

which template does wp_ tag_ cloud point to?

This is very embarassing. If I add wp_tag_cloud to my navigation in list form, it shows as I need it (like a sub nav). If you then click a tag what template is then used? I've tried adding ...
1
vote
2answers
3k views

Include a specific page in your template

How do you include specific pages into a template? Like for example on my websites main page I want to have about 3 different content areas that the client can regularly update as he needs to. I ...
3
votes
1answer
4k views

How to pass URL parameters for advanced taxonomy queries with multiple terms for one custom taxonomy

This answer provides the code for a query that returns an OR match on a taxonomy term: global $query_string; $args['tax_query'] = array( array( 'taxonomy' => 'status' ,'terms' ...
2
votes
1answer
2k views

Why does my short code get executed before other content?

I have the following text in a page. As you can see my shortcode is right at the bottom but somehow when the code runs, the out put of my shortcode is inserted at the top of the page instead of ...
1
vote
3answers
3k views

Add a #hash to the links in my custom menu

I have created a static frontpage where I load in the content of all my pages. Now I have a normal custom menu, but the links refer to the pages, for example: http://mysite.com/about Now the I want ...
1
vote
2answers
259 views

Get link to a specific template file [closed]

I was planning on creating a custom "Archives" template to create a detailed Archives page for my blog, including lists of posts by category, tag, date and author. Rather than use a static link ...
1
vote
1answer
150 views

I want to add a custom “all posts by author” by authors name. How?

I have a custom display of meta-info (authors name, date and categories). So, I want to display a custom link to all posts by author. By theme default I have this <?php the_author_posts_link(); ...
0
votes
2answers
570 views

How to have two different versions of a tag/category/taxonomy archive page?

I have a site that has two different bodies of content: more formal content (using various different custom post types) and a blog (using a blog post type). These two different bodies of content use ...
0
votes
1answer
956 views

Make Permalink go to specific template

I have a single post page that contains an audio player. I need place a link on the page that will open up the player in a pop up window. Simple right? My thoughts were that I have an additional ...
1
vote
3answers
798 views

Programmatically change post templates?

I need to change the template on several hundred pages on my site. Does anyone know if there is a command to do it programmatically? See the following code snippet; I'd like to replace my comment ...
1
vote
3answers
734 views

Is there a way to check which template file is being loaded, if it is not a page template file?

I don't see any way of testing which template file is being loaded, if the template file is not a page template. Otherwise I would use is_page_template(). For instance, I am using a home.php template ...
1
vote
2answers
281 views

How can I get this request to use the Custom Post Type page template instead?

I read the answer for this post which says you can do something like this: http://example.com?post_type=car&color=red When viewing $wp_query everything seems to be working fine. That is, I'm ...
5
votes
3answers
4k views

Is it possible to stop selected plugins from loading on certain template pages?

I have a template page that has form on that is only used once in my site. The form uses form validation using jquery validate plugin (such a great plugin). Once the cart66 Plugin is loaded, the form ...
3
votes
2answers
1k views

Need to give custom page template for each language in WPML

I need to give each page a custom/different page template for every language page in WPML. eg: Let i have a test page in English and french. Is there any way out so that in English i give sidebar ...
1
vote
1answer
304 views

Different Template based on HTTP Referer

He Guys, i've been looking for a way to show a different Page-Template based on HTTP Referer or maybe the User Agent or what ever. I'm planning an Image-Gallery which should be shown in a Fancybox. ...
1
vote
2answers
555 views

Easiest way to show total number of subpages

I am making a portfolio site where each portfolio entry is a subpage of "Work". In my template, I am trying to say something like: worked on 15 projects and counting, where 15 is the total number of ...
0
votes
3answers
414 views

Using the same database on another Subdomain

Hi i am currently replacing my blog run on wordpress with another neat theme. I tried the preview template feature and everything is fine, just that i don't trust everything so easily when it comes ...
3
votes
2answers
11k views

Can I assign a template to a custom post type?

can I assign a template file to custom post types? I have created a custom post type called items, and I would like to assign templates to the items like you can do with pages.
0
votes
2answers
1k views

Why is my taxonomy template not shown?

I have created a custom taxonomy for my site called projects with a matching template called taxonomy-projects.php. The problem is that when I browse to http://mysite.com/projects the template is not ...
0
votes
1answer
344 views

A problem with date archives

I downloaded a widget for my blog, which works just like the calendar widget but displays a custom post type instead. It correctly marks my CPT-posts and creates links, such as ...
0
votes
2answers
163 views

Catch all taxonomy template

I've created a custom taxonomy and I'm trying to get Wordpress to display the taxonomy template when no term is defined. Currently Wordpress is only showing the template when a term is defined on the ...
0
votes
1answer
65 views

Getting a WordPress tag to print inside of a traditional php echo

I want to get the template path to print in this echo of a form in the admin. Here is what I got: < ?php echo of_get_option('splash_img_transition', ...
1
vote
3answers
3k views

Display page content AFTER a loop of posts

This is probably easy once you know but I'm having trouble getting the static page content to appear AFTER a list of posts. I'm using a named page template which displays posts as a slider and I want ...
3
votes
1answer
3k views

How to make wp-signup.php a 1-step process [closed]

I'm developing a multisite for Real Estate agents. Wp-signup.php used the wrong page template from my theme (homepage instead of full width page template), so I took the meat and potatoes from ...
3
votes
2answers
1k views

How to get Images included in Post

is possible to get images added to a post programmatically? I am working on custom template (my first) and I need to display Images added to a post in specific way.(first image as title image and the ...
0
votes
1answer
98 views

problem with the loop

Hello I am working with my own template, and also using the post-to-post plugin, I am doing the following, <ul> <?php global $post; global ...
2
votes
1answer
217 views

Subpage template

I've had a look around already but couldn't find an answer to this. Is there a way to create a template that applies to all pages that have a parent? something like sub-page.php without having to ...
3
votes
2answers
761 views

Create built-in pages without creating actual pages

For example: site.com/contact (or site.com/?page=contact if not using permalinks) when someone goes to that page I want to load a theme template, like page-contact.php But I don't want to create a ...
2
votes
4answers
679 views

Template files missing after moving site

I just moved a site (by exporting & importing all posts & pages, and copying theme files over), and on the new site the various page and post templates are unavailable for selection on post ...
2
votes
2answers
406 views

What code do you use to generate the text to go into the HTML title tag?

The question title says it all. Myself I just stick with the default code from one of the packaged templates that comes with WordPress out of the box: <title><?php /* * Print the ...
0
votes
3answers
273 views

wordpress - modifying template to show more posts

i'm getting myself pretty confused. i'm trying to modify a template to show more than one post from the loop. here is the code from the template <?php $wp_query = new ...
0
votes
2answers
2k views

Wordpress Shortcode wrap around div

Is there a way to wrap a wordpress shortcode around a div in a template file? Here is my code: <div id="subscription"> <?php do_shortcode('[subscribe]');?> <p>This is subscription ...
0
votes
1answer
348 views

Load template inside a parent template

Inside of my current theme directory, I created a folder called "mobile" which contains a separate set of template files, all optimized for mobile. Now, say I setup a function that detects a mobile ...
1
vote
3answers
2k views

wordpress - load a template based on the URI

I have a number of custom of post types - i.e. 'windows', 'doors', 'garages' and I want to load a custom template (special.php) whenever my wordpress site has a url that looks like this: ...