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
0answers
27 views

Use one template for different custom post types with the same markup

I am wondering how I can create one template for multiple custom post types. How can I achieve this?
0
votes
1answer
7 views

Show a custom template, no matter the page being viewed, if the user is not logged in

I have been tasked with creating a WordPress site where subscriberes (registered by an admin) are unaware of the back-end. I also have to make it so that upon navigation to any page, if the user is ...
1
vote
1answer
59 views

Is there a way to set different post templates for parent posts and child posts in the same post type?

After taking a look through the questions suggested to possibly have my answer, I still can not seem to find something that I references the post-template php files. I have two custom post types that ...
0
votes
1answer
26 views

get_template_part returns NULL

I am making a one page site. I have a custom loop that is hooked to the navigation so that only the posts, pages that are in the navigation will show up in the loop. I have found that using ...
0
votes
2answers
36 views

Retrieve post modified date for specific post by post ID

I am looking to use the 'the_modified_date' function to display the date and time of a specific post has been modified. This information will appear in the header of our website on every single page. ...
0
votes
2answers
3k views

Customizing get_the_excerpt() to specific length and “Read More” output.

I am costuming a template. There is a list grabbing the introduction from the first 1-2 paragraphs (all the articles from a category). If I set the excerpt to 295 words, sometimes the list grabs ...
0
votes
1answer
257 views

Why won't the action hook wp_head won't accept parameters?

I'm working on a plugin that adds scripting to the head using add_action('wp_head',..); I have to pass a variable to the function to get my desired result. To test this I'm simple "echoing" out the ...
0
votes
1answer
337 views

Create template for taxonomy results limited by Custom Post Type

I've got a Custom Post Type with a Custom Taxonomy set up. So how do I create an archive template to display posts from that CPT, limited by taxonomy? Here's the deal: The CPT is called Shows. Each ...
-2
votes
2answers
32 views

My homepage's width has reduced and I can´t fix it [on hold]

I am creating a site for a friend of mine and I'm having trouble with the width of my homepage. The homepage is set as a full width page but when you view it it only displays about 60% of the span. ...
0
votes
0answers
21 views

How to avoid hardcoded text in a custom page template?

I'm developing a company Website using Wordpress 4. This website needs some special, customized pages - with forms and GET and POST and a lot of stuff, so a lot of PHP code. Now, a CMS' main purpose ...
0
votes
2answers
87 views

create single.php for specific category by category id

I'm trying to create template for specific category with id 1 for example. The template should be applied to all of the pages belongs to this category. So, it should be something like single-1.php. I ...
0
votes
2answers
26 views

Different templates for same content, landing page from different URLs (generic, simple)

I was wondering if anybody has a good idea how to solve this cheap. Assume there are two urls: example.com/portfolio-xyz example.com/portfolios/someidentification ...
0
votes
4answers
435 views

Page template not displaying

I dont get why this isnt working. I have a custom page template, page-politics.php. It should look similar to this page: But its displaying this: Ive double, triple checked that the right ...
0
votes
0answers
28 views

How to generate custom loop indexes

Besides the regular taxonomies, such as category, tag, author, archive, I also have some special indexes to display, such as list of all sticky posts, simple chronological index of all posts, top ...
0
votes
2answers
2k views

How to edit contents of dynamic_sidebar()?

I know PHP well but I'm new to Wordpress. I got an incomplete Wordpress website. It has a static home page with an Aweber newsletter form. I tried digging into installed theme and in home.php I came ...
0
votes
1answer
39 views

How to make my category archive behave like a page

I don't want to use the category page as usual (list of posts). I would like to add more content: text, images, columns. Which is the best solution? Maybe redirect from a category page to a page? ...
0
votes
1answer
332 views

How to retrieve depth of menu into template

In wp_nav_menu i use for the menu, with custom walker, i can get the $depth parameter in the start_el function function start_el(&$output, $item, $depth, $args) but, outside this ...
1
vote
1answer
1k views

