A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

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
15 views

ACF - Custom image for Product Tags not displaying

I'm fairly new to PHP so sorry if its something elementary. I'm trying to modify my shop template, so that I can list certain icons for each tag. I installed ACF pro and created a custom_image for ...
0
votes
0answers
25 views

Why does my “Add New Post” page have an old post in it?

I created a brand new WordPress site. I imported the export *.xml from my old site. Now, when I go to "Add New Post", there is an old post in there, and I can't seem to do anything without getting ...
0
votes
0answers
12 views

What are the disadvantages of using template_redirect for restrictions

We can use template_redirect action to check if the user has authorized to view a specific post or page and redirect to different page. What's the disadvantages or issues of using template_redirect ...
-1
votes
1answer
37 views

WooCommerce IF statements not working

I am trying to use the WooCommerce Conditional Tags to only include a template into specific product pages. https://docs.woocommerce.com/document/conditional-tags/ However my statements aren't ...
0
votes
1answer
28 views

How to redirect my custom template page to content-none.php if no posts found?

I am trying to redirect from my custom template file to template-parts/content-none.php if my template has no posts in it. I want to add an if condition after while loop checks for posts. Here is my ...
0
votes
0answers
15 views

error: n.imagesLoaded is not a function

I have converted a template to wordpress format. and added styles and scripts in functions.php. but i keep getting error snow.min.js:11 Uncaught TypeError: n.imagesLoaded is not a function at ...
0
votes
0answers
25 views

Split post template in two pages

I need to split my single post template in two pages using pagination . It's very simple in post editor by <!--nextpage--> But i want to do it in single.php file So the page content in first ...
0
votes
0answers
21 views

Page Template Selector Error

Complement of the season. Please, am currently having issues with my project (berrywell.de). The English homepage automatically selects German homepage template after assigning it to the English ...
-1
votes
0answers
17 views

Problem in adding news ticker to my site [closed]

I am having a theme "Cream Magazine" and I want to add News ticker to this theme. It shows it is included in that site. But, when I activate that, no news ticker is visible in site. Need solution to ...
0
votes
1answer
14 views

Render ninja form inside markup

I want to render a ninja form via markup (in a php file): <div> <h1>hello</h1> <ninja-form> <---- ? </div> What do i put in there to render a ...
0
votes
1answer
22 views

Polylang and template files

I divided the website i am making in diferent template files for example: Category for blog -> category-blog.php Category for projects -> category-projects.php But now I am using the POLYLANG ...
0
votes
1answer
21 views

Commented code in Wordpress template?

I have a wordpress site that has to integrate with a .NET platform for a client. I simply need to add two commented out pieces of HTML for it to work on the .NET platform end (not our system). ...
0
votes
0answers
20 views

Use PHP templates as blocks

I need many "Reusable Blocks", but creating and maintaining them takes too long. I'd like to do this: create a PHP-based "template" file, e.g. wp-content/foo/bar.php create a page in the block ...
1
vote
1answer
30 views

Missing 'Page Attributes'

I'm building my own theme and so far so good. I created a template and named it correctly but it doesn't appear in any drop-down or indeed there's even no page attribute option at all. Do I need ...
1
vote
0answers
15 views

Custom taxonomy and custom post type - wrong permalinks and template

so here is the deal - I've got a CPT called opencourses. It has some permalink structure, lets say: open-courses. Recently I've decided to add here a custom taxonomy as well. Im doing it via this code:...
0
votes
1answer
26 views

Template for landing pages

I'm using WP for a business site (not a blog) with landing pages. So there are no posts, only pages (actually, "landing pages") which I create with the Elementor page builder. Since a typical theme ...
2
votes
1answer
52 views

Auto-Generate Longtail-SEO Pages/URLs

Situation: I read this article on how nomadlist.com uses its crowdsourced data to automatically create individual pages to be visibile for longtail seo-keywords. The author states that they use a php-...
1
vote
1answer
29 views

code is skipping a div

In header.php I have created a div to contain my navigation menu area. Within the div is 1 x do_shortcode and 2 x includes php files. For some reason the last include ('custom-primary-menu.php') is ...
0
votes
0answers
28 views

Display specific custom post types

