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
4answers
2k 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 ...
-1
votes
0answers
13 views

Centre Portfolio Page

I can't figure out how to centre my portfolio page. My wordpress site is: kelly mulder Can any one help me in simple steps? Thanks :)
23
votes
1answer
35k views

How to create custom URL routes?

I have a very peculiar requirement, hopefully I can explain it without being too confusing. I created a page template where I list some properties I get from an external XML file, so far no problems, ...
-1
votes
0answers
15 views

Wordpress presentation pages on envato

when I look on a theme presentation on Themeforest I see a lot of home/page samplings/contact samplings and blog/portofolio styles... I'm looking to make a theme... but, I feel discouraged when I see ...
2
votes
6answers
1k views

Hide Front-End Admin Bar Including 32 px Spacing

I have a custom template and I inserted the following snippet to get rid of the admin bar for the page: function hide_admin_bar(){ return false; } add_filter( 'show_admin_bar', 'hide_admin_bar' ); ...
0
votes
3answers
437 views

Create Template for Custom Post Type same like for Page

I'm making my first custom theme using custom post types and I've encountered one problem. I'd like to make some templates like you can make for Pages (i.e. page-fullwidth.php page-noslider.php etc.) ...
-2
votes
0answers
21 views

How can I disable author and hide their posts?

I want to disbale authors and after that they gonna be hide such as their posts, media and etc. also on the contrary of above , when i active authors their posts display to every one Any idea?
2
votes
0answers
21 views

Change Theme from Plugin based on query_vars

I'm working from about 4 months on developing a Plugin. This plugin make in a page an entire app, using the powerful of Wordpress. So, I've decided to create a serires of rewrite rules using command ...
1
vote
1answer
420 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 ...
3
votes
2answers
3k 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
22 views

Page template compatibility with different themes

I'm back to WordPress development after a long time away from it, and I'm currently writing a plugin for a client that I might find some use to some others. One part of the plugin includes a page ...
12
votes
5answers
26k views

Can I assign a template to a custom post type?

can I assign a template file to custom post types? I have created a custom post type called items, and I would like to assign templates to the items like you can do with pages.
0
votes
1answer
17 views

Display content on Single page

I am building a single page theme, And I am having a problem with get_post_meta() The Problem This code bellow does not work, and I cannot see anything on the website as it's blank. Here is my index....
0
votes
1answer
5 views

Custom taxonomy query for a custom post type

I have a custom post type called news with a custom taxonomy called news category. Right now I have a template called taxonomy-news_category-press.php where press is one of the news_categories. The ...
1
vote
3answers
5k 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
0answers
25 views

Create a Page (Template) based on a URL with other Post-Slugs

We are building a WordPress site based on a theme (Eduma) and a plugin (Learnpress). Nevertheless this question is just indirectly about that plugin, which is why I ask this question here. The plugin ...
0
votes
3answers
319 views

Is there a way to change the default page template selection?

Click on "Pages" -> Click on "Add New" In the add new page screen. The default page template selected is "Default Template". Is there a way to change the default option to, let's say "My Other ...
0
votes
0answers
3k 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 ...
0
votes
1answer
31 views

single- and archive- templates not being applied to custom post types, not even after flushing permalinks

As stated in the title, I'm unable to get the archive or single pages of my custom post type to use the correct templates for them. Funny thing is, they worked just fine on my virtual server (WAMP), ...
0
votes
1answer
53 views

How to add search to menu?

