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
-1
votes
1answer
32 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 ...
0
votes
0answers
18 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', '...
0
votes
0answers
16 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 &...
0
votes
1answer
36 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 ...
0
votes
0answers
11 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 ...
0
votes
2answers
20 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 ...
0
votes
1answer
14 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 ...
1
vote
0answers
12 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 ...
0
votes
0answers
24 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="...
0
votes
1answer
41 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 ...
0
votes
1answer
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 ...
0
votes
0answers
36 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 ...
0
votes
0answers
22 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 ...
0
votes
0answers
15 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 ...
0
votes
0answers
31 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 ...
0
votes
1answer
27 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 ...
1
vote
0answers
30 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 ...
0
votes
1answer
36 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 ...
0
votes
0answers
17 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 ...
0
votes
1answer
37 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 ...
0
votes
0answers
33 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 ...
0
votes
2answers
45 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('...
0
votes
1answer
27 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 ...
1
vote
2answers
188 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 ...
0
votes
2answers
123 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.. ...
0
votes
0answers
27 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 ...
0
votes
1answer
24 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() ){ $...
0
votes
1answer
29 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 ...
0
votes
1answer
30 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 ...
2
votes
1answer
50 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 ...
0
votes
1answer
216 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 ...
0
votes
0answers
118 views

get_current_user_id() doesn't work at all in page template (returns 0)

There are plenty of threads with similar heading, but all of them are pointing out that you shouldn't be calling get_current_user_id sooner than init action. Some people pointed out to use global $...
0
votes
1answer
115 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 ...
0
votes
1answer
59 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,...
0
votes
0answers
31 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 ...
0
votes
0answers
19 views

How to access theme template variables from page's code editor?

I created a new php template for my page, and choose it with Page attributes- Template. This php template has an $imageData variable which I want to load into my page with the code editor (instead of ...
0
votes
0answers
24 views

Load Dynamic Template Page by Metabox

Does anyone know how I can implement Wordpress as shown in the image below? I would like to have a unique url passing the company_name metabox as a parameter and from business_type create a function ...
1
vote
0answers
25 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, ...
0
votes
1answer
175 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 ...
0
votes
0answers
26 views

Password protect entire site with custom page

I would like to password protect (without user registration, just a simple password) my entire wordpress site and use a custom page for that, because I would like to use an independent template for ...
0
votes
0answers
17 views

Custom Page Layouts for self-hosted WordPress

I'm currently looking at building a new website in WordPress for a client and haven't used WordPress in a few years (6 years ago at least) and things have changed quite a bit in that time... ...
0
votes
1answer
25 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; ...
0
votes
0answers
27 views

Get HTML of a WordPress page with a template from inside a plugin

I'm using the following code to get a WordPress page html content from inside a plugin: $post = get_page_by_path($slug) echo apply_filters('the_content', $post->post_content); The problem is, this ...
1
vote
1answer
53 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 (...
0
votes
1answer
17 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 ...
0
votes
1answer
22 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". ...
0
votes
1answer
2k views

No templates for condition page.php Elementor

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 ...
0
votes
0answers
7 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 ...
0
votes
2answers
465 views

How To Load an HTML File As A WordPress Page (With No 301/No Redirect)

Here's what I'm trying to do: Page URL: https://example.com/the-page/ What it should load: https://example.com/content/oct2020/index.html When visitors go to the permalink /the-page/, I'd like that ...
0
votes
0answers
66 views

Modify Custom Post Type Slug

I have a CPT called 'projects', which display images with their titles. I have a page to display the CPT's called 'single-projects.php'. Is there a way through using templates and/or functions, to ...

1
2 3 4 5
24