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
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
15 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
0answers
5 views

How users create a site will automatically assign them a specific contents and template [on hold]

I have created a multisite and I using WPMU DEV's ProSites plug in to handle user levels. I have two levels which is Silver and Gold. I want my users when they create a site will automatically assign ...
0
votes
2answers
27 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
1answer
244 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
4answers
356 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
2answers
390 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
17 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
25 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 ...
-1
votes
0answers
15 views

UnderscoreS_ Startup Frame not showing Page Attributes > Parent Template dropdown [closed]

S_ Startup Frame not showing Page Attributes > Parent Template drop down menu on Regular pages or Custom Post type. I've included the following line to my functions.php add_post_type_support('page', ...
3
votes
1answer
179 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
313 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 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
247 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
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
46 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
46 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. ...
5
votes
4answers
536 views

How to control output of custom post type without modifying theme?

I have a custom post type 'properties' that I'd like to control the HTML output for. For simplicity, let's focus on the archive view. As a basic example, here is what a loop looks like in an ...
0
votes
1answer
18 views

How can I make site-wide content editable, for example footer content

I'm new to wordpress, but I have enough developer experience. (the first thing I did was to get a blank template (blankslate) to start building up this wp site). I want to understand what are the ...
0
votes
2answers
260 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 ...
0
votes
1answer
24 views

Template_redirect for child custom post types

I currently have a custom post type called 'Services' which has two levels (parent and child). I need to load three different templates within this post type (1 for the parent, and two different ones ...
0
votes
1answer
362 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
26 views

How to add posts list to a page template?

I need to create a page which will have static content in the right column and list blog posts in the left column. The static content needs to be editable from Dashboard > Pages > Page. How do I do ...
0
votes
2answers
966 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
1answer
72 views

Custom taxonomy template for categories

I have just been reading up alot about custom taxonomy template files, I have a category within a custom taxonomy that needs its own template. I understand about the template heirarchy etc.. and seen ...
1
vote
0answers
22 views

Using wordpress templating for html emails

Im working on a plugin that needs to send out an email after a form submission. Im using wp_mail for this, and it works perfectly fine. My problem is that in my code the html is generated by a bunch ...
0
votes
2answers
35 views

Display title list of all post of current post type

I have a custom post type called press. I'm on the template single-press.php What I want to achieve is generate a list of the titles (with it's corresponding link to it) of all press custom post ...
0
votes
1answer
51 views

Avada Theme - Display results from a specific category [closed]

In the Avada Theme there is a page template called 'FAQ page', this 'FAQ Page' can have categories (faq_category_1) and in these categories there can be unlimited questions with answers. This part of ...
0
votes
1answer
405 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 ...
1
vote
4answers
3k views

Wordpress not respecting template hierarchy (fetches index.php instead of single.php or page.php)

I've encountered a strange error while developing a custom theme. After finishing editing the template for a custom post type single view, I passed onto working at the template files for pages and I ...
0
votes
0answers
23 views

Send post id through ajax and get the post content back

First of all i want to say that I am a WordPress beginner :). I am trying to get a post content in a modal by using ajax. So i send the id through ajax, but i cannot execute the php code anywhere on ...
2
votes
2answers
246 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
9 views

Custom page template not being called

I've been learning Wordpress for the last few days but I'm having an issue with custom post types. I've registered the post type as below: function create_kitchen_type() { $kitchen_args = array( ...
0
votes
1answer
239 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 = ...
-1
votes
0answers
8 views

video url referencing torchbrowser.com but can't find resopurce

I am trying to get to the root of this url string that is concatonated together in a wordpress template HREF="<?php echo bloginfo('template_directory')?>/videos/Understand.com - Create a ...
1
vote
2answers
4k views

Where is get_header('shop') file in Woocommerce templates

I need to modify the get_header('shop') file in Woocommerce but don't know where it's located, if someone knows please help me out - thanks!
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
1answer
334 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 ...
0
votes
2answers
65 views

Change site template from php

What is the argument to pass to switch theme, when I have the result of wp_get_themes()? $args = array( 'allowed' => true ); $themes = wp_get_themes( ); foreach ($themes as $theme) ...
1
vote
2answers
77 views

Template for specific post of custom post type

I have the CPT "event". I have created single-event.php. I want one particular event to use a different template than single-event. I read elsewhere that this could be done by creating a ...
0
votes
2answers
287 views

Why won't pagination work?

I am using a page template with code to display all blog posts: <?php /* Template Name: Blog */ ?> <?php get_header(); ?> <div id="main"> <?php // ACF Page number variable ...
0
votes
2answers
88 views

Custom Post Type with Nested Taxonomy and Template Files

I have a custom Post Type of "Portfolio" with a rewrite slug of portfolio. So the URL on the frontend is: domain.com/portfolio. I have a custom Taxonomy of "Categories" with a rewrite slug of ...
0
votes
0answers
17 views

get_file_data to read data for Custom Template File?

I have a plugin in which I'm trying to allow users to create their own variants of the styles, and upload them as custom "templates". Essentially these templates are php files with some HTML in them. ...
0
votes
0answers
44 views

What is the right way to replace a post type's template?

Recently I authored a plugin called Ultimate Post Types and now I have a conflict with the "Virtue" theme from WordPress.org My plugin is useful for quickly creating post types through the admin. ...
0
votes
2answers
50 views

Best way to create a page outside of the pages list

Currently, to add a single page that should not be part of the CMS, I add a new Page entry in the WP admin panel and then markup the page in page-{page-slug}.php. This however causes the Pages list to ...
0
votes
1answer
20 views

How can I fix the even/odd child classes comments so that the comments are unaffected by the top-level even/odd?

Sorry if the title was confusing, I'm having a bit of trouble explaining here. I'm working on a theme for my site, and I'm using a slightly modified version of a custom comments template found here. ...
0
votes
3answers
91 views

Use one template only for custom post type archives?

I'm currently using archive.php as a generic listing for categories, tags, authors, etc. However, my custom post types have a very customized archive page that's completely different from archive.php. ...
0
votes
3answers
30 views

How to get all author posts outside of author templates

Currently, I'm trying to display all posts from an author(e.x admin) in a custom page with name that is completely different than these template file listed here. So inside this page, I'm using WP ...