Questions tagged [theme-development]
Themes create the public (front-end) interface for a WordPress site.
4,454
questions
0
votes
0
answers
19
views
Pagination Links for Custom post type returns 404 [duplicate]
first of all, I am new to WP development, and PHP.
I am developing a template that has several custom post types. the problem is when I add pagination to my custom post type, all pagination links ...
0
votes
0
answers
15
views
Can not edit Wordpress preset CSS-classes in own Theme
Good morning,
I'm making my own (classic) theme for the first time. After I installed the test XML data, I noticed that some things weren't displayed correctly. For example, H1-H6 are assigned the CSS ...
0
votes
0
answers
4
views
Create multiple facades for same product?
Consider you sell zucchinis (courgette for those British, French).
And that is exactly my problem.
If I make a product called Zucchini - then it'll list on Google as Zucchini. But then I will not get ...
0
votes
0
answers
24
views
old content are still displaying after using wp reset and clear cache
i have only two files in public_html folder, but when i opened the website link in private window, site old content is still displaying ? what i need to do to remove old site content ?
index.php :
...
0
votes
1
answer
25
views
Bring your own theme to PHP 8
My self-created theme no longer works under PHP 8. I would like to change it so that it continues to work. Currently only the navigation is displayed.
I have deactivated all plugins.
I have tried to ...
0
votes
1
answer
21
views
Show posts assigned to multiple categories in current category page
Whenever I assign a post to multiple categories, the Wordpress website just loads posts from Cat1 only. No error message.
My post-assignment method:
Post1 - Cat1
Post2 - Cat2
Post3 - Cat1,Cat3,Cat4
...
0
votes
1
answer
9
views
Show category name in category.php when posts assigned to multiple categories
I'm trying to show the category name in my category.php but it's not working when I have posts assigned to multiple categories as it chooses the first category.
<h1><?php $cat = ...
0
votes
1
answer
29
views
Why does customize_register only load inside of functions.php for me?
I'd like to better understand - when I place the below into my functions.php file:
add_action('customize_register', 'boat_annualReport_customize_register');
function ...
0
votes
1
answer
14
views
Selective styles and scripts inclusion
I'd like to know if is there any method that allows to include scripts on specific pages/templates depending if those page have a specific get_template_part inside.
Example:
I have more than one page ...
0
votes
0
answers
21
views
404 error on page reload
I have created a WordPress based web app that will rely on template pages that will host some vue.js different front-end apps. I've added this code to the theme functions file to rewrite all the ...
0
votes
1
answer
13
views
Is child-theme required when modyfing "Appearence > Editor"?
I'm using the block theme "Twenty Twenty-Three" and I've modified its appearance by doing some custom editions through "Appearence > Editor".
Now, will I lose all those changes ...
0
votes
0
answers
19
views
Confusion about theme's parent and child functions.php file
So I read WordPress documentation here:
https://developer.wordpress.org/themes/basics/theme-functions/
Where there's such statement:
Although the child theme’s functions.php is loaded by WordPress ...
0
votes
0
answers
66
views
Theme folder name changed after update theme
For my block theme I use a script from Misha (https://rudrastyh.com/wordpress/theme-updates-from-custom-server.html) to update my theme. Everything works fine, only I find out that the theme folder ...
0
votes
1
answer
48
views
How to use webpack in WordPress theme? I want some scripts to load in the footer, some in the header and some with script parameters
I wonder how to use webpack while bulding theme for WordPress the correct way.
Everything is pretty easy until I have to make some unusual things.
So in the most simple scenario I just have some JS ...
1
vote
0
answers
20
views
Block editor layout not present in post editor
I have a WordPress block theme entirely built using the block editor, i.e. empty html template files. Since a recent update of WordPress, the post editor is not abiding to the width applied in the ...
0
votes
1
answer
27
views
Wordpress - Old theme causing display issues
PROBLEM FIXED - Server side cache not deleting. Now using "WP Fastest Cache"
A WP site was using Adventurous theme which no longer suited us. We have changed, in the interim, to a WP Twenty ...
1
vote
0
answers
13
views
Modify HTMl on header.php on Block Theme like Twenty Twenty Three?
I'm trying to hide the WordPress version without using any plugin.
Many pages suggest doing this using functions.php with the following code:
remove_action('wp_head', 'wp_generator');
Or
function ...
0
votes
0
answers
13
views
Not all custom templates show up in Theme file editor [duplicate]
I'd like to edit the source of some of my custom templates. I have made extensive modifications to a child theme.
But only some of the custom templates show up in Theme file editor or are present as ....
2
votes
1
answer
99
views
Javascript localization doesn't load. How to Internationalize javascript without plugin?
The internationalisation of my theme is defined in functions.php and the javascript file to be internationalised uses the wp-i18n library.
The translation function __('string',text-domain'); is ...
0
votes
0
answers
32
views
All Pages and Post are redirecting to 404 Not Found in wordpress
I am using wordpress, I have created 3 pages and 4 posts on my website. I am able to access the front page but the rest of the pages are showing 404 not found, Same for post also.
If I use some logic ...
0
votes
0
answers
37
views
editor.css and block-editor.js are not applied even though they are in the theme setup
I'm on WordPress Multisite and for some reason, the aforementioned files are not applied and create errors such as missing whitespace between the left side of the screen and the title/blocks. I've ...
0
votes
0
answers
19
views
Array offset error on type bool and null, due to admin-bar support added
I recently started working on a new theme and added admin bar theme support by using this snippet of code in the functions.php file.
add_theme_support('admin-bar');
However, I am getting the ...
0
votes
0
answers
70
views
What is the php code for an Elementor header?
I'm building a WP theme demo with OCDI, TGMPA and Elementor. That works fine, except it doesn't show the Elementor header and footer. The .dat file does import them; I have to activate them manually. ...
0
votes
0
answers
16
views
get_the_category() doesn't work outsideThe Loop?
I am trying to put the following code in the functions.php, to update a custom post's meta field whenever I publish a post.
function run_on_publish_post_only( $new_status, $old_status, $post ) {
...
0
votes
0
answers
19
views
How to add multiple inputs under a single $key name
I created a custom meta box in my wordpress theme and my codes are below. I want to create two types of $key names "ja_work_logo_url" and "ja_work_bg_images_url". The first one has ...
0
votes
0
answers
26
views
Load theme error? How do I fix this so people can see my website?
When people try to open my blog all they see is
?> ?> ?> /** * Front to the WordPress application. This file doesn't do anything, but loads * wp-blog-header.php which does and tells ...
0
votes
0
answers
17
views
Customize product card Up-sell on Woocomerce
I changed the product cards to also show the category and short description of the product but I can't show it in up-sell products.
this is the code i used
function category_single_product(){
$...
2
votes
0
answers
39
views
Adding block style dependencies
I'm running into a problem where my block styles are being enqueued before my theme style. Because of this, the theme style is overriding my blocks and that is undesirable.
Is it possible to add style ...
0
votes
0
answers
15
views
Show the value of the custom field of the order on the My Account Front-end page
I would like to show the value of the custom fields filled during the order also in the frontend my account page.
This is the URL of the location:
https://example.it/my-account/view-order/860/
I would ...
0
votes
1
answer
28
views
how can i modify the default wordpress sidebar
I need to hide the Uncategorized category from the default sidebar.
I edited the file wp-includes/widgets/class-wp-widget-categories.php, but I did not see any changes. Here is an image of my sidebar, ...
0
votes
0
answers
23
views
block the cart to a product without blocking the quantity
I'm creating a course site where it is possible to register and pay via Woocomerce, I need to block the possibility of adding multiple courses (products) to the cart but leave the possibility to ...
0
votes
0
answers
19
views
Selecting what blocks are allowed in core/edit-widgets by sidebar ID
I am looking to control what blocks are available to the user in the "block-based widget area". I see this as the perfect area for handling things such as contact numbers, and alert messages ...
0
votes
0
answers
29
views
Intelephense not recognising parent theme functions
So i have the intelephense ext on VS code, and i have managed to have it recognise ACF functions by downloading the stubs to my computer. however, it does not recognise parent theme functions, ...
0
votes
1
answer
73
views
How to check if a custom post type uses a custom template?
I have created this custom post type called books, and I already know I can select it with the condition tag is_singular( 'books' );.
But, is there a way to select with its custom template name, I ...
2
votes
1
answer
115
views
Show the terms of the hierarchical taxonomy
I'm trying to display buttons with category term names.
i am using this code which works to show terms of categories which without hierarchy, but i can't figure out how to adjust it for hierarchical ...
1
vote
1
answer
67
views
The theme doesn't load css and JS files doesn't load in functions.php
I'm just moving a theme from Vercel that done in HTML/CSS/Bootstrap/Nuxt.js to be deployed in WordPress trying to enqueue the css files and js but doesn't load at all the content of front-page.php and ...
0
votes
0
answers
35
views
Display posts on category archive organized into subcategories?
I have been trying to achieve this as part of a WordPress theme, where users can assign a FAQ style template to a Post category of their choice, which is then organized into subcategories for easy ...
0
votes
0
answers
19
views
Add a block from Gutenberg Nightly to a custom template
I installed the Gutenberg Nightly plugin from Gutenberg Times. I'm trying to access the Table of Contents block to put it into a custom taxonomy page template that I'm building. My first instinct was ...
1
vote
0
answers
334
views
useBlockProps() nests wrapper with class name inside block wrapper in the editor
I'm trying to add a tailwind class to the block wrapper of a custom block I'm developing.
However, useBlockProps({className: 'h-full'}) generates an additional wrapper with the tailwind class name ...
0
votes
2
answers
97
views
Exclude first post from wp query
I am building a WordPress website and I want to show post in it. But the problem is that, I want to exclude the first post in query. I have not much knowledge of PHP. So please help me to de this.
...
0
votes
0
answers
7
views
Remove certain attributes for content before hitting wp-json
I want to remove the data-id attribute from the linkChecker component but, it seems like even when it is removed the data being posted to wp-json still maintains the data-id attribute.
I understand ...
0
votes
0
answers
77
views
Loop through Redux option framework repeater field
I am using Repeater field of Redux Framework in WordPress.
I have created the repeater field and assigned the data. Now I am trying to display those data in front end. But I am not getting how can I ...
0
votes
0
answers
19
views
How do I set a menu in OCDI
I want to use the OCDI plugin to export a demo. That works, except for the menu. Whatever I try, I have to set it manually after import.
This is the code:
// Assign menus to their locations.
$...
0
votes
0
answers
40
views
Pagination count and Pagination link not working in my buddypress template
I am trying to create a letter archive for the users on their buddypress profile page.
The letters are displayed in the profile page tab, but the pagination is not working.
$contest_args = array(
'...
0
votes
0
answers
11
views
Wordpress Includes mejs 404 error
I have an issue with NewRelic reporting a number of 404 errors which all stem from the WP includes mejs
Example of the 404 error
site.com/mejs.hebrew
& site.com/mejs.dutch
Has this occurred for ...
0
votes
1
answer
34
views
How can a theme define which settings for blocks are available in the block editor?
A website I maintain uses a self-made theme based on a starter theme (Sage). It was developed in 2016, hence long before the block editor appeared.
Now we want to go away (at least for some posts) ...
0
votes
0
answers
71
views
Define fonts in theme.json what slug name
Is there a naming convention for slugs for fontFamilies in themes.json. I see they end up being using for the vss var --wp--preset--font-family--<slug>. So it would make sense to name the slug ...
0
votes
0
answers
81
views
Setcookie not setting cookies anywhere except admin
I want to set various cookies from the URL query string. I am checking for the GET values and then printing the desired values and then trying to set the value in the cookies.
function on_page_load() {...
0
votes
1
answer
123
views
Remove Gutenberg Buttons Block
Is there a way to remove the default core/buttons block in Gutenberg, or other various blocks? We're creating our own buttons block and don't want the user to get it confused with the default one and ...
0
votes
0
answers
94
views
Block to show posts from same category
I'd like to create a block to display posts (in my sidebar) from the same category as the current post.
I tried to use a blockVariation on core/query, but I don't know how to pass it the current post'...