All Questions

Filter by
Sorted by
Tagged with
1
vote
1answer
35 views

how to use custom page template in a page?

I have a custom page template, and I want to use this in my page. I have created a new page and in template choose custom page template name. It's working, but I have added 4 blocks in my page, and ...
0
votes
0answers
9 views

Woocommerce Templates - How do I change page template layout? How do I edit shop page?

Ok, forgive my frustration. I am going absolutely bonkers with this. Where the hell do I edit the page template (layout) for the shop page? I realize (now, after much frustration) that it default ...
0
votes
0answers
10 views

Ho to get page URL assigned to specific page template (outside that template page)

I have created custom page template (template-clock.php) This template is dynamic and it is getting information by link (?cat=99). Now I want to create dynamic link to that page from home page. But ...
0
votes
0answers
18 views

Search button click sends to single-custom_post_type instead staying at the same page

I created a template to display search results based on user selects. The problem is after I click on the search button it sends to the single-product(This is a Product custom post type). I also have ...
0
votes
1answer
21 views

How do I get the page template name chosen?

I'd like to modify the admin so the default text editor is removed whenever someone is using the default template. (If they manually choose something other than the default, keep the editor). if ($...
0
votes
2answers
25 views

Single-page.php template file name not shown

I am developing a theme and I noticed that get_post_meta($post->ID, '_wp_page_template', true); returns 'static-page.php' (as expected) when queried on static pages but returns nothing (expected '...
1
vote
2answers
94 views

Disable front-page.php template

I use front-page.php on my template to display home page. But I want to disable if the user uses another page for the home page from settings. Is there a solution? When user select a page from ...
0
votes
0answers
18 views

Why does a custom php code inside a custom template not get executed?

So in order to have some php code executed inside a page on wordpress there are 2 ways. One of them is to create a page template and when creating the new page in wordpress set the Page Attribute to ...
0
votes
0answers
85 views

Display a custom 404 page without a redirect

In a plugin I want to display a specific page without redirecting (and thus without changing the URL) like the plugin https://wordpress.org/plugins/404page/ does. I can capture 404s and redirect them, ...
0
votes
2answers
28 views

How can I make custom page templates work on child theme?

I have created a page template called concert.php under page-templates directory with the following content: <?php /* Template Name: Concert*/ add_body_classes('page_concert'); /* Custom ...
0
votes
0answers
38 views

Change Page Template Based on URL Rewrite in WordPress

I have created a custom post type author when it takes to single author details it was working fine. For example http://localhost/author/james/ It was showing single-author.php file. My question is ...
0
votes
1answer
33 views

How can I add text to a specific 'Edit Page'?

I have a specific Page, that I do not wish to be edited. As such, I would like to place a 'Do Not Edit This Page' message within a specific 'Edit Page' file as follows: Any ideas on how this can be ...
0
votes
2answers
29 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
1answer
207 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
28 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
19 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
5k 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,...
1
vote
1answer
240 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
13 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
75 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
1answer
22 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 ...
0
votes
2answers
105 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
431 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
102 views

Custom Template 404 for specific custom post type

Some solution to create a custom template for (page 404) for specific custom post type.
0
votes
1answer
27 views

Selected template is not respected for home page in Wordpress

I have a theme, and I made two new files for different templates. I can now pick these templates when I post a page: This works perfectly when I go to any subpage. I made a page called Test, selected ...
-2
votes
1answer
110 views

Loop on a wordpress Page instead of content coming from the WP text editor

I have created a page template: <?php /* Template Name: homedefault */ ?> But Instead of text coming from here i.e. wp editor: I want it to come from the loop: <?php if ( have_posts() )...
-1
votes
1answer
31 views

using a template for more then 1 page

I have 3 pages under the same custom post type that I made, and I made a custom field of choose between 3 answers when posting a new post to this custom post type and make it so that each page has the ...
2
votes
1answer
21 views

Switching between custom templates in a post type of the admin menu

I created a post type in the admin menu through function codex_custom_init() { $labels = array( 'name' => _x( 'Book', 'post type general name', 'your-plugin-textdomain' ), '...
2
votes
1answer
66 views

How Can I Have A URL Changed Based on the Originating URL?

This is a followup to my question, "How can I have two different urls for the same page that load two different templates?" Assuming I implement Milo's answer (registering a new rewrite endpoint, ...
0
votes
1answer
37 views

WordPress archive index page

I am trying to create a custom archive index page for a custom post type. I can't get it to work, I have followed this guide: https://codex.wordpress.org/Creating_an_Archive_Index. Here's what I have ...
0
votes
1answer
526 views

Nested Page Template not showing in page attributes

I have a custom page template that I am trying to use on my WP site (version 4.9). The folder structure where I am placing my page templates are as follows. theme-root (/wp-content/themes/mytheme/) ...
0
votes
0answers
660 views

Wordpress form submit to custom page template does not work

I have a form on the home page, which when user submits, the action takes him to another page. That another page is using my custom made page template page-quiz.php. So for the form submit action I'm ...
3
votes
1answer
2k views

Loading custom page template via plugin

I am following a rather outdated tutorial on custom post types and the last step is to create a custom page template, where this is intended to show all posts of the custom type in archive listing ...
0
votes
1answer
699 views

the_excerpt producing empty output

I am using WordPress 4.9 and in my content.php file I have the following code <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php do_action( '...
0
votes
1answer
36 views

How can I load Template file from wordpress plugin

I have created a plugin which displays testimonials and when each is clicked it redirects to the single page. So I wrote this code which is directing properly the single view to the one I created but ...
0
votes
2answers
69 views

Load sidebar template just once to prevent multiple animations

I have a home template with a header, footer and a left sidebar. <?php get_header(); ?> <div class="content"> <?php get_sidebar('left'); ?> <div class="middlebar"> ...
0
votes
3answers
2k views

get_header(), get_footer() from plugin template

I have created a plugin that registers a custom post type. I would like to load a custom header and footer for the custom post type from the plugin. After some google research I can see that it's not ...
0
votes
1answer
18 views

Avoid pages losing template association on site re-deploy

To give you a quick background on what I am working with - I manage 3 copies of our company website; our live site that customers visit, a dev site that is live but not indexed so that our website ...
1
vote
2answers
373 views

How to duplicate a page template but make minor changes to the header?

I will apologize in advance, I am very new to this. I have been teaching myself php as a hobby, but now I need it for work! I don't work as a web designer, but to try and save some money, I need to ...
1
vote
2answers
4k views

Change title only in dynamic page

I've been trying to change the title in a dynamic page without any luck. What I did is I created two page-templates from where I load items (occasions) from an external database. In one page-template ...
0
votes
2answers
162 views

how to show all post in my page-grid.php template page

I have custom my template and trying to convert my html into wordpress template, i have created one page page-grid.php .and i want to show all my post with images .but don't know how to do this .and ...
0
votes
1answer
678 views

Exclude pages with certain template from wp_list_pages

Before you mark this as duplicate I have tried every method in all the other questions and non of them have worked. I am trying to exclude any page with the page template page-noindex.php from the ...
0
votes
0answers
88 views

How can I find out what template is my custom post type using?

I have a Custom Post Type called 'Associate' which was created with Reuse Builder Plugin. When I go to the post page it displays the image, title, content and some other standard elements. I need to ...
0
votes
1answer
60 views

Templates & CSS - Proper Programming Practice?

I've worked with WP/html/css casually for a long while but never dug deep before, I have a few questions about good practices. My Background - totally skip this if uninterested I've been left ...
0
votes
1answer
67 views

What is the point of using the front-page.php template? [closed]

You can use front-page.php to create a static front page, it will override all other templates and static front page settings, but the problem is that you can't edit the front page then. You can't ...
0
votes
1answer
338 views

How to get the current category with custom posts

If I go to: domain.example/category/skydancers-en-blikvangers/ I want to get all the posts in the current category for skydancers-en-blikvangers, I know I can hard code the category but this needs to ...
0
votes
0answers
1k views

add_filter('query_vars') not working in custom template

I'm trying to add a query parameter to a custom template in order to look up a record from the DB with the ID passed in. Here's how I'm attempting to do it: At the very top of my custom template, I ...
0
votes
1answer
383 views

Custom post type pages return 404 page?

I have created a custom post type in my functions.php: function keyword_pages_init() { $args = array( 'label' => 'Keywords', 'public' => true, 'show_ui' => true, ...
1
vote
1answer
61 views

Adding Query to Custom Page Template

Probably a simple, stupid question, but: I'm trying to create a page that displays a list of all pages that include a specific ACF value. I copied page.php from my active theme folder, renamed it ...
0
votes
1answer
29 views

Displaying Child Page's Information

I am currently working on a custom template for a page, and I would like to pull various information from the child pages of the parent page, and display that information on the parent page. ...