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

learn more… | top users | synonyms (1)

2
votes
0answers
153 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" ...
1
vote
1answer
50 views

Query with no terms uses index.php template instead of archive.php

I'm using the Query Multiple Taxonomies plugin to get a page of search results (all of which are a custom post type - car). If any search terms are added, so the url looks like this: ...
0
votes
1answer
132 views

Wordpress removing data attributes for scheduled post

Hi I'm using the smarty templating engine in wordpress to generate HTML like the one below: <li> <div class="checkbox_container" data-asin="B0009Y7APU"><input type="checkbox" ...
0
votes
0answers
14 views

Is there some way to put a theme's header.php and footer.php in a subdir [duplicate]

and still call them with get_header() / get_footer()? For example {themedir}/templates/headers/header.php of {themedir}/templates/footers/footer.php With templates this is easy, but I can't get it ...
4
votes
5answers
369 views

How to show a under construction page for a domain but still be able to work on index.php?

I installed a WordPress for a domain name. When I use this domain name will point to index.php in my template. I want show a under construction page for this domain name, but the other hand I still ...
0
votes
3answers
771 views

bloginfo('template_directory') img src

I am lazy loading some images with URLs which are added via custom fields. The lazy load plugin I'm using requires a place-holder image in the src attribute and the actual image in data-original. ...
1
vote
2answers
92 views

Generate Catalog Of Posts Based On Template

Is there a way to print a hierarchy of posts/pages/custom post types based on page template? EG. I am often asked to review another web site and I'd like a way to 'see' all the pages that are ...
0
votes
2answers
34 views

implement separate templates for 1 post type

I have a custom post type 'courses', with a course description as post_content, and number of attachments I also have a custom post type 'course units', linked to the courses with a custom field ...
3
votes
1answer
871 views

Displaying a WooCommerce product via PHP

Having a hard time composing a searchable query, so I apologize in advance if this has been covered. I know you can add WooCommerce products to a page or post via short code, but I have one section ...
3
votes
2answers
1k views

Pass PHP variable to javascript

Is there any possibility to pass some PHP variables in javascript so I can use them later? Only in single.php. I heard about wp_enqueue_scripts but with that it is neccesary to declare a path to a JS ...
-1
votes
1answer
78 views

How can i hide content if not friend in Buddypress?

How can I hide some specific contents or div or other stuff depending on being friend or not in buddypress ?? I tried to use the bp_is_user_friends() function but it did not work !
0
votes
0answers
5 views

Dynamic heading for page and sub-pages, while sub-pages display a description field from their grandparent page [duplicate]

I want to have a heading that dynamically changes when I change the section i.e. the About us section and all sub pages have a heading of About us and a sub heading description of a custom description ...
0
votes
0answers
40 views

Linking Attachment page to another attachment page of larger size

I am not sure is it really possible. I have a gallery. But few years ago, I did not cared to make the image size on attachment page full size. You know what I mean, attachment page shows default size ...
0
votes
2answers
67 views

Remove portion of header code from home page only

I have this code in the template file header.php: <div class="dynamic-header"> <?php if(function_exists('show_media_header')){ show_media_header(); } ?> </div> I want to ...
0
votes
1answer
114 views

PHP code rendered in HTML

I'm trying to find out why any template different than index.php doesn't work. I've created a category-news.php file (also tried with category-4.php and mostly all alternatives), but when opening ...
-1
votes
2answers
405 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
176 views

Load php file with jquery in single.php

I implemented in my worpdress theme ios button switch and when someone click the button the script load a php file with the text: on or off Here is the code: <script type="text/javascript"> ...
0
votes
0answers
226 views

How do I call a custom template for specific Product category and all ancestors in WooCommerce?

I am very new to WooCommerce and Wordpress. I am currently creating a website using both and I'm having trouble assigning a custom template to a specific category and all its ancestor categories. I ...
0
votes
1answer
31 views

Single Post Template with Dropdown Option?

I'd like users of my theme to be able to select a single post template via a dropdown menu on the post screen. I know of a plugin that achieves this but I would like to be able to achieve the same ...
0
votes
0answers
173 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
2answers
591 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
20 views

Why is this page using the homepage template and not the one it should?

One of my clients has installed a theme where when a visitor enters their username and email to register as a new user they get shown a link to download a custom report file. This was working fine ...
0
votes
1answer
108 views

How to use get_template part in the plugin?

