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
28 views

Making plugin output customizable

I am writing a plugin that will display a timeline of historic events, and I am looking for ways to make the output customizable. I was considering including a template/example within the plugin ...
0
votes
1answer
37 views

A page created with url of blog redirects to the posts page, how do I stop this?

I have a simple site where I want to handle blog posts with a custom page template. So I've created a new page called blog with a document url value of "blog". My custom php template page was ...
0
votes
0answers
24 views

Cookie free site

I have followed directions to make my wordpress cookie free. I've made my subdomain, pointed to my php folder and now I'm stuck. What am I suppose to do with this: bloginfo ('template _directory') ...
0
votes
1answer
45 views

Load different template for CPT (in loop) in my plugin?

I'm writing a plugin that register a new CPT named "sec-feature". In the following loop in my index.php, I want to load a feature-template.php for this CPT posts. But get_template_part just locate for ...
0
votes
3answers
967 views

Wordpress 3.9 not using custom template

I upgraded my Wordpress from 3.8.1 to 3.9.1. I am using the magic-fields-2 plugin for custom data, I have created a custom post type and a custom template for displaying single posts of that type. ...
0
votes
3answers
92 views

How to publish a Page and Posts using single template

Does anyone know how to structure a WP template in the loop by: Publishing the page content on top, immediate followed by certain category posts underneath the page content? Seems like it should be ...
0
votes
0answers
34 views

Adding The Post Template Dropdown to WP-Admin

I'm developing a WP theme from the ground up for the first time. Having build WP sites before, I know there to be an option in Posts that will allow for the selection of a specific template. I have ...
0
votes
2answers
218 views

Use meta boxes inside an archive page template for Woocommerce

I'm creating my own Wordpress theme, and I'm trying to make it compatible with Woocommerce. I understand pretty much everything about theming woocommerce, including copying the template files and ...
0
votes
2answers
53 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
2answers
48 views

What is the most efficient way to create multiple versions of the same template?

I am currently building a WordPress theme that will give users the option to select different layouts for the same template. This will mainly pertain to the home and blog page. I'm thinking like one ...
0
votes
0answers
41 views

Posts page template: How can I edit the markup for this?

I have in settings->reading changed the front page to display a static page. One for home, one for news with a custom template for each. Home works fine, however News will not change no matter what I ...
0
votes
2answers
228 views

the_content of template page

When I use the_content in the page-template doesn't show anything. Loop to call the page-template in the index: index.php <?php /** * Main template file * * This is the most generic template ...
0
votes
1answer
75 views

Get URL of current post but not the page number

Instead of using a plugin, I am manually adding buttons into my template file, like so: <div class="fb-like" data-href="<?php get_permalink() ?>" data-width="100" data-layout="button_count" ...
0
votes
1answer
40 views

Category Templates for Post Types not Working

I came up with this in the codex in order to set my template for a specific category post. I have a category name called "Work". The slug for this category is "work". I created a "category-work.php" ...
0
votes
0answers
123 views

How to show blog post details on a different page?

I have currently made a template to list my blog posts <?php /*template name: Figures */ get_header(); ?> <?php nectar_page_header($post->ID); ?> <div class="container-wrap"> ...
0
votes
0answers
20 views

Auto-Create Pages from Template Directory

Is there a way to have WordPress automatically create static pages from all of the template files in a given directory? So rather than manually creating custom page templates in the WP dashboard, I'd ...
0
votes
0answers
28 views

Use custom posttype archive template for its related taxonomy term page?

I have a custom posttype "Mypost" which has taxonomies tax1, tax2. I want to use the "Mypost" archive template for the tax1 and tax2's term page. How can I do this?
0
votes
1answer
203 views

Apply nextgen-gallery lightbox effect [closed]