How to add search to menu? I want to have: add_filter('wp_nav_menu_items','add_search_box_to_menu', 10, 2); function add_search_box_to_menu( $items, $args ) { if( $args->theme_location == '...
-1
votes
0answers
25 views

Woocommerce add to cart button doesn't work with custom templates

I'm using twig for my WP templates and they work just fine. I've installed WooCommerce and all its templates into my theme folder so that I can overwrite them. I'm not planning to use twig with ...
-2
votes
0answers
20 views

Timber, get an arbitrary permalink?

I have an array of post IDs that I'd like to retrieve the permalink for... is there a way to do this in timber? I have tried: {{ blog_post.link|e('url') }} and {{ blog_post.get_path|e('url') }} ...
0
votes
3answers
45 views

Are there any downsides to not using get_header(), get_sidebar and get_footer()?

I am an experienced PHP developer and I am doing my first WordPress project. For reasons I am not going to go into, I don't want to use header.php, get_header(), sidebar.php, get_sidebar(), footer.php ...
2
votes
1answer
2k 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
1answer
750 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 wp_nav_menu(),...
0
votes
2answers
1k views

Custom templates folder

I created a custom folder ("/templates") and I put all of my template files in the folder. instead of root ("/wp-content/themes/my-theme/"). It works fine. Do I have to add some function for ...
0
votes
1answer
474 views

Advantages of wordpress theme vs wordpress as a backend only

I've been wondering what would be the best option: Creating a wordpress theme Using wordpress only as backend and using a MVC framework for the rest I've never worked with wordpress themes before,...
0
votes
1answer
28 views

Shortcode call not working in WP Template

I'm working with a Visual Composer shortcode to call a text resizer into being. When using the Visual Composer or the classic WYSIWYG, if I insert it's shortcode [enlarge_text small='A' ...
0
votes
1answer
41 views

More than one text-domain is being used because of the included templates for plugins

I added bbPress and WooCommerce in my theme and override some templates too. These templates contains textdomains like bbpress and woocommerce. Unfortunately I got the following error in Theme-Check: ...
0
votes
0answers
226 views

How to call function in functions.php in external file inside same theme?

I'm trying to develop a theme by my self. In my theme, I have a function inside functions.php and a php file named ajax.php. I was trying to call a function inside functions.php in ajax.php, but it ...
0
votes
0answers
20 views

Prevent the Loop from running on tags page

I wrote a custom post query for the tags page (tags.php), which queries all posts. I therefore do not need the Loop on that page, because it only queries those posts related to the tag. Is there any ...
0
votes
0answers
8 views

How to include siblings with children in multi-level accordion?

I followed bootstrap accordion tutorial and successfully works but I have four level hierarchical for example parent with children, children with child and on. I cant figure out how to write code that ...
0
votes
1answer
17 views

Conditional string comparison failing for basename/slug

I am trying to display a particular block of html for one page in particular. I have created a conditional statement that compares the basename of the page to my string. <?php if ( has_tag( '...
0
votes
0answers
9 views

Rewrite Rule for Multistep Estimate Form

I want to be able to create a few rewrite rules and utilize some templates that I've created, but I don't want to be limited by having to create the pages within the WordPress admin ... essentially, I ...
0
votes
0answers
47 views

Add two custom post type. News and Staff

I have installed the Bone Theme for Wordpress and I have successfully setup a custom post type for Staff (post) but when I tried to create another one for News, Wordpress crashed. What is the right ...
15
votes
6answers
8k views

single-{$post_type}-{slug}.php for custom post types

My favorite part of the Wordpress template hierarchy is the ability to quickly create template files for pages by slug, without having to edit the page in Wordpress to select a template. We can ...
0
votes
2answers
43 views

Trying to edit the single page from a Custom Post

I have a custom post type where I can create pages in.("article.php") It automatically uses the template "single.php" when I create a page, although I want to change some things in it without ...
-1
votes
1answer
70 views

Make a PHP file with a function

I want to use the breadcrumb function as listed here: https://gist.github.com/melissacabral/4032941 Putting the code in functions.php works for me, but I would rather have it in a separate PHP file. ...
2
votes
0answers
22 views

Wordpress Template not affecting the working, keeps defaulting to the index.php template

I thought this would be incredibly simple, but it has not. I have an index.php file that has my default template for my site. I then made a new file called magazine.php for a template file so that I ...
1
vote
1answer
37 views

What can I use for small text when converting to Wordpress?

FYI before you mark it as duplicate: I found some similar questions, but they are from like 4 years ago and WP is constantly evolving. For repetitive chunks like this I used posts to convert an HTML ...
0
votes
1answer
12 views

Newest comments first not working

I'd like to have my newest comments listed first but nothing seems to be working. In the dashboard I set In comments.php I have <?php wp_list_comments(array( 'reverse_top_level' => true, ...
1
vote
1answer
57 views

Use Timber/Twig to pull an image by image ID [closed]

Is it possible to use Twig to pull an image by ID, or only to pull the post.thumbnail? The Twig docs don't seem to cover any other image need and I'd like to specify a backup image in case no post....
1
vote
2answers
113 views

How to move page template to custom folder?

I created page template that uses the page slug, for example, page-contact.php, page-gallery.php etc How can I move these templates to a subfolder, for example /mytheme/pages/?
8
votes
4answers
354 views

Prevent comments_template() to load comments.php

I'm developing a WordPress theme using a template engine. I want my code to be as much compatible as possible with WP core functionality. Some context first My first problem was to find a way to ...
0
votes
3answers
942 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
3answers
47 views

How to create custom layouts and static pages in themes for clients

How do I build goodlooking, custom pages into my themes. I've decided to use underscores to create custom client themes, as I need complete freedom in design, and all the tutorials I've found on theme ...
3
votes
1answer
57 views

What is best way passing variables to theme templates and using them different places like widgets?

I have a template file at /parts/template.php which contains a post listing code like, echo get_the_title(); //same lines with my_render_function and i am using it at archive.php with this lines. ...
1
vote
1answer
611 views

Cannot edit style.css from admin panel, because the template is looking for style.min.css

I am trying to edit the style.css file for a Wordpress theme, however the changes I make (via admin or ftp) are not reflected on the site because that is using style.min.css. It is very cumbersome ...
0
votes
1answer
28 views

How to add custom 'layout' buttons to wordpress editor?

I'd like to modify the editor by adding some 'layout' buttons. Ideally, I'd like to add the ability to add some html 'partial' by simply clicking a button. This is to help my client to create pre-...
0
votes
0answers
13 views

How to set the template of a page created via plugin with template inside plugin

I've been trying to make a plugin that creates a couple of pages and then sets their template. This issue is that I have the templates inside the plugin. To create the pages I'm using: $post = ...