i added a code to display custom post types on my web site like other posts. function add_custom_types_to_tax( $query ) { if( is_category() || is_tag() || is_home() || is_author() || is_page() |...
0
votes
0answers
15 views

How to prevent the search results page from using my single-{post-type}.php template

I have created a custom post type which uses single-{post-type}.php to display when ever a page of that particular post-type is viewed and this works fine. When the search form is submitted the ...
1
vote
1answer
19 views

Custom Post Type template stored in plugin folder not showing in post attributes dropdown

I've created a plugin from which I want to load the template for my custom post type. I've used this guide to load the template from plugin Click Here! The templates are loaded perfectly in the page ...
0
votes
1answer
66 views

Override Dokan Includes File in Child Theme

I'm trying to override this Dokan plugin file in a child theme: wp-content/plugins/dokan-pro/includes/modules/vendor-verification/templates/verification-new.php I can successfully override files in ...
0
votes
0answers
12 views

Is it possible to create an offline website for touch screens?

My school is looking for affordable software to create a presentation on a touch screen. We were wondering if it would be feasible to download a WP template and store it offline on an i5 computer on ...
0
votes
1answer
16 views

Adding a template part as part of a shortcode

I am using "Ultimate Member" plugin to allow users to register because I want some content to be restricted for not signed-in users. According to their documentation, there are a few shortcodes for ...
0
votes
1answer
18 views

How to access Post Archive created by Elementor?

I've created Post Archive template using Elementor Pro, but I don't know how to access the page. When I access /blog I'm redirected to the Home. How can I access my blog page?
0
votes
0answers
16 views

Roots Sage Symfony error when using override from template

Currenty I’m building a website with Roots Sage as my template. The template works like a charm. But for the import of vehicles we use a plugin. The override in the /resources/ is working. For example ...
0
votes
0answers
18 views

User role templates

I'm currently using the author.php template to display a frontend archive of users' posts from all roles. I've now created a new user role ("trainer") that needs to have a completely different ...
1
vote
2answers
39 views

Routing dynamic numeric slug to custom template

How do I make WordPress use a template for any requests where the url is /careers/[0-9]+? We used to have custom posts for job openings handled by single-jobs.php - then switched to an Applicant ...
0
votes
0answers
20 views

How to prevent redoing get_posts queries and make results available to other scripts?

I am modifying a wordpress site that is for online lessons. I am modifying the lesson template which originally had one navigation sidebar for a lesson. I have added a vertical tab switcher so that ...
0
votes
0answers
13 views

How do I add HTML to custom post type template based on logic?

I am using CMB2 to create a custom post type called event. This custom type has a field called 'Event Date' which is of type text_date_timestamp. When a user goes to an event page, I need the page to ...
0
votes
1answer
27 views

Fixing media query

Hello I have an issue with this template: http://demo3.drfuri.com/supro/ The desktop view is starting from a screen size more than 1199 width. I want to set that number to 800. How can I do that? ...
0
votes
1answer
26 views

page-{slug}.php vs. template-{slug}.php

I am working on a legacy WordPress application, and I came across a few files with the naming template-{slug}.php, which were placed in the child-theme folder. I'm surprised I came up with no support ...
0
votes
0answers
15 views

Custom Post Taxonomy Template Not Loading Properly

I have a website I inherited that is exhibiting strange behavior for a custom post type taxonomy template. The post type is resource, the taxonomy is resource_brand, and if it matters, the taxonomy ...
0
votes
2answers
180 views

How to implement my custom development multiple PHP page work into Wordpress?

I have developed a custom PHP page with filters, add to cart module, music playlist everything. How can i implement it into WordPress? I am a newbie, any help thanks. My custom PHP work directory ...
0
votes
1answer
136 views

changing posts layout in ultimate member profile plugin

http://alokikbydivya.webocitytechnologies.website/user/pranav/ I would like for it to be a grid than stacked posts as a lot of empty space looks bad. I am new to customizations and not sure how to ...
1
vote
2answers
55 views

Issues getting PHP to display in category pages

I am using this code to display social media share links at the top of my posts. Currently, they display fine on my pages and posts. Is there any way to get this to display also on my category pages? ...
0
votes
1answer
28 views

Assign template to custom page type?

I have created a custom page type (using post state) for my project, so that I can select the page in the Reading settings like you do for page for posts and also for the home page. This is all ...
0
votes
1answer
27 views

Accessing download link from the loop with WP Download Manager Pro

I'm new to Wordpress, so apologies if this is a silly question. I am using the WP Download Manager Pro plugin to upload PDF's to wpdmpro post types. A user has to enter an email address in order to ...
0
votes
0answers
25 views

How can I filter same content in page

I have website in wordpress have 2 pages Catalogues and Projects. The problem as the content is the same in both pages, so I would like the administrator can select what content goes in each page, ...
1
vote
1answer
37 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
1answer
18 views

How do I bring a page template into a new theme with separate styling?

I currently have a page template that I have striped of all major styling within a theme (twentyninteen-child). I have a new child theme (event), that this page/template will sit under and am having ...
0
votes
0answers
26 views

Send data from function to template (show Google maps)

I'm trying to get the location of X through an API and show it to the user in a Google Maps. Im my template file I have a button (id is the $teamid): <div class="marshal-button"> <a ...
0
votes
0answers
14 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 ...
1
vote
1answer
49 views

creating custom archive template within plugin for custom post type using archive_template filter

I'm trying to create category and tags archive template from my plugin that has custom post type 'product'. I used the below code to display search results in template file located at plugin_dir_url(...
4
votes
1answer
33 views

Where to store some per-template preferences?

I'm in the midst of reworking a site and in trying to make the backend as friendly as possible I'm trying to avoid hard-coding some of my options in template files. I've got a few archive pages where ...
1
vote
1answer
153 views

Display different gutenberg template from selected post attributes

According to https://developer.wordpress.org/block-editor/developers/block-api/block-templates/, I have managed to add a template to the custom post type with the following code - /** * Portfolio ...
0
votes
1answer
40 views

Programmatically generate new pages for a site based on page template and content elements accessed via DB

I 'd like to programmatically generate new pages for a site - the textual and visual components of the content are stored in a DB, this includes the names for the different locations the pages are ...
0
votes
2answers
90 views

how to pass args for archive.php query?

I am trying to pass args to archive.php so that I can order the posts, set the number of posts, etc.. but the query is done like this <?php if (have_posts()): ?> <?php while (have_posts())...
0
votes
1answer
12 views

How to add a template - so that i can choose a different menu for some pages

Hi I would like to know how I can add a template just to choose a different menu for some pages, Any help appreciated!
0
votes
0answers
12 views

I've installed example data on Nominee template but the published site shows another version of the site

I'm making a website using Nominee template from themeforest. I've downloaded all the content from the demo website. Actually ended up doing it twice in two different ways, using the import ...