Questions tagged [page-template]

Pages are one of WordPress' built-in Post Types. You'll probably want most of your website Pages to look about the same. Sometimes, though, you may need a specific Page, or a group of Pages, to display or behave differently. This is easily accomplished with Page Templates.

Filter by
Sorted by
Tagged with
0
votes
1answer
31 views

Plugin json page

From a simple plugin I have to create a page where to give data in json form. function create_page_json() { $return = array( 'value1' => '1', 'value2' => 'ok' ); $...
8
votes
1answer
507 views

How to move page template files like page-{slug}.php to a sub-directory?

I want to move page template files like page-{slug}.php to a sub-directory within my theme, in a way that WordPress will recognize them automatically. If the page templates of the said form doesn't ...
2
votes
2answers
998 views

Custom Post Type slug same as page name causing a conflict

I have a Custom Post Type all set up. I would like the slug to be the same as a page name, because all of these CPT's will be queried on that particular page (/team-members). If I set the Custom Post ...
0
votes
2answers
478 views

Change text size and color for tags and category meta description on product page

how can I change text size and color for SKU, tags, and category meta description on the product page? It's too big and bright. Takes too much place especially in the mobile version. Thanks!
2
votes
1answer
52 views

Dequeue theme stylesheets but keep widget styling on custom page template

Bit of an unusual one. I have created a plugin that will only display content on a custom page template. For this reason, I have dequeued all the theme styles via $wp_styles and loaded in the plugin ...
0
votes
1answer
763 views

Woocommerce not showing reviews

I am using a custom Woocommerce page template for the single-product.php - however the page isn't displaying any reviews or the box to add reviews. I have checked the settings for Woocommerce to ...
0
votes
0answers
28 views

Set page title in WordPress with PHP

I know this question has been asked thousands of times before, but I have attempted a lots of these solutions without any success. Attempted solutions, among others (added to the template page) ...
1
vote
3answers
25 views

How to create a custom page(not a template) in a theme

I have been searching for theme developing info but all that are related to this subject are talking about a custom page at page.php. What I am trying to achieve is different. The scenario is that I ...
1
vote
1answer
240 views

Use same page template for parent and child pages in a theme

I am working on a template which one uses on both parent and child pages. Suppose I have a: template name: TEST I need to use that template on both parent and child pages: Parent page name -> ...
0
votes
1answer
143 views

How do I create a custom permalink structure for a page template

Inside my plugin, I have a page template that I would like it to follow a specific structure. I would like the template to always use the /%postname%/ permalink structure regardless of what the ...
0
votes
1answer
13 views

Question on templates

I'm using a free theme called Ocean WP that has a folder called 'templates' I thought I could just save over one of the templates and rename it and construct a template (which I need for custom post ...
2
votes
1answer
75 views

How to apply a custom template for posts by default?

I have created a custom template. Now how do I apply my template instead of single.php for posts by default? I want to do this so that theme upgrade doesn't replace by custom template.
1
vote
0answers
114 views

How to render a custom post type template with custom fields using shortcode

I have a post type called "Milestones" which has several custom fields and custom a template to render it. What I am looking for is a way to return all the rendered output from a shortcode. The ...
0
votes
1answer
31 views

How to allow user to select page template from front end?

I have post templates ready... I want the user to be able to select the post template from the front end form? Is there any method or some one could guide me how to achieve this?
1
vote
1answer
30 views

Highest number of WordPress Custom Page Templates?

I'm little bit rookie in understanding WordPress core. But I would like to know that, is there any limit or should we limit to how many custom "page" templates we make in our custom theme? My ...
0
votes
1answer
24 views

How to create custom search page

So I'm trying to make my search.php file loop through three custom post types when doing a search. I currently have three cpts , post, anime, peliculas and I'm currently using a function that will ...
0
votes
0answers
51 views

Pagination is not working in custom page template

I have a pagination code that works fine in a custom post type pages single-category.php /* Template Name: categorie page Template Post Type: post */ but is not working in custom pages template '...
0
votes
0answers
18 views

Load custom post template

I'm pretty new to Wordpress Theme-development, so this might be a beginners-question. I looked everywhere for an answer, but none seems to suit my situation. I have created a custom shop page which ...
1
vote
0answers
32 views

Prepopulating a specific page template with HTML/CSS

So, I'm trying to prepopulate a specific page with HTML/CSS every time the page template is used. I've found this thread that was very helpful with how to do it, and this one was very helpful on ...
1
vote
1answer
33 views

Custom Page that comes with preloaded content for the user

Sorry if the question isn't all clear, but I have been struggling with the keyword for this, probably there's a keyword for it that I don't know of. The Wordpress site I'm developing at this moment is ...
1
vote
1answer
22 views

displaying category and subject posts

I have single post pages, that displays the page subheading based on the category name or subject name. I am having issues display category titles as well as subject name. Essential what I am trying ...
2
votes
1answer
88 views

Is it possible to upload a template file to a directory that can be used by all themes?

I have a custom php file that I want to use as a template (i.e. selecting it from the "Template" dropdown in the image below). Right now, I have to identify which theme I am using and place the ...
0
votes
1answer
105 views

How do I hide the current page's title?

I have this code: add_filter( 'the_title', function() { return ""; }); Or, respecting the hook's arguments: function remove_title( $title, $id ) { $title = ''; return $title; } ...
0
votes
1answer
27 views

My WordPress installation doesn't load correct template

For whatever reason there are some odd things going on with my theme, I feel like it's such a fickle install and some times I wonder how it runs. Anyway, I'm having a few different post types, ...
0
votes
1answer
18 views

Is it possible to determine whether a page is a page template by page_id in ajax call?

I'm looking for an answer for the asked question. The reason is I'd like to omit the need to use is_page_template() in WP ajax calls. Best regards, Dan.
0
votes
1answer
22 views

Use wordpress for /blog section only and all other pages static, but using same footer.php and header.php

I'm trying to achieve something that I think should be fairly easy, but somehow I'm stuck. I have created the css and html for a number of static pages and a blog section and now I want to turn it ...
0
votes
2answers
49 views

Modify available templates (in dropdown)

I'm developing a WordPress theme with several templates. One template is called "Tabs". If a page with this template assigned has children pages, parts of their contents are shown in tabs on the ...
0
votes
2answers
105 views

Create Page that uses specific template

I need to programmatically create a page that uses a specific/custom template as defined programmatically. Both the page and template are created/used by my plugin. The plugin files include a page ...
0
votes
1answer
23 views

How to detect if some page template has been selected

I'm wondering if, in the static front page, is possible to detect if the some page template has been selected for my page. I'm building a template and I'd like to have a static front page, but I'd ...
0
votes
2answers
109 views

page-slug goes to not found

I have uploaded a file called page-testtest.php to my template folder. Aren't I supposed to get to this file when I go to example.com/testtest It seems very strange to me because the documentation ...
0
votes
1answer
431 views

Custom post type option page template

I'm making a website which has a page that contains all members. So till now I've made a custom post type using the following code: function midas_team_post() { register_post_type( 'midas-team', ...
0
votes
1answer
65 views

post permalinks with dot in url don't resolve to correct page template

I have custom post type posts with the . character in the post_name field (thus the permalink) and it does not resolve to the correct page template. In this case instead of going to single-cptslug.php ...
0
votes
1answer
102 views

Custom Template 404 for specific custom post type

Some solution to create a custom template for (page 404) for specific custom post type.
1
vote
1answer
51 views

custom meta box for page default template

I'm having issues getting some custom meta boxes to display on the page default template. I want these meta boxes to only display on the default template and disappear when the user chooses a ...
0
votes
1answer
27 views

Selected template is not respected for home page in Wordpress

I have a theme, and I made two new files for different templates. I can now pick these templates when I post a page: This works perfectly when I go to any subpage. I made a page called Test, selected ...
0
votes
2answers
3k views

How to change “product has been added to cart” text in woocommerce

I would like to change the "Product has been added to your cart." text for variable products to include the variation. For example if I added a size 7 Shoe to my cart it should say: "Shoe in Size 7 ...
0
votes
1answer
344 views

remove_action() not working in page template - Genesis

I've had a good look around but can't find anyone with the same specific problem. In functions.php I'm adding the following actions: add_action( 'genesis_entry_header', 'twl_content_wrap_start', 15 )...
1
vote
1answer
68 views

Dynamically override page.php or single.php with custom templates using function

I want to add new custom templates in my plugin (custom-page.php, custom-single.php). When activated, I want to dynamically use my plugin's custom templates to override the templates (page.php, single....
0
votes
1answer
23 views

Hide text if one custom field out of two is empty [closed]

I am calling my custom fields into my page template like this: the team donated <!-- display funds raised --> <?php $givingback_details_funds = get_post_meta($post->ID,'...
1
vote
1answer
430 views

Using pre_get_posts to target a query in the sidebar

I know that pre_get_posts can be used to target a query on the main site, custom post types and pages. But is there a way to target a query in a sidebar? Right now, I'm using 'is_page_template()` but ...
0
votes
1answer
60 views

Dropdown menu for categories

When I use this code below <?php wp_nav_menu( array('menu' => 'categories' )); ?> I can make a new menu to list up for example alle categories in wordpress I created. I use it to list up ...
1
vote
1answer
3k views

Get page id of current page from template

I am trying to get page id from my template-contact.php like this : global $post; echo $post->ID; It's showing 85 but page id is 96, I want to get id because I want to fetch meta of current page. ...
0
votes
1answer
147 views

Custom page with queries returns 404

My question is very simple. I created a new custom page template called page-printable.php. Then, I created a page with slug printable. If I access the page with localhost/printable or localhost/index....
-2
votes
1answer
110 views

Loop on a wordpress Page instead of content coming from the WP text editor

I have created a page template: <?php /* Template Name: homedefault */ ?> But Instead of text coming from here i.e. wp editor: I want it to come from the loop: <?php if ( have_posts() )...
0
votes
2answers
58 views

How to output functions from plugin inside theme

I am using a plugin Chargebee WP Membership to connect up to their API to process payments. At the moment they are only using shortcodes to restrict content. What I am trying to do, is output the ...
-1
votes
1answer
31 views

using a template for more then 1 page

I have 3 pages under the same custom post type that I made, and I made a custom field of choose between 3 answers when posting a new post to this custom post type and make it so that each page has the ...
2
votes
1answer
21 views

Switching between custom templates in a post type of the admin menu

I created a post type in the admin menu through function codex_custom_init() { $labels = array( 'name' => _x( 'Book', 'post type general name', 'your-plugin-textdomain' ), '...
1
vote
2answers
35 views

Can I show all the template files that are being used on my site?

I have a legacy theme that has a lot of page template files. My site is too big to go through each page one by one to check it's template. Is there any way (either through adding a column to the ...
0
votes
1answer
53 views

Strip <a href=“” rel=“tag”></a> from the_tags() output

I want to show plain text tag names above each post on a page that displays posts for a given category. Each post only has one tag. I've set up an array to grab posts from the category I want and ...
0
votes
1answer
3k views

How to rewrite title- and meta-description templates for page templates in Yoast Plugin [closed]

I am working on an project with many different page templates instead of custom post types. For SEO purposes I need to rewrite the title- and meta-description, which normally works on the page itself. ...