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

previous_posts_link & next_posts_link doesn't generate any output

Hey I am using a WPQuery to loop through and show blog categories in posts. It's in a page tempplate. has 21 posts and I want them to show 10 per page with navigation links for next pages of 10 posts ...
0
votes
1answer
7 views

Creating Archive Page - All Posts with Any Term of Custom Taxonomy

Is there any standard way within WordPress to create an archive page for a given taxonomy (one that will output all posts which have any term from that taxonomy) There's a few ways to accomplish this ...
0
votes
2answers
41 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
58 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 ...
0
votes
0answers
24 views

How to use a page template on the blog

I have home.php handling my main blog page. I am trying to set up an additional page template to be able to change the layout of the blog occasionally. I am able to choose the custom page template ...
0
votes
1answer
20 views

How to Override Page Template if URL matches query?

I have 4 Page Templates that my theme uses for all the pages - Default Template, Template One, Template Two and Template Three. When the relevant Page Template is selected, it loads an Advanced Custom ...
0
votes
1answer
20 views

Probleme shortcode with list author

I have created a list of my contributors for my website it works well. I'm trying to do this with a shortcode in my functions.php. The list appears well. But when I want to place it in my theme in any ...
0
votes
0answers
15 views

Create page via Form on Frontend

I have a requirement , where a user would want to create a WordPress page with 3 basic information as below . The user would add an audio file link. the user would add some text . The user would ...
0
votes
0answers
16 views

Missing 'Page Attributes' in page edit

Im missing Page Attributes from page edit screen. I have searched and not found any solution. Anybody with some ideas?
0
votes
2answers
19 views

Page template option missing

