Questions tagged [templates]

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

Filter by
Sorted by
Tagged with
4
votes
3answers
4k views

Loading template files from a subfolder in my theme?

I am working on a site that will have up to 30 templates in it. I don't want to have all those templates at the root of my theme folder cluttering up everything. I know how I can modify the ...
0
votes
1answer
607 views

Correct way to add a block element to sidebar layout

First time experimenting with wordpress and looking for advice on the correct way to add a block of html to a sidebar. This doesn't seem like a custom widget to me as there is no functionality ...
2
votes
2answers
1k views

A shared custom taxonomy between two custom post types

I have two custom post types: event and contact: http://acicafoc.josoroma.com/contactenos http://acicafoc.josoroma.com/eventos Both of them uses a custom taxonomy: country I just created a ...
28
votes
2answers
30k views

Get custom post_type's archive URL

It seems like stupid question. But, I can't figure it out :(. I need to display button at home that goes to custom post_type's archive URL (archive-{post_type}.php). How do I do that?
0
votes
2answers
2k views

Custom Fields to Category edit page, then displaying them in a template correctly

Seem to be having a few issues with this project lately so sorry for spamming questions! I needed to give the category edit page in the admin a few additional fields to allow my client to manage them ...
2
votes
1answer
1k views

Can I apply a WP theme to a specific custom page template?

One section of my website is going to be completely different visually than the rest of the pages, is there a way to apply a WP Theme to specific page templates ?
0
votes
1answer
275 views

Update template without undoing all my edits?

I want to edit a wordpress template to have a look and feel more like I want. With things like my flair on it. After I change the template, does this mean I can no longer update it without reverting ...
0
votes
2answers
577 views

Custom post_type search pages

So I have a section on my site that specifically searches a custom post type for YouTube videos. I'm absolutely able to search the custom type. However, I'm unsure how to create a search page that has ...
1
vote
2answers
203 views

Possible to make a subdirectory that loops through a single category?

I'm trying to separate the main part of my blog (the informational portion) from more commercial parts. WHen you load my homepage, I purposely exclude a category because I don't want my normal ...
2
votes
1answer
291 views

modifying a template and adding jQuery to it

There is a page template called "All Bookmarks" for displaying all links grouped by category. I want to modify it 2 ways: each category of links should be collapsible/expandable by clicking on the ...
0
votes
1answer
841 views

where can I see my custom post type archive template?

I am working with wordpress 3.1 and have custom post type of whitepaper. My single-whitepaper template seems to be working. But the archive template (archive-whitepaper.php) is not. And this after I ...
6
votes
1answer
5k views

How to find the posts page (home page) programatically

What php code can be used to find the page object that hosts the blogs? Note that this may not be the same as the first page of the web site. In the admin section we can specify in which page to ...
67
votes
9answers
111k views

Get name of the current template file

I've found this to display the current name of the file used in template: function get_template_name () { foreach ( debug_backtrace() as $called_file ) { foreach ( $called_file as $index )...
0
votes
2answers
3k views

Display only deepest category on a single post?

I want to display the direct category ancestor of a given post. An illustrative example: These are the categories I have: Cat1 Cat2 Cat2.1 Cat2.1.1 Cat2.1.2 Cat2.2 Cat2.2.1 Cat2.2.2. Cat2.3 ...
0
votes
2answers
597 views

Is there any tool to find lines of codes responsible to generate front-end HTML elements?

Dreamweaver CS5 is very useful to design or modify a Wordpress theme. It inspects CSS elements in Live view (after seting up a test server), but its unable to trace original wordpress code responsible ...
0
votes
1answer
198 views

How to make post templates to include shortcodes only?

I used to post same shortcodes every time (shortcodes loads dynamic contents). So, I want to pack these shortcodes in a template for my posts. How can I do this?
0
votes
1answer
444 views

What's a good way to unenqueue all scripts for a single template page?

I've found that my attachment templates are inheriting the enqueued scripts for single posts. My first instinct was to unenqueue these scripts one-by-one or to do an is_attachment() check before ...
0
votes
2answers
195 views

Function Reference Documenting Template Tags for use in Custom Theme Templates?

(Moderators Note: Original title was "custom template / wordpress functions?") I'd like to use a modified WordPress theme template and was wondering where I can find a reference for the .PHP ...
1
vote
1answer
325 views

List Category Posts rewrite necessitates rewrite of customised templates

