Questions tagged [templates]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
14 views

Ceris Template - How i change this topics?

How i change this topics is Ceris Template? Latest News, Entertainment News, Breaking Daily. Thanks.
0
votes
0answers
12 views

Mobile Menu and Mobile Sidebar missing

My mobile menu and mobile sidebars are not working. When I click on the icon it only adds a # sign to the url and nothing happens. I have deactivated all the plugins and activated them one by one. The ...
4
votes
2answers
114 views

How can I make the wordpress editor apply the selected template?

I wrote a WordPress theme for a non-profit where I use templates to style individual pages. I select the template for an individual page in the editor on the right: For styling of a template page, I ...
0
votes
0answers
15 views

Advanced Custom Fields “Flexible Content” to not echo header if layout is unused

My website allows front-end users to create posts, they can add quotes, highlights and sources for their content. I am using Advanced Custom Fields "Flexible Content" for the user to add as ...
0
votes
0answers
9 views

Do not trigger page 404 on custom template

I have created a template and managing all the pages from my index.php <?php $splitUri = explode('/', $_SERVER['REQUEST_URI']); if($splitUri[count($splitUri) - 1] === "") array_pop($...
0
votes
0answers
19 views

Post template with breadcrumb needs to show page navigated from

I have a custom post type, Reports, that contains many categories (custom taxonomies). These posts are organised in menus on different pages. So a menu page named "Best Reports" would have ...
1
vote
1answer
34 views

2 Templates 1 custom post type according url

Let's say i have a custom post type names "Projects", is it possible to have two template like : Minimal template (with a few info about the projet) Complete template (all the info) And ...
0
votes
0answers
16 views

Unsure what to name my Post type Category Template

I previously was using the woocommerece product_cat on my taxonomy-product-cat.php page, But now Im making a separate post type called Productzs. So the annoying bit about this is the template needs ...
0
votes
0answers
23 views

Wordpress keeps switching back to empty template

I've created a custom page template with a hero and a subnavigation section that fetches some data from custom fields and shows a menu. Here's the code: <?php /** * Template Name: Hero Page ...
0
votes
1answer
22 views

How do I get tags linking to proper pages (/tag/sample-tag -> pages with that tag)

(Warning: WordPress newbie ahead...) I have a WP site with a bunch of posts, many of which have tags associated with them. However, clicks on links to such tags -- https://example.com/tag/sample-tag) ...
0
votes
1answer
45 views

How to hardcode header and footer in WP?

I am playing with optimizing a site built on Divi. I'm thinking that rigidly embedding the footer and header will have a positive effect on page speed - just not quite sure how to go about it. I don't ...
0
votes
0answers
8 views

Add an archive and single template for a CPT within a plugin

Is it possible to have a custom post type's archive and single templates within a plugin, rather than within the theme? i.e. archive-course.php and single-course.php?
1
vote
0answers
14 views

How to create 'Local' filters for WordPress srcset sizes in template parts?

I've read a bunch of tutorials on how to create filters for srcsets and srcset sizes, but they all appear to be applied globally, with a fixed width or set of widths for sizes. The trouble is, I pull ...
0
votes
1answer
21 views

Template part including not working

I have since tried a blank and new php file and accessing it the same way - that worked. So I am now unclear why the existing file does not load at all. There are no errors. Here is the code start of ...
0
votes
0answers
61 views

how to echo a background image in a custom post type

I've setup a loop for custom post type // The Query $the_query = new WP_Query( 'post_type=support_medewerkers&posts_per_page=1' ); // The Loop if ( $the_query->have_posts() ) { while ( $...
0
votes
0answers
26 views

Parent/Child themes - both CSS files loaded

I am trying to use child themes for the first time in Wordpress - and I've got it working (at least from a user's perspective - it functions correctly) My concern is that both the parent and child CSS ...
2
votes
1answer
34 views

Is there a way to loop through a shortcode datasource to create a table?

is there a way to loop through a shortcode data source created in a custom plugin like followed within a 3d party frontend design plugin? function bs_test_fnc(){ $aData = array( ...
0
votes
0answers
25 views

What are the advantages/disadvantages of ways to use php template files?

I saw people using php files template parts that are basically php files with no (or very little) logic, that only insert/echo the dynamic content in the respective places. Maybe using the ternary ...
0
votes
2answers
33 views

Is there a more efficient way to loop through pages?

I have a site that uses a set of 3 images for the header of its subpages. Each page has a different set of images. From what I could find, my best way to accomplish this would be to place an if ...
2
votes
1answer
36 views

How does wordpress blocks?

Couldnt find an answer on this one so thought id ask here. So you have pages which are a post type, On each page you have the post_content which in my case - Is just a bunch of other blocks, Eg in SQL ...
0
votes
0answers
45 views

YITH Wishlist Template Table Layout

Need to adjust the wishlist.php template layout as below displaying only medium image with name & price below (example: https://imgur.com/a/8rYy4SS ) I have tried editing the template but seems ...
1
vote
1answer
25 views

Templating of a specific post ID

I'd like to know it's possible to do something like this single-post-45.php I needn the post(45) only to have a custom template. I know we can achieve this with page, like this page-45.php or by a ...
0
votes
0answers
14 views

Content not showing properly with the first load of the page

As i am building my website with Elementor, i noticed that certain pages (almost all of them) are showing the first time not quite properly. For example, I set a black background for a section and ...
1
vote
0answers
13 views

How can I turn a custom wordpress page into a product page?

I want to create a custom wordpress template product page using PHP. I don't want to override the default product page, but I want to register my custom template page as a product page. I have created ...
0
votes
0answers
32 views

Reposition Product Variation Field

I have created a custom field for variable products. I need to reposition the custom field data.variation.custom_field as shown below: https://imgur.com/a/A8aSHbH How can I reposition my custom field ...
0
votes
0answers
9 views

Change the “Show All” button in a Wordpress Portfolio Filter

I'm working on a website for a client; https://www.lingvox.services/ and I'm trying to solve an issue on this page https://www.lingvox.services/mobila-la-comanda/ The client is Romanian, and wants the ...
1
vote
0answers
27 views

Redirect template based on permalink rather than $wp_query

I'm trying to separate out different templates which utilise WordPress' search (s query var) along with different post types. Situation 1: Default WordPress search page (search.php). Example: example....
1
vote
0answers
13 views

What is the filter or hook to add admin controls to posts on the front end?

What is the filter or hook that would allow me to add a custom control (an action link) for admins next to "Edit" on posts on the front end? I want to give admins the option of carrying out ...
0
votes
1answer
11 views

Page header on specific page is different from the rest [closed]

I've been trying to solve this for ages now. I finally resorted to asking. I am using a theme and I have created a child theme. Everything is working fine, except the that one page uses a completely ...
0
votes
0answers
19 views

Where do I edit what the user sees on my Wordpress site?

I'm currently learning how to create a site using Wordpress purely with code. I can't seem to find the file where it displays the content of my site (text blocks, image blocks, shortcode, etc.) in ...
0
votes
0answers
22 views

Check if current post in loop is last on current page

I am developing a WordPress theme and want to determine if I am at the last post of the current loop page. <?php get_header(); ?> <main id="main"> <!-- ======= Blog ...
0
votes
1answer
10 views

Print different parts of content in template

Is it possible to print different parts of content in template? Without ACF? For example: print the first part of text, then the gallery, then the second part of text etc. This in order to be able to ...
0
votes
0answers
10 views

Is there a way to pull youtube videos form posts and output them on static fornt page?

Is there a way in WordPress to pull youtube or local videos from regular posts and output them on static front page template? Only videos , no text content or images.
0
votes
1answer
16 views

How to check if short code is present in template?

In a plugin I declared a shortcode, but I want to enqueue the scripts only on those pages which have the shortcode. I tried this: global $post; if ( is_a( $post, 'WP_Post' ) && has_shortcode( $...
0
votes
0answers
18 views

Wordpress hierarchy clarification, does post_type_archive take precedence over taxonomy-term archive?

Looking at the hierarchy diagram indeed the post_type archive is above the taxonomy however aren't they parallel and isn't taxonomy-term-archive more specific? the permalink: domain.com/cpt1/...
0
votes
0answers
22 views

Is there a proper way for wordpress rewrite and template include modification?

I'm currently trying to modify the permalinks for WP which is why I'm using the add_rewrite_rule to setup the query_vars however I'm currently having doubts as to how I should properly get the target ...
0
votes
0answers
12 views

Related post not showing table of content

I have squaretype themes and this themes use built in table of content. My question is how to change related post to show excerpt not table of content words?
1
vote
0answers
5 views

Showcase elementor templates

I am being confused about how to structure my WordPress website, I want to make a website where I can show WordPress templates (elementor templates to be specific). I don't want to sell them, I am ...
1
vote
2answers
33 views

Different templates for different category tags

Is there any method to create different template in a theme for different category tags search? For example, I have category 'blog' and category 'glossary' - there is no any similar tag for both ...
1
vote
0answers
12 views

show content of a page built using yootheme builder on different page/template

I have a WordPress page built using Yootheme builder. I want to show the content of that page on woocommerce Category page. namespace YOOtheme; global $post; $post = get_post(2434); setup_postdata( $...
0
votes
0answers
19 views

How can I pass a variable from a template to header.php of a theme

As of version 5.5.0, WordPress introduced second argument (array $args) to get_header. I am calling get_header in my templates including index.php and I want to pass meta description value from ...
0
votes
0answers
12 views

Why does post type-term archive [ <post_type>/<term_name> ] resolve to taxonomy-term archive [ <taxonomy_name>/<term_name> ]?

sorry to ask this but im currently on a 43-tabbed-6-hr search and studying session to make this work but I think i've got some of the things mixed up. Goal: Have separate page for each: [1] domain.com/...
0
votes
0answers
13 views

Specific category post content open in a bootstrap modal

WordPress display posts from specific category on page and click the link must show the content in a bootstrap modal. <ul> <?php while($catquery->have_posts()) : $catquery->the_post();...
0
votes
0answers
13 views

PHP opening tag showing inside html

I am facing an issue with PHP opening tags. The opening tag is displayed at the starting of the file. Here is the screenshot of the source code. Here is the code I use. I registered the template ...
0
votes
0answers
8 views

How i can create link href between two template have the same custom post type

I have custom post type "episodes" i create template for this custom post type "single-episodes" when get template from "inc/episodios.php" like this ... get_header(); // ...
0
votes
0answers
9 views

Create link between two template have the same custom post type

I have custom post type "episodes" i create template for this custom post type "single-episodes" when get template from "inc/episodios.php" like this ... get_header(); // ...
0
votes
0answers
35 views

why won't my custom css load with the enqueue method or any other method?

<?php function load_stylesheets(){ wp_register_style('sj', get_template_directory_uri() . "/sj.css", array(), 1.0, 'all'); wp_enqueue_style('sj'); } add_action('wp_enqueue_scripts', '...
0
votes
1answer
19 views

Will the latest Bootstrap work properly with the default Wordpress jQuery?

Wordpress still uses jQuery 1.x for fear of wrong compatibility with plugins and themes. They are trying to update it, but you can see that it will take a while yet (sources: one, two, three) Now I am ...
0
votes
1answer
60 views

Woocommerce - Change the template?

I found the solution here WooCommerce: Change template for single product page But, it doesn't actually explain how to do it.. or i'm just not understanding enough. I did give it a go and placed that ...
1
vote
0answers
18 views

Wordpress comments not appearing in blog posts, likely because of Redux template. Could I fix this with a plugin that adds a comment form as a block? [closed]

Although I'm comfortable with coding I'm quite new to website building so please forgive me if I'm using clunky or inaccurate terminology. On my Wordpress website I installed the Redux plugin. It has ...

1
2 3 4 5
40