I checked everything suggested in that response: "page attributes" option is checked, template file is located at theme root folder, I tried several file encoding options in my text editor (...
0
votes
1answer
35 views

Create a page template for “top rated posts” but show full content and not just a list

Sorry upfront if I'm not explaining this clearly. I'm using WP-PostRatings and it has this function: <?php if (function_exists('get_most_rated')): ?> <ul> <?php ...
0
votes
1answer
14 views

Add featured image as post header background image

Wordpress Theme : Twenty Twenty [provided by wordpress] Cloud Hosting : Digital Ocean I need to put the featured image as post header background image.Please also explain that in which file of ...
0
votes
0answers
8 views

Showing custom content from specific function in a page

I have a custom php function that returns some text that I would like to show in a specific wordpress page The fastest idea that comes to my mind, is to return that content through a shortcode and put ...
0
votes
1answer
12 views

Undefined get_header function

I installed wordpress according to the site https://ipipe.ru/info/ustanovka-wordpress-na-openserver and then wanted to use underscores.me, where I entered worldelectronics and pressed the generate ...
0
votes
0answers
11 views

Default Template Selected After Changes in Elementor

I'm working with custom templates in WordPress. I'm using the Elementor plugin to build the site. When I open any page and make some changes in Elementor and then click the update button, I see that ...
0
votes
1answer
15 views

page-slug.php not working but only for specific slug

I'm trying to create a page called "Comics" with the slug "comics" to use as the main table of contents for my webcomic site. I've created a page-comics.php file, however when I ...
0
votes
2answers
81 views

Loop inside page template not working

I am facing a problem with the loop inside the page template. Here is the code. <?php /* Template Name: Blog-Template */ get_header(); $args = [ 'post_type' => 'post', 'posts_per_page' => ...
0
votes
0answers
11 views

Generating multiple pages using custom page template

I have created the page templates. Say t1, t2, t3 and likewise up to t10. Now, I want to generate 100 pages respectively using the page template t1 and another 100 using t2 and likewise until t10. Is ...
0
votes
0answers
57 views

add pagination in wordpress page template

I am using custom page to display my taxonomy terms the terms are displaying fine but i dont want the terms to all show in one page i want 2 terms per page but the pagination is not working and its ...
0
votes
0answers
9 views

Check if user is logged in in a callback page

I have a payment page in my website. The user enters his payment amount and the goes to the payment page. When he payed, he returns to a page in my website that I already declared as callback in the ...
0
votes
1answer
24 views

Create page template

I am completely new to working in Wordpress but have some skills in coding. My company has a website where we write about different publicly traded companies. I want to add company specific pages to ...
0
votes
0answers
27 views

Set custom directory in theme for page templates

I have a directory structure in my theme like this: src/ templates/ pages/ - faqs.php views/ - page.php In my custom functions I have a hook that tells WordPress to look in the ...
0
votes
0answers
20 views

How Can I Create a Friendly Slug for a Dynamic Page?

I built a dynamic page template that pulls biography information from a MySQL table. The page works fine but the URL is ugly. Officer-Biography/?ID=1 I have a set of canonical slugs that I want to use ...
1
vote
2answers
40 views

Create Dynamic SEO Friendly URL for Virtual Page

I have a Wordpress site that is built to be a job listing board, and I'm looking to create SEO friendly URLs based on data that is stored in the database. The URL structure should include the state ...
3
votes
1answer
68 views

When and Why is is_singular('my_cpt') true while in_the_loop() is false?

I'm using example code for a templating system. Page at this address: http://project.test/my_cpt/hello-post/. Cannot understand why is_singular( 'my_cpt' ) is true while in_the_loop() is false. Within ...
0
votes
1answer
64 views

Wordpress page template to show posts as per category dynamically

New to PHP. I have a custom page template that I want to use to show a list of posts. The idea is that each post has a category and I can provide a category to a page. For example let's say there are ...
0
votes
0answers
9 views

I want to add two side bar in theme template

Right now I am using bimber theme which is not support two side bar. So I am customizing theme template but at a time only one side bar is displaying. I want to customize template which would two side ...
2
votes
1answer
19 views

Why is this category page limiting the number of posts?

I am developing my first Wordpress theme. I've created a custom page for a specific post category, and I would like to display all the posts from this specific category on the page. The code is ...
0
votes
0answers
35 views

Wordpress add custom search

I create template customsearch.php, adding this for page example.com\search.html (ID page: 18) <?php /* Template Name: CustomSearch */ get_header(); ?> <div ...
0
votes
0answers
15 views

Force wordpress to load empty categories

If I don't have posts in a category, the category.php file won't load. This is a problem, because whoever built this custom template, used post categories to display woocommerce prodcuts (don't ask ...
1
vote
1answer
25 views

Creating a custom archive template that sorts post by date

My site's default archive sorting is set to alphabetical, which I am happy with. However, I want to create a custom page template so I can also have an archive page which sorts all posts by date. I'm ...
0
votes
0answers
29 views

How to create dynamic URLs on WordPress?

I have a site where users can download freeware software. I want to create a dynamic download page. How to prevent the https://example.com/software-name/download/ URL from returning 404. /download/ is ...
0
votes
1answer
35 views

Change archive page template using pre_get_post

I've used pre_get_post to modify and display my custom post type in an archive page with pagination which uses my custom created archive template, see here. It it displaying the posts exactly what I ...
0
votes
1answer
114 views

How to enqueue CSS and JS only on specific template?

I'm busy with my home.php template and I need a few CSS/JS files that are only loaded on that specific template. I tried doing it with if ( is_page_template( 'home.php' ) ) { //ENQUEUE CODE }, but ...
0
votes
0answers
28 views

Adding a page to custom post type hierarchy?

My custom post type has the URL Structure "/work/post-name" The default archive is disabled with "'has_archive' => false" and replaced by a WordPress Page called "/work/&...
0
votes
1answer
16 views

Can i forget about the post loop inside the page template?

A simple page.php template often looks like this: <?php /** * The template for displaying all pages * * This is the template that displays all pages by default. * Please note that this is the ...
0
votes
0answers
21 views

For custom templates, is it better to use `template_include` or `type_template`?

I saw a lot of questions about including custom views in Wordpress (I mean custom templates). There were many answers. Some people recommend using template_include and others recommend using ...
0
votes
0answers
14 views

How can I edit a php custom page template to work in other themes?

How do I edit a php custom page template to work in another wordpress theme? Do I just have to take out the header codes or do I have to edit a whole php page? Header area Thank you for any input. ...
0
votes
1answer
21 views

How do I find out which (page) template file my custom child post is looking for?

I am trying to make something like a web-app with WP. One of the issues I'm facing now is that I cannot find out which page template file my post is looking for. I have looked at template file ...
0
votes
1answer
21 views

Enqueue script if not page template

I'm using the following code in functions.php: if ( !is_page_template( 'page-full-width.php' ) ) { wp_enqueue_script( 'flickity-js', get_template_directory_uri() . '/js/flickity.js', array(), ...
0
votes
0answers
254 views

Edit (advanced) customs fields on page template

OK I'm freaking out a little bit here :) Step back. I have to make some changes to a wordpress website (with a custom template) that I "inherited" from another guy, which developed it in 2015 and ...
1
vote
0answers
30 views

Can't access variable outside for loop

My problem is that I can't access the $cat_slug variable inside the [display-posts] short-code. The idea is to use that variable to dynamically pick post categories via the array returned from ...
1
vote
2answers
44 views

How to enable template page only for a post id page

I wish to limit the possibility to use a specific template page only for post id x I have created a page-blog.php template and I want it usable only for the post id 115 (id of my blog page). ...
0
votes
0answers
42 views

Mutiple url rewrite rules and get every params

I am creating a messaging system where I have 4 sections (1)inbox (2)sent (3)draft (4)unread so I decide to go with Wordpress add rewrite rules I already add one rewrite rule section. ...
0
votes
0answers
17 views

WordPress Page hierarchy ( parent is singular of custom post types slug ) is returning not found

I have a custom post type called CASINOS with slugs is casinos wich has _archive set to false and I have a page called Casino with slug casino ( singular) The problem is when creating a child with a ...
0
votes
1answer
18 views

Conditionally check if page is using template from plugin directory

I am having trouble loading the script conditionally in my plugin. I have a DataTables page and want to load datatables scripts only for that page. So I made a page template called datatables-...
1
vote
1answer
28 views

Custom template with CPT doesn't display on frontend

I created a WP plugin which adds a CPT and allows user to select custom template. It was working when I used an MVC design but when I moved to a new MVC style it doesn't output on frontend and seems ...
0
votes
0answers
12 views

Nest HTML content between template part

Apologies for the lackluster title. I am curious if there's something similar in Wordpress as Nunjucks call or block. Essentially, I am curious if it is possible to create a template part and inject ...
1
vote
2answers
23 views

How do I style Wordpress pages differently based on the tag used?

I was thinking this might be done by adding custom CSS to a page template. I have a page template like this: <?php /* * Template Name: Grafy Full Width */ /*add_filter('...
1
vote
2answers
20 views

How do I find the directory of a page template?

This must be a very amateurish question but... I'm using page templates from the dropdown menu in page editor but I can't find their source code. I know that usually this can be found in themes/"...

1
2 3 4 5
23