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
0 answers
8 views

Wordpress template reverts to "default" when adding a saved template in Elementor

When I add a saved template from the Elementor builder, the Wordpress template for that page reverts back to "default" and it is both front end and back end. Does anyone have a workaround ...
user avatar
  • 1
-1 votes
0 answers
12 views

testomonial section [closed]

I want to know how to make a testimonial section using the elementor page builder in WordPress.I am attaching the screenshot of the section which I want to build. Kindly do let me know.
user avatar
  • 1
0 votes
0 answers
31 views

get_children() Archive Template

This is my first attempt at coding & I have come unstuck with the wp_query loop integration. I just want to build a template for a page that will check for children and list their respective ...
user avatar
  • 1
0 votes
2 answers
43 views

When are Shortcode Attributes Available in Template

I have a template that adds a shortcode. The add_shortcode is at the top of the template, before any template output. Note that any attributes for the shortcode are optional. I don't care if they ...
user avatar
0 votes
0 answers
13 views

Getting Shortcode Attributes befor content is displayed by the template

This regards getting the shortcode attributes to be used in a function called after the shortcode is defined, in a template. The page that uses that template has the shortcode plus attributes, as in [...
user avatar
0 votes
0 answers
11 views

Is it possible to create custom links inside a template?

I'm creating a template for a custom post type with the URL structure of TEMPLATE ONE mysite.com/firstname1-lastname1/ mysite.com/firstname2-lastname2/ ... etc I also have pages from a custom post ...
user avatar
  • 1
0 votes
0 answers
14 views

How Add Code in Page Index Custom Template?

I want to display a code in a Custom Page (Index-sitemap) created in the theme folder. But when I use the following code it just shows up on the Homepage. if(is_home() && ! is_front_page()) { ...
user avatar
0 votes
0 answers
16 views

How to save template data into wp_post table (post_content column)

Is there a way to save template data into wp_post table? I made a custom template that automatically makes tables and some sentences with the meta-data that users insert in. I wanted to make users ...
user avatar
0 votes
0 answers
24 views

How to get rid of undefined variable in previous post image

I am working on a website on WordPress and I have it set to where the bottom of the post will automatically link to a random previous post with a picture from that previous link but a notice keeps ...
user avatar
  • 1
0 votes
1 answer
56 views

How do I get the trackback count of a post in wordpress without writing an SQL query?

How do I get the trackback count of a post in wordpress without writing an SQL query? I tried searching Brave Search and I couldn't find anything helpful. To fetch the amount of comments a post has, ...
user avatar
  • 101
0 votes
1 answer
22 views

Post and page content not displaying in search results

I am using a content-search.php template part to output my search results. The post/page titles and links to those posts/pages are working correctly, but for some reason the the_content() function is ...
user avatar
0 votes
0 answers
20 views

How to loop specific Category menu from archive page?

I'm trying to loop a specific product category menu from the archive.php page and the category has 4 columns or as a 4th Tree How I can Loop it here in ul ? <ul><!-- 1--> <li&...
user avatar
0 votes
1 answer
26 views

How to set a template with wp_insert_post

I'm trying to set my template to the Elementor Canvas when using wp_insert_post but it isn't working. It is creating the new page fine but not using the canvas. What am I doing wrong? { "action&...
user avatar
1 vote
2 answers
87 views

Can we use a webservice with Wordpress?

Assuming that my site uses a database through the web service to fetch content, style and other things for my site. Can we make this connection in a way provided by the CMS? A plugin does that? Should ...
user avatar
1 vote
1 answer
33 views

WordPress Loop inside Loop?

I'm using ACF, and displaying the Brands CPT. Inside of brands, I will want to setup a separate loop for posts containing certain tags. My loop works, meaning that I'm able to access the brands and ...
user avatar
0 votes
0 answers
21 views

Taxonomy archive uses incorrect template when query strings are used

I have two taxonomies in use on my site, both of which have their own taxonomy archive templates with different interfaces. I use query strings to perform filtering on each of the archives. My problem ...
user avatar
  • 1
1 vote
0 answers
20 views

Can I add a default Block to my custom theme?

Lots of plugins provide both shortcodes and PHP for adding elements... either directly in a page or post, or programmatically in a theme template. Is there a process for adding a Block, like Latest ...
user avatar
0 votes
1 answer
17 views

Create a custom posts page

I've created a template that shows all my blog posts. But the issue was that this page slug (tips-and-tricks) wasn't added to the URL of the single post. Solution: I've selected this page as my blog ...
user avatar
  • 125
0 votes
0 answers
11 views

How to get all template files used for rendering a single post/page?

So, I need to debug an issue and I would like to see all template files that were used to render this specific page. I mean specific "sub" template files (not the main .php file), like sub ...
user avatar
  • 116
0 votes
1 answer
48 views

Why is a wp function used in current PHP namespace's callback not resolved to global scope?

Imagine the following script: <?php namespace MySpace; class MyClass { public static function execute() { // Do something post_exists(1,'','','my_post_type'); } } ?> I'm now ...
user avatar
  • 307
0 votes
0 answers
12 views

How do I set the Stewart Search Template to return only published posts in the result

I recently took a WP.com online webinar and the moderator referred me here to ask my question. I am trying to redesign my site using FSE. I am using the "Stewart" theme. I have added a ...
user avatar
  • 1
0 votes
1 answer
29 views

Does wordpress templates always in files or in database?

I have theme and in header.php and I found this templates (see attached screenshot). But there is no content directory in template directory. Even I searched for those files (header-private.php and ...
user avatar
0 votes
0 answers
16 views

Include last post date in get_categories loop

I have a simple get_categories loop on a template page which works fine to display a list of categories within the parent category 52 (as shown below). I would like to also display the last post date ...
user avatar
  • 1
0 votes
1 answer
47 views

In a WP_Query can I force the results' is_singular() to be set to false?

I have a custom page template that includes a basic query after the main content. like this: $myPosts = new WP_Query( array( 'post_type' => array('post', 'contentTypeA', 'contentTypeB' ), ...
user avatar
  • 141
0 votes
0 answers
60 views

How can I disable an attribute from a Gutenberg block included in a template via InnerBlocks?

So I have this block that I created using templates and InnerBlocks, it's a block that my authors will use to insert a Hero Image section at the top of the page. export default function Edit() { ...
user avatar
  • 111
0 votes
1 answer
33 views

How can i get the code of Shop Page Woocommerce?

I'm trying to write the codes of the shop page in woocommerce, especially in the main div All of them are inside div with class-main, and I want to know how I can create one by myself with the ...
user avatar
0 votes
1 answer
40 views

How to get and set the post tag value within WP Query from URL?

This is new grounds for me. I'm on a hunt trying to figure out how can use a WPQuery to list all posts, that are filtered by the tag which the user clicked on. So for example if the end-user is on ...
user avatar
  • 708
0 votes
0 answers
14 views

Wordpress Template Reverts to default template after changing

I am experiencing a problem regarding wordpress page template. after I change the wordpress template to "Home Page", it reverts to default template after update. I tried installing WP Super ...
user avatar
1 vote
2 answers
31 views

Best Constant to use to check if WordPress is running

I have a program that can run standalone (outside WP) or inside WP. If the program is running 'inside' WP (via a custom template using appropriate enqueue scripts and add_actions), then there is a ...
user avatar
4 votes
1 answer
153 views

Problems with Layout inherit in theme.json

I have in the theme.json of my FSE theme the following lines in the code: "version": 2, "settings": { "layout": { "contentSize": "840px&...
user avatar
0 votes
0 answers
16 views

Create custom page to author.php

How can i add new pages to author page? normal url is like https://www.example.com/author/exampleUser i wanna make a settings page located in like this: https://www.example.com/author/exampleUser/...
user avatar
0 votes
0 answers
21 views

Please help me clear my confusions about WordPress

I am building a website in WooCommerce. What is most efficient way to replace the original theme site template pictures? Do we replace them with same size and pixel pictures and nothing wrong will ...
user avatar
0 votes
1 answer
29 views

Can't split the_title() by white space

I am having issues splitting the_title() by white space in my template. $title_split = explode(" ", trim(the_title())); and (from here: https://stackoverflow.com/questions/23206953/split-...
user avatar
0 votes
0 answers
22 views

Loading Elementor templates in a Bootstrap modal on button clicking

I'm trying to load Elementor templates in a Bootstrap modal on my homepage, I've already linked the Bootstrap and I can load the modal when the button and modal content are on the same page without ...
user avatar
  • 1
0 votes
0 answers
11 views

WordPress 2022 template, how to see the blocks added in post template on post edit?

I’ve created a post template in 2022 theme. In this template I’ve added an image block. I’ve assigned this template to the post. Where (and how) do I upload the image in the post edit? On Post edit I ...
user avatar
  • 121
0 votes
0 answers
93 views

Is it possible to set archive.php instead of index.php to display blog?

I have index.php and archive.php in my theme, but I'd like to using archive.php to display blog and category posts. Is it possible to override index.php by archive.php?
user avatar
  • 1
2 votes
0 answers
63 views

How do you override Post template when using Query Loop block?

Seems like an impossible task to override how posts are rendered in Query Loop block (grid). Default block level controls enables styling but not overriding of markup. I just want to apply HTML5 ...
user avatar
1 vote
1 answer
26 views

Automatically add custom CSS to new posts using a category template

I have inherited the task of modifying a Wordpress site (using a child theme). I'm a designer, not a code or back-end expert. I have been customizing a set of pages on a site to have alternative ...
user avatar
1 vote
1 answer
68 views

how to display search term in the template full site editor

i am building a template for the search page (in full site editing, therefore html and no php), and i want to have a search results heading. i have this: <!-- wp:group {"layout":{&...
user avatar
  • 113
1 vote
0 answers
31 views

Remove post templates from the selection box menu when creating a single post

I added some post templates(not coding, using block editor) and now I can't find any options to delete those unnecessary templates.
user avatar
  • 11
0 votes
1 answer
15 views

How can I trace inconsistency in loading a template?

I have two (almost) identical wordpress websites. A devel/local and a production/remote. I have a custom post type "event" created through Meta Mask on both instances. I want to render a ...
user avatar
0 votes
1 answer
28 views

How to specify a template for a path like http://example.com/something?

I created a custom post type ('explore') that we use in the site. The pages for this section live at http://example.com/explore/page-name These pages work just fine, but if a user were to back out of ...
user avatar
  • 113
0 votes
1 answer
24 views

How to insert "get_template_part()" based on Category ID?

I am trying to insert a part of my template into a Category Archive page. How would I go about that? I guess I'd need something like this: <?php $catarray = get_the_category( $post->ID ); ...
user avatar
  • 985
0 votes
0 answers
23 views

Editing my loop-page.php causes posts to show on all pages

I am working on a project where I needed to list out blog posts when I hit a particular page. Originally I was just using the base code in my loop-page.php file. To do that I was using: <?php ...
user avatar
  • 101
0 votes
1 answer
336 views

How can I display the number of post associated to a category in Twig/Timber Wordpress? [closed]

I am using the following code to access my categories. $orderby = 'name'; $order = 'asc'; $hide_empty = false; $cat_args = array( 'orderby' => $orderby, 'order' => $order, '...
user avatar
  • 3
0 votes
1 answer
17 views

how to set social icons to product / post template (Auros theme)? [closed]

After installation of the Auros theme, the social share icons are unfortunately not loaded in the product and the post template. It should be loaded like this via the template: Do you have any idea ...
user avatar
0 votes
1 answer
21 views

How do I custom a page that doesn't exist in the page list?

Many custom post types have their own archive page which doesn't exist in the page list, but I am able to customize these pages by finding the archive's template file. But for some other instances, I ...
user avatar
  • 117
0 votes
1 answer
212 views

Timber - Twig post.content returns null can't create ACF Gutenberg blocks

I'm using Timber for a Wordpress site and I'm trying to start and build Gutenberg blocks. The blocks work in the backend editor but I cant get them to work in the template. In fact nothing from the ...
user avatar
0 votes
0 answers
23 views

How to turn my WordPress site into a ready to deploy template?

I have a wordpress membership site, where users can login/signups and manage their accounts. I was wondering if it's possible to convert this site into a ready to deploy template which I can download ...
user avatar
  • 1
0 votes
0 answers
78 views

How to list posts from a sub-category that is listed in a parent category (more details below)?

I have an unusual situation I put myself in. I'm making a custom theme and I want to display a list of subcategory posts with its own URL like this: https://domain.com/category/sub-category So far, ...
user avatar

1
2 3 4 5
41