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

Create page when a new site in multisite network is created?

I found this code to automatically create a page when a new site is created in the network. But I cannot figure out how to set which page template to be used when the page is created. I have a custom ...
0
votes
1answer
66 views

How can javascript be added to a custom-page.php template?

How can javascript be added to a custom-page.php template? How can the following javascript gotten from w3schools ajax tutorial be made to work from a custom-page.php template? Any help would be ...
0
votes
2answers
34 views

WordPress blog posts template bug [closed]

I'm facing an issue I've never seen before. I fully copied a WP website to my localhost machine and everything was looking fine. When I was trying to make some changes on the blog page template (that ...
0
votes
0answers
32 views

how do i fixe Page Builder on a custom page?

hi i create a theme from scratch for wordpress (with header and footer) i did my home-page but for the other page i wanted to keep the header and the footer and using Page Builder for the content but ...
0
votes
1answer
35 views

inserting content of 1 Post to in another with a template hierarchy

I have a page template I use for landing pages for various ad campaigns. The template uses custom fields for things like headlines and other shorter pieces of content within the page. However the ...
1
vote
2answers
38 views

Adding sidebar to template creates horizontal gap the size of the side bar

I have been killing myself trying to figure this out on my own. And I for the life of me cannot figure out what is causing my issues. I created a template for the testimonials page and used custom ...
0
votes
1answer
295 views

Use same page-mypage.php template for several pages

How can I use the same page-mypage.php file for different pages, without resorting to page templates?
0
votes
1answer
30 views

How do I customize the post page

I'm currently trying to add an post page on my Wordpress website. I put my new post page as the default post page, on Settings -> Reading. The id of my page is 353. So I created a new php file named ...
1
vote
1answer
151 views

Wordpress showing archive.php instead page

I have a problem with same name (slug) for category and page and wordpress is showing archive.php instead page custom template. Permalinks settings for category is . and i want to stay this way but ...
0
votes
1answer
526 views

get_page_template_slug returns incorrect path

I'm currently experiencing a very strange issue which I can't find any reason to it. I have a theme which is working fine on all servers. Now, I have one client who is having issues with it. The ...
0
votes
1answer
29 views

Template for front page (latest posts)

I am having index.php -> This renders the latest post with sidebar page.php-> This renders the page layout : Templates are fullwidth,sidebarleft& sidebarright single.php-> This renders the ...
0
votes
1answer
24 views

Adding styles/scripts to specific page

I'm trying to add styles and scripts to specific template, But it's not working. In functions.php I tried: if( is_page_template('file.php') ){} if( is_page_template( get_template_directory() . 'file....
0
votes
1answer
10k views

Custom page for WooCommerce's /product-category/

I am building a website from scratch on WordPress using WooCommerce. I'll be having products from numerous brands and to have an easier time organizing them, I've made each brand a category. Currently,...
0
votes
1answer
474 views

Custom URL redirect in WP

I am trying to make my own redirect page for external link. My target My target is that, when a user open the link www.mysite.com/wp/GoTo/?URL=www.google.com, the browser open the page www.google....
0
votes
1answer
527 views

Inject class in body when particular page template is used

<body <?php body_class(); ?> > In header.php I have written the above code. But I want when this page template is in use: page-customer.php then body_customer class should go above. ...
0
votes
0answers
248 views

wp_logout() not working after form submission

I am pretty new to Wordpress, so please forgive me if this sounds like a silly question. I have a Wordpress Page which is using the default page.php template in my theme. I modified the page.php ...
1
vote
1answer
28 views

Change content of page in child theme using plugin

I have a child theme in which I created a page template. I am able to show different content based on time of day by writing some PHP inside the actual page e.g. if ( $time < '10:00'){ echo "The ...
0
votes
1answer
32 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' ); $...
10
votes
1answer
1k 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
2k 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
1k 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
110 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
2answers
1k 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
31 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
79 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
359 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
768 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
14 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
97 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
157 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
34 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
55 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
32 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
56 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
24 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
50 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
34 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
27 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
100 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 ...
1
vote
1answer
1k 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
28 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
44 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
23 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
62 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
236 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
25 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
290 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
1k 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
147 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 ...
1
vote
1answer
157 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 2 3
4
5
23