Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [templates]

Within the context of WordPress Theme-ing, the term 'template' refers to PHP files used to display content.

0
votes
1answer
13 views

Using Includes in Templates in Document Head

In a template, I have a need to include_once an external PHP (an include.php) that contains functions that I need to use inside the template. Included in those functions are CSS styles and an ...
0
votes
1answer
11 views

Set og:image programmatically in custom single post with external images

I have created a plugin with a custom post type and the single post template pulls in photos from an external site. I would like to programmatically set the source for one of these images as the og:...
0
votes
0answers
6 views

Setting the WooCommerce catalogue pages to be different from the theme default layout? [on hold]

I'm pulling my hair out trying to find the setting to make the catalogue/category pages different from my Genesis theme's default layout! My default layout is full-width but I need my WooCommerce ...
0
votes
0answers
14 views

BuddyPress Nouveau Template - problem with counter

I have problem with Buddypress Nouveau Template. When I go to Site-Wide Activity page there's a "All members", "My groups" and "Mentions" links. That links should show count of the all members, groups ...
0
votes
0answers
21 views

create-guten-block in wordpress theme?

I'm working on a wordpress theme and want to replace my shortcodes with gutenberg blocks. I'm new to working with blocks but having looked into it a bit I've decided to try and use create-guten-block ...
1
vote
0answers
19 views

Is there a way to create a block template that is not limited to a post type?

So, I have been reading up on block templates and from what I understand, they limit the ability to create them to one per post type. I just need to be able to add groupings of blocks without having ...
0
votes
0answers
12 views

Calling custom fields value for pages to another page

I'm trying to include a product template in my header.php file and i want to get a custom field value on header from product page. I have added properly when i need to get custom field values from ...
0
votes
1answer
15 views

How to include any template using Shortcode fuction?

function custom_code(){ return include( get_stylesheet_directory() . '/custom-template.php'); } add_shortcode('custom_shortcode','custom_code'); As you can check above I want to include a ...
0
votes
1answer
6 views

Display all page which have not a certain template

I'm trying to display all pages of my website which have not the following template: template-rubrique.php. It works great but it doesn't output the blog page as well, since it doesn't have a template ...
0
votes
1answer
14 views

How do I find a way to create a global single.php for a custom post type?

I am working on making a custom post type plugin for my website. However, I want to make it universal for any theme I may decide to change. Or to be able to append the post type to a single post file ...
0
votes
0answers
10 views

Template for Custom Post type with Custom Taxonomy for a particular Term

I am creating a custom post type with its own custom taxonomy. I then want to create two different templates. Post with a particular Term in the custom post type show one template and the remaining ...
0
votes
1answer
37 views

How to replace WordPress sidebars (widget areas) with Gutenberg

I'm trying to build my first Gutenberg theme, and I want to build a page template with the layout as shown below: Pre-Gutenberg I would have built widget areas into the page template to create the ...
0
votes
0answers
34 views

How to add variables to a template

I am using a query argument detail to check if a custom template should be loaded. This works fine, but I also need to add some variables that can be accessed from within the template. Here I am using ...
0
votes
0answers
22 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 ...
1
vote
1answer
13 views

Having trouble with Template hierarchy. I Need to create a set of pages that drill down from states to specific locations

I am creating an interactive set of pages that needs to be very easy to navigate, as the audience skews older. Walking through the flow The user will start at a page, that lists all of the (US) states....
0
votes
1answer
26 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 ...
-1
votes
0answers
15 views

DIVI - Child theme modify footer siderbar