I just upgraded the List Category Posts plugin from .17 to .18.3, and it broke my customised template :(. My setup: WP 3.0.4 multisite network enabled, local installation with MAMP, PHP 5.3.2. LCP ...
0
votes
1answer
508 views

Custom Page Template [closed]

Could somebody help me make a custom page template? I'd like to have a basic page (with sidebars, header and footers) and a table for data. I'd like the data to be taken from custom fields. ...
3
votes
3answers
5k views

Load post with a different template?

Let's say I have a single.php file with a certain layout (graphic intensive). I want to create a sort of plain-text version of the same page that is only called when the user clicks the provided link....
0
votes
1answer
565 views

Run a jquery script on on a certain template page

All I want to do is basically this: wp_register_script( 'jquery_zebra', get_bloginfo('stylesheet_directory') . '/library/scripts/jquery.zebra.js', array('jquery')); wp_register_style( 'css_zebra',...
0
votes
2answers
3k views

How To Remove The “Click here to cancel reply” Link From The Wordpress Comment Form

I am trying to remove the "Click here to cancel reply" link from the Wordpress comment form on my posts. In the document there is an argument you can supply to the comment form function to remove the ...
0
votes
1answer
353 views

Showing different posts on category pages

I'm using the following code to display posts on my category page but would like to carry the same format through on to the second page of the category as at the moment it moves to the second page but ...
3
votes
1answer
2k views

How to quickly switch custom post type singular template?

I have a custom post type called movies and I need to quickly switch the template that displays the movies cpt on the front end via a link. How can this be done? Files I have: single-movies.php ...
0
votes
1answer
237 views

Displaying categories in different template problem

Greetings! Sorry for the vague title decription - Couldn't word it any different. In my index.php page I have the following code: <?php if (is_category('6')) { ?> <?php include (...
0
votes
1answer
150 views

Removing comment option

I am working on a theme that I found here: http://top-wordpress.net/ The theme is Terapy. I turned off comment option in the admin panel, but the blog posts show that "commenting is not allowed". I ...
-1
votes
1answer
1k views

front page won't change templates

I have tried changing the template of the attached page and changing which page is attached as the home page, no effect for either. The front page remains the same. I am at my wits end with this one!!
2
votes
4answers
3k views

Grid layout “last” class to every third item

Seems like a trivial problem but I can't get it to work. I need to add class="last" to every third post. Here is my code: <?php $count = 0; $my_query = new WP_Query('cat=-18,-7&...
0
votes
1answer
1k views

Custom Post Type, Custom Taxonomy Template: How to get current taxonomy name?

Ok so i have a custom post type called 'profile' with a custom taxonomy called 'company'. The site has many profiles and companies defined, with profiles being associated with companies as necessary. ...
4
votes
1answer
713 views

Outputting Canonical Resource URLs Across a Multisite Network?

Say a theme "foo" is used on across a network of sites. In each site, all the theme resources (.css, .js, etc.) will have distinct URLs: http://network/siteA/wp-content/themes/foo/style.css http://...
2
votes
1answer
798 views

Template tags for Buddypress

Is there a place that shows all available template tags and how to use them similar to how wordpress does? I'm trying to link to a profile within a loop. Ex of output <a href="http://www.mysite....
2
votes
2answers
194 views

How to control template resolution if both Author and Category filter in place?

The following url resolves to the category template: http://localhost/author/myusername/?category_name=somecategory I have a category-somecategory.php template and just a generic author.php template. ...
0
votes
3answers
6k views

Removing Wordpress Footer -without access to PHP code?

I want to remove the "powered by wordpress" and theme name in the footer, but all the tutorials refer to clicking on the "Appearance" tab, clicking on an edit button, and then going to the php ...
11
votes
3answers
19k views

Any advantage to using get_header() over include('header.php')?

The basic theme - in fact every theme I've looked at - uses get_header() to include the header file, but I don't see any reason for doing so. What's are the advantages of using get_header() instead ...
1
vote
1answer
1k views

Custom post type content using custom fields without template

When I first heard about custom post types I thought it would solve an old "problem" I have, so I was thrilled. But when I tried to setup something I couldn't achieve what I want. So I'd like to know ...
1
vote
1answer
179 views

How can I detect hierarchal relationships beyond children (grandchild, great-grandchild, etc)?

Often times, a custom theme for Wordpress will require a dynamic content that reflects a relationship to a top level page of a site. Is there a Conditional Tag that will check if the current page is ...
0
votes
2answers
13k views

Footer.php not showing?

Here is my index.php file, for some reason the footer.php isn't being loaded through really weird, its in the directory of my theme, what could be causing this? <?php get_header(); ?> <...
4
votes
3answers
8k views

Make all subcategories use the template of its category parent?

How can I make all subcategories use the template of its category parent?
5
votes
2answers
6k views

How to customize the default HTML for Wordpress Attachments

I'm using Wordpress 3.0.1 (most recent as of now) and working around the Whiteboard theme. It seems that for attachments (images, specifically), Wordpress generates the HTML automatically and it ...
9
votes
4answers
2k views

Is there a WordPress plugin that registers a plugin file as a custom page template?

I need to create a plugin that makes custom page templates available in wp-admin. I'm wondering if someone has tackled this already, as it seems like a pretty typical process?
0
votes
1answer
804 views

Using shortcode in template file

this is shortcode in template: function shortcode_frame_left( $atts, $content = null) { return '<span class="frame alignleft">'. do_shortcode($content) . '</span>'; } add_shortcode('...
1
vote
3answers
403 views

Advanced templating / Wordpress as a CMS questions

I have a Web site that consists of several pages, with different layouts, and also a blog. I would like all these page to be editable through Wordpress, rather than having them as custom pages ...
70
votes
4answers
88k views

Create custom page templates with plugins?

Is it possible to make custom page templates available from a plugin?
1
vote
6answers
5k views

How to display nothing (instead default) when no user gravatar is present?

Is there a way to show no gravatar in comment list for the commenters that are not registered at gravatar.com? As much as I saw, gravatar.com doesn't return a special code when no avatar is ...
1
vote
2answers
801 views

How to support custom templates on a custom post type?

I'm stucked at some point developing my theme. I created a custom posts types to support an image gallery. So far, it's working great (have a look on 'galeria' on psaikali.com). I registered this ...
1
vote
2answers
227 views

Using wordpress template tags within an array

A bit of a noob PHP question coming up. I am trying to create a generic archive style view for my custom post types. Ideally I want to create one generic template that can be used for all post-types. ...
2
votes
3answers
196 views

What is a good way to present templated content in WordPress?

I'd like to be able to add a template for a page that will present pages with similar data in the same style. For example, I want to be able to create a "Person Profile" template so that all personal ...
1
vote
1answer
311 views

Need Category RSS Feed that shows all posts

How do I go about making this? I've been trying to get add_feed and such but have had no luck.
14
votes
2answers
31k views

Adding Page Attributes Metabox and Page Templates to the Posts Edit Page?

(Moderators note: Title was originally "How can I add the "Page Attributes" and/or "Page Attributes > Template" selector to POSTS editor") WP currently only allows the assignment of a "template" to ...