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
1answer
31 views

Template field missing in page attributes

Hi I ma trying to assign a template to a Wordpress them. There is no such option as per attachment??Changing the theme does not help...Thanks for the help
1
vote
0answers
28 views

How can I get a single php file that is the equivalent of an existing WordPress page?

When I use my php file as a template and no other content on the page, it works fine but when I run the file directly (via PhpStorm), there are missing elements (such as comment_status) that cause ...
0
votes
1answer
27 views

Custom post type loops with different page templates

My website has two different page templates. Each page template contains a different custom post type. The posts from the loops can be loaded by AJAX to load more. This is the common code that I run ...
0
votes
0answers
22 views

Hellosign API stops working when template is removed, how do I fix this? [closed]

I have a WordPress site for a client company, and it has one page that uses the Hellosign API via an app (written in JS / JQuery / PHP) to have clients sign a contract for services. The site has a ...
0
votes
0answers
15 views

Wordpress custom php template and rewrite

I have been looking for the answer and tried a lot of stuff, but don't seem to get it to work. I have a custom php file inside my theme directory to use as template. I have created a page with that ...
0
votes
1answer
33 views

Not so common HTML transition to wordpress issue

This is one possibility most of the time: <div class="wrap"> <header></header> <main></main> <footer></footer> </div> But my ...
0
votes
3answers
42 views

Display articles with a different template in the home page | Solved |

I am creating a theme for my site. I would like to display the last 5 articles on the home page but with a different display for the first articles. So I created this code that I try to tweak but ...
0
votes
0answers
19 views

How can I add javascript to a single template within the template

I would like to add some javascript to only one specific template. I really don't want to touch functions.php for this. I don't want a separate .js file either - I woudl prefer it to be all inline. I ...
0
votes
0answers
8 views

Problems with disappearing Item Attributes in the product page of a site with Woocommerce [closed]

Good morning everyone, I'm having some problems with a website. The page of every single product in the WooCommerce store, in backend mode no longer has the Item Attributes item (until 2 months ago it ...
1
vote
1answer
34 views

Missing .twig files in wordpress theme editor

I just started learning timber. Timber uses twig as its templating engine. This is great but I have a problem with displaying all .twig files in the theme editor. I'm using VS code for my code ...
0
votes
0answers
17 views

how to use featured image as full width post banner in single post template

how to use post featured image as full width post banner in single post template. Also i want to hide default post banner in wordpress . I am using generatepress theme , Title , meta Over Full Width ...
0
votes
0answers
16 views

the_posts_pagination() not working if I add wp_head() to header.php

I have WordPress template my problem is with the_posts_pagination? its not showing in archive page I try to delete same functions to see what is the function to see. when is delete wp_head() function ...
0
votes
1answer
20 views

WP redirect to custom login page if a user is not logged in

I want to login a user before he watches content of our site but I am always in a redirect loop, I don't know why. but I searched all the google and stackoverflow but could not find it's solution. ...
0
votes
0answers
16 views

Create a page template without theme styles and scripts, how?

Following this tutorial: "Add Page Templates to WordPress with a Plugin" I made a plugin that generates two templates using Bootstrap and many of its components. Templates work well but, ...
0
votes
1answer
25 views

Utilising an existing page while using the “s” query parameter

I'm trying to load/utilise an existing page template (templates/results.php) while making use of the "s" (search) query parameter. For example: example.com/results?s=lorem Currently, this ...
0
votes
0answers
10 views

template with multiple post loops for multiple widgets [duplicate]

I have two different widgets on one of my pages. They both display posts, but from different categories. One widget has pagination. Now when I switch to another page, the 2nd widget doesn't display ...
0
votes
0answers
19 views

Display metabox galleries on specific page template in admin editor

I'm building a Wordpress website with two metabox galleries displayed only on post type page in admin editor. What I'm trying to do is to display them only for a specific template page in the admin ...
0
votes
1answer
28 views

How does post loop integrate individual page elements

I am just trying to understand how coding in Wordpress works. I have read a bunch of tutorials about post loops and how to modify them with queries, but I have no idea how individual page content I ...
0
votes
0answers
21 views

Spoof the admin panel on the client side? [duplicate]

I'm working on some admin dashboards with a plugin that uses shortcodes that are not available in the admin panel (can't use do_shortcode() - I tried). However these are dashboards that I really want ...
0
votes
0answers
17 views

How to correctly submit a form using ajax from a custom plugin's template

I want to submit a form from a tamplate to my custom plugin but I always get a bad request 400 response. What is the correct way yo do something like this? My form: <form id="entry_form" ...
0
votes
1answer
18 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() ){ $...
3
votes
1answer
106 views

Custom taxonomies, with custom rewrites/slug, AND loading a taxonomy archive template from a plugin

I think maybe my understanding about rewrites and templates for custom taxonomies and CPTs is wrong and maybe someone here could help me solve my problem and educate me. So I have a post type, "...
0
votes
0answers
8 views

Attribute Posts to User via Custom Field Value

I have a custom user role on my website "reviewer" of which one can view an archive page, just like a normal author, where published posts are attributed to that user and displayed in ...
0
votes
0answers
26 views

Change the meta keywords for a specific page

I would like to change the for a specific page only. Is this possible with wordpress? Currently I have set the keyword in a section of the template I am using which applies for the whole page. ...
0
votes
1answer
47 views

Can't print Yoast meta description into page template (syntax error, unexpected '.') [closed]

Here is the relevant portion of my page template code: $yoast_meta = get_post_meta($post->ID, '_yoast_wpseo_metadesc', true); function my_service_template_footer_data() { echo "<script ...
0
votes
1answer
24 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
11 views

Display WordPress archive template page in 3 columns and not 1 column [closed]

I'm trying to achieve the following: Currently WordPress display them in 1 column: Is there code I can Add to the template file, to display all the blog post in this grid layout
0
votes
1answer
74 views

Create page template via functions.php?

I want to create a new selectable page template for users that will allow them to identify which pages on the site are "Service" pages (eg plumbing, gas fitting, etc). The template is an ...
0
votes
1answer
48 views

Make page template that is just an “include” of another?

I would like to create a page template in my child theme called "Services". This template is identical to page.php - except that I just want to add some JSON LD (ie, https://schema.org/...
0
votes
1answer
126 views

Changing the HTML of notices in WooCommerce [closed]

I'm creating a WooCommerce theme from scratch, and I'd really like to change the HTML that wraps the default WooCommerce messages on the Cart and Checkout pages. I am specifically talking about the ...
0
votes
1answer
36 views

How do I change the template specifically for single posts?

My goal is that when someone clicks on a post, the page they are taken to has no sidebar cluttering the view. I want them to focus on the content. I only want the sidebar to appear on the homepage, ...
0
votes
1answer
22 views

Run do_shortcode on php template using JS function

I want to run a shortcode using the [jobs] on my PHP template. I'm using the WP Job Manager plugin. A sample code: <?php global $post; $company_name = esc_attr(urldecode(get_query_var(...
0
votes
1answer
31 views

Home page not loading after editing header.php file

My sites home page has lost all the content after i added a line of code for Google Analytics-Global tag in the header.php file. I took the backup of the file before i did the change and have restored ...
0
votes
0answers
16 views

Can I style a single post of a certain tag - in the archive and on its own page?

I want to post just one-line quotes in my blog, under the tag "quotes." I would like these quotes to show up in my archive as JUST quotes, without the time stamp. Same for when you click ...
0
votes
0answers
37 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
128 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
22 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
24 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
127 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
9 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
15 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
67 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
29 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
39 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( ...

1
2 3 4 5
40