I would like to modify semantic H4 (default DIVI) by span with custom class CSS. In my child theme function et_widgets_init_overwrite() { register_sidebar( array( 'name' => esc_html__( '...
0
votes
0answers
46 views

Change WooCommerce template for PDF - access to custom field

I want to do some modifications to a template of WooCommerce, but I'm rather ZERO in PHP, so that is why I'm asking some guidance so I could perform my small modifications, which I'm sure are not too ...
0
votes
1answer
6 views

Disable theme WooCommerce template [closed]

Just purchased a premium WooCommerce-read theme. Unfortunately, this theme comes with a /woocommerce folder. How can I disable this templates,without deleting whole folder?
1
vote
2answers
42 views

How do I create a custom partial / template?

I have created an sign up form and placed it in my header: <div> <h5 class="myapp-sign-up-text">Sign up for updates</h5> <form class="myapp-email-form"> <...
0
votes
0answers
7 views

How can I display all posts from child categories in the parent category?

I am trying to modify an existing website so that a parent category page displays the posts associated with both the parent and child categories. Currently, if there are any child categories, the ...
0
votes
1answer
38 views

How can I modify the default reset (lost) password email text?

I found some similar questions on here, but was unable to apply the solutions that were provided. The standard password reset email that Wordpress is sending does not provide a clickable url for ...
0
votes
0answers
25 views

Second Loop Showing Only One Post on Single Post Page

The single.php page I am working on was able to display two loops successfully, the first being the actual page's post, and the second loop displaying the last 5 posts. However, since I have styled ...
1
vote
1answer
42 views

Gutenberg & Pre-formatted Templates: Core Block Attributes

The Gutenberg Handbook currently has a short entry for creating whole templates of blocks, e.g. used for Custom Post Types or just pre-formatting posts. https://wordpress.org/gutenberg/handbook/...
-1
votes
1answer
58 views

custom post type single page template not working

I created a page portfolio and select template Portfolio Template My portfolio page does not access the template-portfolio.php file. In which also includes content-portfolio.php in template parts ...
1
vote
1answer
21 views

Only one post is showing on category page, why?

My website categories are only showing one recent post, not all. category.php code looks like this: <?php get_header(); /** * The template for displaying Category pages */ quality_breadcrumbs()...
0
votes
0answers
30 views

Turning archive templates to a page template maintaining the slug

I used to have an archive-rooms.php (as page-rooms.php) template to list them all This had few problems: No title page No way to synch menu item with title so: 1) I duplicated the archive-...
0
votes
0answers
16 views

WP create a template for pages that aren't inside of the DB

I have a question. Is it possible in Wordpress to create pages, that aren't actually inside of the wp_post table? What I would need is, anytime there is a page with a certain slug, such as www....
0
votes
2answers
27 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
56 views

How to add php to theme to show alt attributes

I am trying to figure out how to add PHP / code to my template so that my alt tags show up for my images. The theme has been modified by a company that is no longer around so I can't ask how to ...
0
votes
0answers
10 views

how to use a sidebar widget with its options in a template

I know that the title of this question is a litle confusing, but this the problem I have recently installed a widget called Youtube Channel Gallery, which displays the latest videos on my website. ...
0
votes
1answer
15 views

WooCommerce template page for category

How do I change the WordPress template used for the WooCommerce category pages? I can change the product pages by using the single-product.php template, but the category pages just use page.php which ...
0
votes
1answer
25 views

Template Loop - add switch case php

My plugin template is currently as follows: if ( $query->have_posts() ) { ?> <ul id="list-con"> <?php while ($query->have_posts()) { $query->the_post();...
0
votes
1answer
21 views

Displaying all posts of a category in full view on one page using their single.php template

I would like to display all posts of a certain category in full view on one page, but would like to render them in the same look and feel as they were rendered using the single.php template. How ist ...
-1
votes
0answers
56 views

Woocommerce checkout functions.php : billing_address_1 won't align form-row-first

I'm trying to re-order and layout the Woocommerce checkout page. I can get most of what I want working without issue however for some reason when setting billing_address_1 to form-row-first (default ...
0
votes
0answers
28 views

Custom page template returns to default page template after saving

I have a custom page template set up in Wordpress. When I select it and save a page, it returns to the default template. After reading another question on the subject, here's what I've tried: *...
0
votes
1answer
32 views

WordPress custom template not showing in the list of available templates

For some reason, my custom template WILL not show up in the backend of WordPress. I have tried the suggestions in this thread: Custom templates not showing up in template dropdown to no avail. It ...
0
votes
0answers
25 views

Wordpress Templates missing

Woke up this morning to a broken website because my wordpress templates that come in my theme are not showing in the "Page Attributes" section on the page editor. Any clue to why they disappeared? I ...
0
votes
1answer
26 views

Templating advice sub posts of a CTP

Im looking for advice to generate a few 'default' post templates. Currently this is the setup for the CPT 'projects'. We generate subpages and select the main post type as parent. This works well to ...
0
votes
0answers
16 views

What is the best approach to create Pages with same Page Template but different post types?

The goal is to have something like this below in Wordpress: Three pages : Cars Movies Fruits Three Post Types cars_posts movies_posts fruits_posts Each Post Types have multiple posts ...
0
votes
1answer
13 views

wordpress custom posts page not showing

In Wordpress I created 2 templates : The first template is a custom homepage The second template is custom page for for post results(search by category, search by keywords) After that I specified ...
0
votes
0answers
16 views

why does not showing my custom post category list in any template?

i want the category list to be show in any template but does not showing code is here what i am using . can please guide me. no any result i am getting. if you have any idea please guide. |custom ...
0
votes
0answers
20 views

How to add/edit/delete and categories wp-page template files using wp-admin?

Anybody please suggest a good word press plugin for add,edit,delete and categorising the word press page templates according to the pages any plugin is available? I need a suggestion form you peoples ...
0
votes
1answer
39 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
0answers
19 views

how do i add a subscription form to all my blog posts using the landing.php Template in oceamWp?

I am using a sendinblue plugin for my subscription forms. I have a short_code and I want it on top of all my Blog posts. I tried to add it to the landing.php page like bellow <div id="content" ...
0
votes
1answer
40 views

Update body class based on theme as well as a html attribute

I just started using wordpress. Now I'm trying to create a theme for a static web page I wrote. For that web page I'm using barbajs, which is why I have a html tag (in my case a section tag) with a ...
0
votes
1answer
310 views

How to override the “inc” folder (or any folder) in a theme using child theme?

I am using Storefront theme (But question isn't specify to this theme, I am asking question for any theme). I can easily override files like header.php, footer.php using child theme(just copy and ...
0
votes
1answer
23 views

How do I put my frontpage featured image in a page template for home.php?

Important: I want to makes sure this is clear: I am not asking how to get the post thumbnail. I am asking how to get the featured image for single page which is created through the Gutenberg editor ...
0
votes
0answers
16 views

WooCommerce cart handling problem

I use Aventura wordpress template and predefined tour_cart parameter to handle cart. I directed to URL like this, when try to put some items to cart: tour-cart/?tour_id=2100&people_available=&...
0
votes
0answers
64 views

How to access ACF fields in Elementor templates?

I am creating a custom archive page for a custom post type, but I need to get some Advanced Custom Fields (ACF) values into it. Is there a way to do that when building a template? For some reason, my ...