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

How to save HTML data into SQL post_content column

I have a custom template file containing some HTML tags and get_post_meta function. I want to insert the HTML data into post_content column. Is there a wordpress function or SQL function to save into ...
user avatar
0 votes
1 answer
19 views

Create page (not the post type) dynamically

I'm working on a custom plugin where the user/customer will be purchasing a ticket (it'll be a woo product) to take a quiz and win some prize... So suppose the URL of a product/quiz would be like ...
user avatar
  • 121
0 votes
0 answers
36 views

Why wp_remote_get() fetches certain web pages while it doesn't work for my localhost?

Why I'm not able to parse csv files (or equivalently open them) using WordPress shortcode? Problem: I wish to use a shortcode to Parse Contents of a csv file and display its contents effectively. But ...
user avatar
0 votes
0 answers
25 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), '...
user avatar
  • 299
1 vote
0 answers
20 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. ...
user avatar
0 votes
0 answers
15 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() ){ ...
user avatar
0 votes
0 answers
13 views

show a specific metabox dependent on the page template

For a few days I am trying to show a specific metabox dependent on the page template. I can do it but my problem is when I have selected a page template and hit the update button then the metabox does ...
user avatar
0 votes
0 answers
22 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 ...
user avatar
0 votes
1 answer
29 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 ...
user avatar
0 votes
0 answers
20 views

How to use pre_get_posts on archive page custom post type

I'm trying to use pre_get_posts to modify my post display request. The posts I want to display are custom post types. I am in a custom page template. I have this is my functions.php function ...
user avatar
  • 1
0 votes
2 answers
23 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 ...
user avatar
  • 1
0 votes
0 answers
22 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 ...
user avatar
0 votes
1 answer
23 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 ...
user avatar
0 votes
0 answers
18 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 : ...
user avatar
  • 101
0 votes
0 answers
16 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 ...
user avatar
  • 1
1 vote
0 answers
50 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 (...
user avatar
  • 472
0 votes
1 answer
44 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 ...
user avatar
0 votes
2 answers
33 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 ...
user avatar
  • 3
-1 votes
1 answer
40 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 ...
user avatar
  • 165
0 votes
0 answers
20 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', '...
user avatar
0 votes
0 answers
18 views

Add custom categories and subcategories and posts as custom pages

I have to add car info section to existing website and since I need to add lots of engine types I will do it with script (this is done). I need to represent the structure Brand > Model > Year &...
user avatar
  • 101
0 votes
1 answer
56 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 ...
user avatar
0 votes
0 answers
18 views

Virtual page and loading template

Lately have been trying to create a page with a set of data based on the page name. Creating the template has been easy but I have trouble knowing how to make an URL trigger a page with a template ...
user avatar
  • 1
0 votes
2 answers
33 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 ...
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 ...
user avatar
1 vote
0 answers
14 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 ...
user avatar
0 votes
0 answers
28 views

How to change Elementor Template for Single Page Post on Load

I really need your help with the following issue. I have a custom Post Type Created. For this Post Type I have 2 elementor Single post templates: It appears like this: [elementor-template id="...
user avatar
0 votes
1 answer
65 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 ...
user avatar
0 votes
1 answer
30 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 ...
user avatar
0 votes
0 answers
98 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 ...
user avatar
0 votes
0 answers
29 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 ...
user avatar
0 votes
0 answers
17 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 ...
user avatar
1 vote
0 answers
36 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 ...
user avatar
0 votes
1 answer
41 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 ...
user avatar
1 vote
0 answers
35 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 ...
user avatar
  • 11
0 votes
1 answer
57 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 ...
user avatar
  • 63
0 votes
0 answers
26 views

How do we create Custom Template for any Plugin?

I want to assign template for this plugin https://wordpress.org/plugins/job-postings/ since i have used custom template for all pages (created own) the post title section is not visible in this Job ...
user avatar
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 ...
user avatar
0 votes
0 answers
35 views

Add a plugin to a custom page created in Child theme

I have created a page template in child theme, to call some APIs and show results based on user input. The page template is working fine and it is taking user input, fetching data, storing in database ...
user avatar
  • 3
0 votes
2 answers
64 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('...
user avatar
0 votes
1 answer
83 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
362 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 ...
user avatar
  • 332
0 votes
2 answers
228 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
31 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 ...
user avatar
0 votes
1 answer
36 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() ){ $...
user avatar
0 votes
1 answer
37 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 ...
user avatar
0 votes
1 answer
63 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 ...
user avatar
  • 148
2 votes
1 answer
52 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 ...
user avatar
0 votes
1 answer
357 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 ...
user avatar
0 votes
1 answer
209 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 ...
user avatar

1
2 3 4 5
24