I was using the entire template in the plugin, but I would like to use get template part, so that I can reuse the header and footer in the original template. The code is like this: add_filter( ...
0
votes
0answers
193 views

Single Post template and Archive Post template

For the Single post, wordpress would choose the Single.php. which is below <?php /* Template Name: single movie Template */ get_header(); ?> <div id="primary"> <div ...
0
votes
2answers
58 views

Is it possible to activate page template without manually selecting it in wp-admin?

I'm launching a new WordPress theme and was wondering if it's possible to select and activate that specific page's template in code rather than going into the CMS and manually selecting it from the ...
0
votes
1answer
69 views

Using index.php as page template

When you put a name at the top of your index.php like: <?php /* Template Name: Blog Template */ ?> it will work for front-page and it will also create a new page template. I'm wondering if ...
0
votes
2answers
862 views

How to Increment ID value within ACF Repeater Field Loop

The code below is meant to display an Advanced Custom Fields Repeater field. I need to have unique values for the "for" attribute of the Label tag, and for the ID value of the trailing checkbox input ...
2
votes
1answer
689 views

Display HTML only if Custom Field has a Value

I am working with a plugin called Advanced Custom Fields. I am looking for help with code for my custom post type template, which is displaying some repeater field data. I have HTML wrapping each ...
0
votes
2answers
284 views

How to update Wordpress custom SQL Select query for custom taxonomies so that syntax is correct?

I have a Wordpress website that written by third party web developer for version 2.9 before custom taxonomies were fully implemented. We have since upgraded to latest wordpress version 3.5.x. There ...
0
votes
1answer
146 views

Display Posts Query with IF function

I'm writing a template to display my custom posts types in a list. But I only want to have the post show if it has a value for one of my custom fields. I'll explain: My custom post type is "Faculty ...
0
votes
1answer
727 views

How to retrieve an image from a post and display it before excerpt of a post? [duplicate]

I'm customizing a WordPress template and I would implement the following behavior in the excerpt posts visualization in my homepage: If a post contains images (one or more), in the homepage post ...
-6
votes
3answers
355 views

Jquery Slider for profile template

I want to show the posts under a category in my page.The first 5 posts should be shown when the page loads and When the user clicks the next button/link next 5 posts should be shown. Currently I show ...
0
votes
2answers
100 views

Create a Blog Template Page

I am trying to create a template that will display a list posts of a specific custom type. However, I am missing something fundamental. So far, here is what I have: functions.php add_action( ...
0
votes
2answers
184 views

Best practice to update the file header.php

I would like to know, what is the best practice for updating the header.php file: From within WordPress editor: Appearance > Editor or Directly in the header.php file itself (in the www_root)?
0
votes
1answer
183 views

Some problems calling a function into sprintf() inside functions.php template file [closed]

I am new in PHP and WordPress and I am personalizing an existent template and I have the following problem. In the function.php file of the template I have the following function: function ...
0
votes
1answer
74 views

How to add menù section to my WordPress template?

I am pretty new in WordPress blog and I am developing a blog with this template: http://scorejava.com/wordpress351 As you can see at the top of the page there is a "menù" that only show the page in ...
0
votes
1answer
18 views

Odd page behaviour after removing sidebar

One of my web pages is displaying odd behaviour, after selecting a no sidebar template for the page. The sidebar has disappeared, but elements within the sidebar, now show in the bottom right-hand ...
0
votes
1answer
33 views

How to make plugin work in each template in wordpress

I am new to plugin development .I want to get all images of a particular page/post and want to show them as slideshow below the page ..Currently i am able to gather all images in media library and ...
0
votes
1answer
104 views

How to differentiate the homepage structure from the category page structure in WordPress template?

I am very news in WordPress world and I am finding some difficulties with creation of a personal template. I want implement a blog like this one (that is using WordPress): ...
0
votes
1answer
222 views

Using custom post types within a section of a template

I'm trying to get the hang of custom post types and I am trying to get them to loop through the post types within a page template. I'm already using the MultiEdit plugin to display certain content ...
0
votes
1answer
450 views

How to prevent Wordpress from loading the jQuery library at the top of the page

I am developing a site that must be HTTPS secure and Wordpress is loading <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script> at the very top of my page, before <html> ...
0
votes
2answers
69 views

My template won't apply, theme still fallback to index.php

I have a CPT that I want to list the post in the frontend of my website, so i've created a page that I assigned a template so i'll be able to modify the way it look. Here is my template declaration ...
0
votes
1answer
1k views

Change the output for [gallery] shortcode

I'm sorry if this question was answered here, but I couldn't find it. Is possible to change the HTML output of [gallery] shortcode (without plugins)? I would like to show the thumbnails as another ...
0
votes
2answers
64 views

Create Custom Attachment Template That is Processed from Plugin Folder?

I have made a custom image.php for a gallery plugin I'm creating. My dilemma is that I currently have to have my customized image.php in the theme folder for it to work. Is there a way to tell ...
1
vote
1answer
63 views

What should I put on my index.php?

I had covered basically all the pages listed in the Template Hierarchy: 404_template archive_template author_template category_template tag_template taxonomy_template home_template ...
1
vote
1answer
38 views

Show all parts in multipage post

You can do a multipage post by using the <!--nextpage--> inside the post. The question is: How can I display the whole post (not paged) for this post.
4
votes
1answer
109 views

Using a page template without a page

Does anyone know if it's possible to use a page template on a URL, even if a page doesn't exist for that page? When building sites, I create the relevant pages to ensure use of the templates, but ...
1
vote
1answer
314 views

How to remove the Template drop down, but keep Parent and Order

I am about to turn a custom Wordpress site over to a client and do not want them to be able to choose/edit Templates, but need to allow them to sort the pages with Order and choose a Parent page. Is ...
0
votes
1answer
94 views

Wordpress a template for subcategories fo a given category, but not for root category

I've found this simple yet elegant solution for make Wordpress using the same template category on every child and grandchild categories http://stackoverflow.com/a/3117202/391929 Full code: ...
0
votes
1answer
309 views

wp e-commerce single-product template giving 404

this page was working initially, and then I made some changes which *didn’t* appear, and then it just stopped showing that page altogether. I have tried deleting my wpsc-single_product.php and ...