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
0 answers
67 views

RSS feed for a custom page template

I would like to know if it is possible to have a custom feed based on a page template and how? This is my custom query: $my_custom_query = new WP_Query( array('cat' => array (4335, 12488), '...
bpy's user avatar
  • 299
1 vote
0 answers
35 views

Pagination stopped working after assigning custom page template to new page (different slug)

I am having a problem with pagination on one of my CPT after assigning the custom page template to a different page with a different slug. It all worked perfectly on the test page I developed it with. ...
Ralf Weber's user avatar
0 votes
0 answers
24 views

Custom Header added within Dashboard pages, is this possible with custom template files?

I created a custom template and called it Header Home"header-home.php" <?php /** * Template Name: Header Home */ ?> <?php if( have_post() ) { while( have_post() ){ ...
daaaaaaaaaaaaaryl's user avatar
0 votes
0 answers
76 views

Show index.php template instead of 404 page template

I have some posts that were permanently deleted, however, instead of wordpress returning the 404.php page template, it is returning the index.php template. In other posts, the behavior is right, but ...
Renan Bessa's user avatar
0 votes
1 answer
56 views

Does wordpress templates always in files or in database?

I have theme and in header.php and I found this templates (see attached screenshot). But there is no content directory in template directory. Even I searched for those files (header-private.php and ...
Avijit Palit's user avatar
0 votes
2 answers
62 views

How to makes changes on the shop/category/tag pages but not on the product pages in woocommerce?

I've recently added a plugin to have product filters (BeRocket) on my wordpress/woocommerce website. To display those filters on the page I made a widget and added it in my woocommerce.php page. It's ...
FLO's user avatar
  • 1
0 votes
0 answers
128 views

Can I automatically assign a page template to a custom post type (i.e page-slug.php file)

I am making my first WordPress theme and I am trying to assign a page template to my custom post type automatically. (i.e page-slug.php) As an example: you can make a page file in WordPress called ...
John Crause's user avatar
0 votes
1 answer
246 views

Pagination on template page for custom query redirecting to index.php

I'm building my first theme and have a template page "page-blog" with a custom wp_query. I've tried adding pagination to the query but so far the pagination redirects to the index page. As ...
jPark197's user avatar
0 votes
0 answers
21 views

How to create custom post page in WordPress?

I want to create a post page template for my website. I am currently using the theme's default post page. I created a template (Template 1) with wp-bakery in pages section with JegTheme addons : ...
edche's user avatar
  • 101
0 votes
0 answers
81 views

How to separate two columns from one content on a page template?

I am just creating my first serious web project built on Wordpress and during my task (basically learning by doing) i came to a following problem. The designer wants to show two columns of text on ...
Guldur's user avatar
  • 1
2 votes
1 answer
231 views

Get name of current page template in Gutenberg era

In a block theme I'd like to be able to make some edits to the head meta based on the (block-based) page template used. The traditional get_page_template() doesn't seem to work as hoped in this case (...
jshwlkr's user avatar
  • 512
0 votes
2 answers
486 views

How to get a page url segment on wordpress?

I've created a regular wordpress page named "user" which is using a custom template. This page is supposed to be called like so: www.site.com/user/<ID> Is it possible to get the ID ...
Ricardo Miguel's user avatar
0 votes
2 answers
186 views

Can I use WP blocks in a template?

I'm not exactly sure how to explain this, but I have a slider I built using ACF that I placed on my home page. After this code, I want to use a WP block I built, and after that I want to put another ...
paulwk's user avatar
  • 3
-1 votes
1 answer
328 views

Wordpress pagination returns the same posts

I did search the other posts here related to this problem, and tried all of them in my case, but I can't seem to make it work (probably because I don't know enough code) Can you please help me with ...
vyperlook's user avatar
  • 167
0 votes
0 answers
26 views

How To Display Posts Of Custom Post Type At Page Template

Suppose Your post type slug is cars : Code For Display Posts At Page Template: <?php /* Template Name: cars */ get_header(); $args = array( 'post_type' => 'cars', '...
MR. shaikh__92's user avatar
0 votes
1 answer
67 views

What's the best way to make a blog page on Wordpress?

I understand we can use WP_QUERY and search for posts with the word blog on it and then loop the results, but that probably isn't suitable for production, because it will lead to bugs, so I am ...
Sayaman's user avatar
  • 135
0 votes
2 answers
425 views

How to identify and hide/remove an element from a WordPress page [closed]

I created my first WordPress website using Elementor and an all-in-one theme called Webify. Since I am new to WordPress and to website design, I've imported a demo website that comes with the Webify ...
polo's user avatar
  • 101
0 votes
1 answer
16 views

Custom Post type dont use custom page template (slug is not right)

I created a custom post type 'gruppen' and a custom page templete 'page-gruppen.php'. I want to use 'page-gruppen.php' to show my custom post type content but the custom post type uses always the ...
Ghiath Sardast's user avatar
1 vote
0 answers
16 views

Wordpress Pagination changes my template

I have a problem using pagination for terms in my custom taxonomy, let's call it Case-Studies. If i go to /insights/page/2, posts will be displayed correctly, and I can navigate between pages. The ...
Calin Diea's user avatar
0 votes
1 answer
551 views

Custom page for editing custom post type on frontend based on url

I have created a custom post type nammed job. The users will have the posibility to create/read/update/delete their posts from frontend. I created a shortcode with a form for post creating, which is ...
Caslaru Ion's user avatar
0 votes
1 answer
36 views

Why is a renamed custom template file still showing up in the template dropdown menu?

I recently renamed a custom template file, changing it from template-programs.php to template-program-schedule.php. In my template dropdown menu, Program Schedule shows up as expected, but Programs is ...
Paul Brady's user avatar
0 votes
0 answers
353 views

Prevent header and footer from loading on specific pages with template or plugin

I am working on a client's site that has a few pages that are embedded into a mobile app through WebView. The goal is to prevent the header and footer from showing up on these certain pages. I can't ...
micahlt's user avatar
  • 101
0 votes
0 answers
61 views

Give custom page template a custom post ID

I created several custom pages in WordPress. One displays real estate listings. When you click on the listing it opens into another custom page I created. The problem is no matter which listing I ...
Joey Lawrence's user avatar
0 votes
0 answers
20 views

A certain theme is forcing it's singular post layout

I am using Elementor pro to edit a certain custom post type (through an elementor theme builder template) to look a certain way. But the singular post type of that custom post, isn't changing to ...
Ilya Gurman's user avatar
1 vote
0 answers
53 views

Create Page Template by hook programatically in Functions.php in WP 5.8.1

Create template as file is great. How to do that by dynamic function? What hook, function I need to add dynamic template to dropdown in page. If I won't have access to server files then I stuck - no ...
Patryk's user avatar
  • 111
0 votes
1 answer
213 views

How to use custom page for all posts with custom url, call another directory?

I have tried many different codes: <a href="<?php echo get_template_part( 'template/test/post' ); ?>"> Test 1</a> <a href="<?php echo ...
Akash Manna's user avatar
1 vote
0 answers
61 views

Getting page output HTML without request (for CriticalCSS, PurgeCSS)

I work a lot with legacy website with css files which were shared across many pages which resulted in really bloated stylesheets shipping to browser. I want to do some performance tricks to avoid this ...
jamkaka's user avatar
  • 11
0 votes
1 answer
82 views

How to integrate single and archive templates for custom post type in any Wordpress theme

I am working on my new WP Plugin for advanced control of custom post types and meta boxes. Actually, I am working on an HTML Builder for the full customization of single and archive templates for the ...
Mauro's user avatar
  • 83
0 votes
1 answer
39 views

How to create additional rendering for custom post types?

Eg I have posts, with url site.com/post_name/ I want to make additional posts template to render different layout of the same data, like site.com/post_name/custom_render/ So in result I would have 2 ...
Vanyatwo's user avatar
0 votes
2 answers
171 views

Show meta box only for default page template

I'm having an issue with one of my meta box. I want the meta box displayed only on the default page template editing page.php. The meta box doesn't show up on the editing page. add_action('...
Mathieu Préaud's user avatar
0 votes
1 answer
317 views

Contain multiple page templates in one PHP custom template file in Wordpress?

As we know that WP has a feature called Page_Templates. But today, I got a question in my mind that can we add/use/access multiple page templates from single .php file (which is responsible to call ...
user avatar
1 vote
2 answers
601 views

Pagination of a WP_Query Loop in a child-page page template

See edit at bottom. I have a wp_query loop in a page template for a custom post type ("success_stories"). The loop itself works fine but I cannot seem to get pagination working. I've tried ...
Josh M's user avatar
  • 332
0 votes
2 answers
704 views

how to remove all body classes in wordpress

i am working on custom page templates. so i want to remove all body classes by one function only. i searched it for on net but not found any solution. is there anyone who can answer it. @Php Edit.. ...
user avatar
0 votes
0 answers
117 views

Add metabox to pages that use custom template in WordPress

I am trying to add custom metaboxes to only those pages that use a certain custom template that is applied to them. How can i do this? I based on this this guide: How to add add_meta_box to specific ...
Matteo Feduzi's user avatar
0 votes
1 answer
121 views

Random home page at each refresh between array of page IDs

I am trying to rotate 3 pages as my home page at refresh. Currently I am using this in my functions.php: <?php function my_homepage_redirect() { if ( is_home() || is_front_page() ){ $...
MultiformeIngegno's user avatar
0 votes
1 answer
109 views

Wordpress template page name displayed on screen

Hi there _ Must admit I'm scratching my head! I've uploaded a demo site that uses a number of template pages. Everything works as expected, but whenever there's a page change the top 3 lines of the ...
inputforcolor's user avatar
0 votes
1 answer
282 views

Trying to add a page template for my custom post type from a plugin, but it will not display in the template dropdown unless file is in theme

I have a custom post type "publications" in my mu-plugin "publications-plugin", and I want to include an optional page template to use with this CPT as well as with regular posts ...
rugbert's user avatar
  • 168
2 votes
1 answer
54 views

What is the wordpress way of displaying local external content?

I have a somewhat tricky situation. A company's internal server, running some unknown software (means I have no access whatsoever), exports data to my http server via a custom API. This data gets ...
chris_blues's user avatar
0 votes
1 answer
694 views

How to display a product features dynamically with icons?

How we can display product features dynamically, different for each product? For example, we have a cosmetic product that has different ingredients. On the front page, I need to display its ...
Muhammad Abdullah's user avatar
0 votes
1 answer
551 views

Short code template + ajax

I am doing a simple page that would work a single page inside Wordpress using Ajax. So to do this, I create a template page with a short-code in it. But the thing is that I really can't do ajax work ...
Marcos Felipe Donadeli Gonalez's user avatar
1 vote
1 answer
204 views

different sidebars depending on template (is_page_template is not working)

I'm trying to follow the instructions in this "How to show different sidebars for posts and pages in WordPress" tutorial to use different sidebars for different types of pages. In particular,...
user204381's user avatar
0 votes
0 answers
36 views

My pages are using my Index.php and not my page.php

So I'm making a custom theme, I setup the theme Created my pages on wordpress then created my Pages VS code i'll use an example of one page for this: I created the talent page with the slug: talent ...
Someguy's user avatar
  • 11
1 vote
0 answers
28 views

Verify if the current page has at least one published child

In my theme php page template, I need to echo a string only if the page has at least one published child page. Actually, I have a function that verifies if the current page has any children, ...
Myriade's user avatar
  • 11
0 votes
1 answer
889 views

Wordpress custom pages in a folder

I cant find something similar I have a portal running WP and I want to create a mikro-site with 4 or more pages, under the same domain and let say I will name this : 'mikro' (I will use a different ...
Nomikos Strigkos's user avatar
0 votes
1 answer
122 views

Duplicated <a> tag in loop

I stuck on this issues, looks simple but can't find resolution to fix it. I have such loop: <div class="features-items__wrapper"> <h2><?php echo $currentTitle; ...
Vladyslav Yermolayev's user avatar
1 vote
1 answer
294 views

is_account_page() change to page slug

i'm really new to wordpress php. which function should i use to replace is_account_page() in a code. here's what I'm trying to achieve before if (is_account_page()){ do some code here } after if (...
Cha's user avatar
  • 13
0 votes
1 answer
33 views

get the value for ALT is we check to see if an actual ALT value is set, if not we use the caption and if no caption is set we use the title

function custom_pic_alt( $attachment_ID ) { // Get ALT $thumb_alt = get_post_meta( $attachment_ID, '_wp_attachment_image_alt', true ); // No ALT supplied get attachment info ...
Mircea's user avatar
  • 31
0 votes
1 answer
27 views

A Reviews Page is Showing root Index.php instead of Template-Page

Issue: The root index.php file is showing up instead of my created template-name.php. What I have done to try and fix: Delete and create a new reviews page with the routename of "reviews". ...
Steve's user avatar
  • 25
0 votes
1 answer
5k views

No templates for condition page.php Elementor [closed]

I am building a WordPress theme and I want it to support the Elementor theme. But I get this error in Elementor Debugging mode. No Template for condition > theme name -page.php What could be the ...
Isakiye Afasha's user avatar
0 votes
0 answers
16 views

Product page not found if product data is set Appointment Service

I installed the booked plugin and integrated with Woocemmerce. When I checked the product type to be appointments service, why was my product page not found on frontend. where is the code i need to ...
Julius Riade's user avatar

1
2
3 4 5
25