I wrote a Template which uses custom-fields via WP-MoreFields plugin. And there I add an image. In my template I display that Image like this: <? echo wp_get_attachment_image( get_post_meta( ...
0
votes
0answers
15 views

Looping through a custom query makes WordPress assume another template [duplicate]

I am calling this code from my custom sidebar, in order to get related postings from the same category: query_posts(array( 'cat' => get_category_id(), 'showposts' => 5, 'post__not_in' ...
0
votes
1answer
419 views

Change wp-signup.php Page Template

I am using anti-splog on a multisite network with the randomly changing signup URL feature. Under the hood, it is pointing to wp-signup.php file. I created an override file the plugin looks for by ...
0
votes
2answers
73 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) ...
0
votes
0answers
27 views

Wordpress templates bug

I have a WP problem that's driving me crazy. I have created several templates, and it decides to switch them all the time... I think it does when I create a new template file, but it never did that ...
0
votes
1answer
80 views

Ajax Call in page theme not working?

Ok, i am VERY new to wordpress (2 Hours new). I am creating a page template, which works fine, but this is the issue i am having: In the template.php file, i have this code: <script ...
0
votes
1answer
20 views

comment files and s

I am building a custom template and would like to incorporate comments and replies using the standard WordPress core. What files and scripts do I need? I copied a comments.php file but the replies ...
0
votes
1answer
49 views

List all native posts in template page?

I've created a page template and I want to do a really simple task: List all (native) posts I have this code inside the template-file: $args = array( 'posts_per_page' => -1, ...
0
votes
0answers
41 views

Problems With Query and/or Template Part and/or PHP

I'm trying to show only the last article. I made content-latestnews.php and it worked before meddling with queries. Template part was shown, but after I tryed to show the actual content it would show ...
0
votes
1answer
53 views

Force WordPress to load a specific template

How would I force WordPress by code to load a template file on my home page? I know how to do it via the backend but I would like to create a plugin and have the option to set the front page from ...
0
votes
1answer
230 views

How to extract the variables out from “add_shortcode” function?

In Wordpress, lets say i have a custom Shortcode function, like: function foobar_func( $atts ){ //whatever required processings here... $foo = "the value is foo!"; $bar = "the value is ...
0
votes
0answers
146 views

Only show top level posts of specific category

I've been trying to create a loop that will only show the top level posts no children/sub category posts. Basically what my categories look like are -- -All --one --- A --- B -- ...
0
votes
0answers
21 views

Specify which template to use by link?

Is there a way to specify which template I want to use when clicking a specific link? Specifically, I have my tag template listing all posts that have a certain tag. My page for the category ...
-1
votes
1answer
28 views

Best practice to create required pages

Some times, when we work on custom wordpress themes, we need required pages. For example - custom login page. Some times, when user change slug, page template or something else - it a very difficult ...
0
votes
0answers
27 views

Theme Option won't show up in my template

I've modified theme option from wp.tuts tutorials, And when I save the settings, it works. But the settings on the second tabs won't show up in my template. here my first theme option and the second ...
0
votes
1answer
61 views

Search page for custom post type

I am new to wordpress and a beginner coder, and i was searching around the net, found solutions but still does not work. I have custom post type named dlm_download, and my custom search template not ...
0
votes
1answer
126 views

Changing permalink name redirects to another template?

I'm creating a template with a few templates with names page-contact.php, page-portfolio.php and page-blog.php. The problem is that when I select a Defaul Template for a page (I expect it to open ...
1
vote
1answer
114 views

How to display a listing template of a certain taxonomy?

I'm trying to figure out how to display a list of specific taxonomy (categorycourses). In functions.php for the theme I have: //Register custom taxonomy for courses-categories $course_cat_args = ...
0
votes
1answer
83 views

Current URL path variable

WordPress has a built-in variable $pagename that will give the current page. I am looking for something that will give the full url including the path before the current page. Details below. I am ...
0
votes
1answer
54 views

server-moving causes funny issues in template

while moved from with a beta install of wp from a subfolder of mydomain to mydomain main folder i get funny things a. the template looks a bit buggy and when i want to login - with i ...
0
votes
0answers
50 views

wp_list_bookmarks(); not displaying anything

Bizzarely, I can't get the wp_list_bookmarks(); function (inside a page template) to render anything. Hope somebody can point out something obvious! Cheers. Here's my code: <?php /* Template ...
0
votes
1answer
46 views

Change the template when the user is not logged in using page_template filter (it does not work)

I want to print other template when the user is not logged in. I use this code: function restrict_access_to_unlogged_users($template) { global $post, $pagename; $new_template = ...
1
vote
2answers
432 views

Directly using pure JWPlayer JS (but NOT WP Plugin)

First of all, I'm not using WP JWPlayer Plugin. (And i don't want it. And thats the another story) Well in the Template file: wp_register_script('myJW', get_bloginfo('template_url') . ...
-1
votes
1answer
63 views

How to read a page's “Shortcodes” from the Template File?

Lets say i have a Page, and it contains some shortcodes like: [myshortcode foo="bar" bar="bing"] [anothershortcode foo="bing" bing="bar"] Then how do i read those from my custom Template File, to ...
0
votes
0answers
39 views

Mysterious template change after database import/export

When I switch databases from my local environment to the host, some of the pages inexplicably change templates. E.g. there is a custom template "Home" and when I switch the db's it ends up with the ...
0
votes
0answers
62 views

How to: Get the first image from the next and previous post in single.php? (5 posts)

I know I can call a function below but it works in loop at index.php only. function catch_that_image() { global $post, $posts; $first_img = ''; ob_start(); ob_end_clean(); $output = ...
0
votes
1answer
89 views

MailPress plugin: table inline style tag removed when sending the newsletter

I have coded my own MailPress theme for my newsletter using tables and inline styling for good look and feel of my newsletter. I have in the files header.php and footer.php html table code with inline ...
0
votes
0answers
27 views

Secondary loop cuts off at 10 posts?

I have a loop to get a tag name from the URL slug, and then show all the posts, grouped by category, that matched that tag. It works, but I recently noticed it only shows 10 posts despite my setting ...
0
votes
2answers
361 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
69 views

Add filter multiple times using only one master function

Is it possible to use add_filter with lets say an array of different values? to achieve something like the following: foreach($templates as $name) { add_filter( 'single_template', function ( ...
-1
votes
1answer
2k views

How to have a custom display for both woocommerce archive and product-category pages? [closed]

So far Hi there, I understand my question is very closely related to a common question about 'woocommerce'. I have been using a variety of woo hooks, filters and creating copies of original woo ...
1
vote
0answers
23 views

Does page.php need the loop? [duplicate]

Simple question. Does page.php need the loop? The Loop 'loops' through several pages/posts/content. However the page.php template only has 1 page. There's nothing to loop through. I noticed that ...
0
votes
2answers
45 views

add jquery file if a certain page is included

I was wondering if anyone could help my by explaining if it is possible to enqueue a javascript file only if for example homepage.php is included. what i have tried to do inside homepage.php: class ...