Shared Content but “Updatable” Through the Main Site

I have been doing quite a lot of research the past week, and have not been able to find a solid answer that fixes my problem. So, I decided to come here to ask to see if anyone knows of how to help ...
0
votes
2answers
1k views

How can I force URL of a custom post type archive to use a page template?

I have the following custom post type: if ( $args->has_archive ) { $archive_slug = $args->has_archive === true ? $args->rewrite['slug'] : $args->has_archive; if ( ...
0
votes
0answers
31 views

My rows are wonky! [migrated]

I am building a theme template page that calls up all the child categories of a particular parent and displays them so that they look like this: The only trouble is that when any row has less than 3 ...
0
votes
1answer
29 views

I want to rel=nofollow wordpress images

I have a default theme. When i add media to wordpress site. By default it use simple "a href" tag I want to add attribute "rel=nofollow" to it. Can anybody please point me in right direction?.
0
votes
2answers
285 views

Rewrite rule shows 404 page

I am new to Wordpress so I don't really know how the rewrite rules should look like. My problem is that I have a custom template in my theme called portfolio-inner.php My rule looks something like ...
-2
votes
0answers
7 views

Nofollow wordpress images [duplicate]

When we add media(images) in the default wordpress theme. I want to change the tag which which is used before the img and after the img. I want to add “ rel='nofollow' “ attribute to ahref tag.Like ...
0
votes
0answers
22 views

Displaying all posts of a category in a page, using a template?

I am writing a plugin which (among others) wants to display posts of a certain category within a page. While I can do that with the various functions there are available (WP_Query etc) to iterate ...
1
vote
3answers
337 views

WP frontend output of custom textarea fields not respecting line breaks. In admin it's OK

WP frontend output of custom textarea fields not respecting line breakes. In admin it's OK. Right now I am using this: <?php $options = get_option('my_custom_plugin_options'); ?> <?php echo ...
0
votes
2answers
375 views

Calling an image within the theme folder from inside a post/page?

I am building a website for a client of mine who would like the ability to make minor layout changes themselves. Because of this I am coding some of the layout directly into pages using the text ...
0
votes
1answer
388 views

Create a custom taxonomy template that loops through child categories in term order?

We're building a site that sells Biking Gear We're using the Genesis Theme Framework, and developing a custom child theme. It has a Custom Post Type for Products, made with the "Custom Post Type UI ...
0
votes
1answer
6k views

How to get current post id of a custom post type in a loop using template singel-{custom type}.php?

I have a custom post type template where am looping through all post. what i am trying is when i go to my custom post page i want to get the current post id in the loop. So i tried to check if the ...
0
votes
1answer
442 views

Category link redirect to custom template page instead of index.php?

I want to make template page for my custom taxonomy. I have custom taxonomy categories listed as navigation links. It's the country list (China, Slovenia, Serbia...). Every of this categories has ...
0
votes
1answer
30 views

Get page id by template

I want to know if it's possible to get the ID of a page with a specific template. Is this possible to get the ID of a page that assigned to "page-special.php"?
0
votes
2answers
985 views

add_rewrite_rule and template redirect not working

I have the following pairs: add_rewrite_rule('^questions/ask/?','index.php?pagename=ask','top'); if(is_page('ask')){ $tname = 'add-question.php'; ...
0
votes
2answers
318 views

Can I have both front-page.php and index.php?

I've made a custom front-page.php which includes "the loop" and it works great. I would also like to have a separate page which is the regular old posts page you get from index.php. How do I make a ...
0
votes
0answers
28 views

Redirect File Custom Post Pagination Problem

I've created a custom taxonomy type ( gallery-type ) for gallery post type! But, I didn't create for taxonomy-gallery-type.php in my theme folder, but I redirected to another php file from theme ...
2
votes
2answers
253 views

Get image URL from media library in input

On wp-admin/post.php?post=447&action=edit for example I have a link and an input. The link appears as follows: <a href="#" class="button insert-media add_media" data-editor="tj_image_url" ...
0
votes
1answer
23 views

Taxonomy template by post type

I have 2 custom post types that share a taxonomy. The taxonomy template of my taxonomy ( taxonomy-my_tax.php ) will query both custom post types. Is there a way to have a taxonomy template for each ...
0
votes
1answer
243 views

Show page title just from the first child-page in template

how can I do this: Pages: Home - sub-1 -- sub-sub-1 --- sub-sub-sub-1 On home-page should only show the page-title of the first child-page like: sub-1 I found this: <?php $child_pages = ...
0
votes
2answers
37 views

Add Date & Author Meta to Category Archive Page

I want to add author name and date on category pages under Title. Here is the page But i don't how i can edit it ? where i have to go to find category template file. By Googling i found it is ...
2
votes
1answer
2k views

Passing parameters to a custom page template using clean urls

I am now passing parameters to a custom template in the following format www.example.com/?pageid=12&rid=24&title=this-is-the-title I have created two tables . So I need to fetch data and ...
0
votes
2answers
1k views

stop blog page from using index.php?

I have a static homepage with a custom template I.E hompage.php the blog loop is set to a static page named blogg, it uses the index.php page as a template, there a collection of other pages using the ...
0
votes
1answer
32 views

How do i load a different template for different users screen width

How can i load different templates for different screen sizes.Or is there some other method that i load different html for different screen size. Please help!!
0
votes
1answer
21 views

Adding text to the footer of each post based on tags or categories

Several of my posts in the same category have the same footer. I figured it would be much more maintainable if I could move this into a separate location and manage it from a central place. How can ...
0
votes
2answers
39 views

Only One Post of Custom Post Type Appearing on Template Page

I'm not sure if it's a database or template issue, but on this template page only one post of my Custom Post Types are appearing. There should be at least two. The page uses an isotope.js script, but ...
0
votes
2answers
472 views

How to add a “ waiting” icon for an ajax in WP frontend?

This is my search js code for processing search : jQuery(document).ready(function($){ $('#searchsubmit').click(function(e){ e.preventDefault(); var searchval = $('#s').val(); ...
0
votes
2answers
21 views

Is it better practice to create many page templates, or a a few base templates with custom HTML added via TinyMCE?

I have been teetering back and forth on this question for a while and after a recent battle with TinyMCE, I wanted to get some input. If I am creating very different pages with unique javascript ...
0
votes
2answers
32 views

Creating custom page template

So, on my wordpress site I have page called "Books" and sub-pages, each containing info about some book. It looks something like this: Books Harry Potter, J.K.Rowling Some Other Book, Who WroteIt ...
3
votes
1answer
193 views

Templates for Custom Post Types and Custom Taxonomies

I am working on a custom theme for a network of sites that are deployed under a WordPress MultiSite installation. Within these theme I create 4 custom post types that have two taxonomies added to all ...
0
votes
1answer
23 views

When a user registers, create a page from an existing template with their username as the page name

I am wondering if something like this is possible? If so, where would I start! I'm certainly not looking for someone to explain 100% fully and give free code examples etc, only a nudge in the right ...
-1
votes
1answer
69 views

Custom taxonomy template not working

I have created a custom post type named property, and a taxonomy named city is attached to this post type. There are several cities (terms) like toronto, taiwan,dhaka. I want to create a template ...
0
votes
0answers
100 views

admin-ajax.php not working after wordpress 4 update

n WordPress 3.9.2 access to admin-ajax was working for non loggedin users. When I upgraded the script stop working. I have the following code in functions.php function theme_name_scripts() { ...
4
votes
3answers
2k views

Get page IDs based on which template they are using?

I have a situation where I need to provide a dropdown of pages in a widget, based on whether they are using a specific template. In other words, for all pages using template 'Foo', get the post ID. ...