Questions tagged [theme-development]
Themes create the public (front-end) interface for a WordPress site.
4,450
questions
1
vote
0
answers
13
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
25
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
11
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
55
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
26
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 ...
-1
votes
0
answers
24
views
Upload logo using custom theme panel
I am building a WordPress website with custom theme panel options following this guide.
function logo_display()
{
?>
<input type="file" name="logo" />
...
0
votes
0
answers
29
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
16
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
32
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
18
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
22
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
10
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(){
$...
1
vote
0
answers
22
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
12
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
22
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
22
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
22
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
43
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
111
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
48
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
33
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
13
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
189
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
37
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
5
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
55
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
18
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
34
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
23
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
54
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
53
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
88
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
42
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'...
1
vote
0
answers
23
views
Is there any halfway decent documentation on the wp.media JS class?
Sorry for the somewhat rambly question, but has anyone ever seen any good piece of documentation, or maybe even a tutorial on the wp.media JS class?
All that i could find documentation-wise is this ...
0
votes
0
answers
25
views
Adding copyright notice to page bottom in full site editing template
I am adding a function, a copyright notice, to my full site editing theme.
I initially tried a shortcode and added shortcode as a block in the footer within site editor. This renders the notice just ...
0
votes
0
answers
8
views
custom wordpress theme blog page always not showing the last two pages of the articles
custom wordpress theme blog page always not showing the last two pages of the articles, always sending in the last two pages to 404 page
Anyone can give me a light. I create a theme, using the theme ...
0
votes
0
answers
17
views
I want to resize post featured image without cropping image. How?
I want show post featured image on different page in different size but image in not showing full. Also, do not want to crop image.
I am adding an link that what type of work I want do. Example When ...
0
votes
0
answers
12
views
New directory created each time I upload new theme zip
I'm creating a theme based on Underscores. I use its 'bundle' method to generate a new zip of the theme for deploying to a dev server.
This has worked fine on other projects, but on this one each time ...
0
votes
1
answer
27
views
Does a custom WordPress theme require updates to it's source code?
I have not found a satisfactory answer to this question. WordPress releases a lot of updates. As I am relatively new to custom theme development, I do not know if some of the changes in the WordPress ...
0
votes
0
answers
43
views
Transitioning a big blog to WEBP images
I have a Wordpress site with a LOT of posts that still get significant amount of traffic (10,000's of posts).
The site is image heavy and uses <img> tags for inline Jpegs as featured and inline ...
0
votes
1
answer
35
views
How do I send out an update for my custom wordpress theme?
I created a wordpress theme and I've installed it on two sites so far. I recently made an update to the theme and I want to push it to all of my clients. How do I send out an update?
0
votes
1
answer
24
views
Should we escape the values of constants?
In my theme folder, I store my constants in a file called constants.php.
But when we use the constant, should we escape it like esc_html__('This is '. CONSTANT_A, 'text-domain');
I was wondering if a ...
0
votes
1
answer
34
views
Modifying posts based on category in TwentyTwentyTwo theme
This is quite a starter question.
I want to change the style of all the posts in the "photos" category by adding custom CSS to the style.css file of my child theme. However, I cannot find any ...
0
votes
0
answers
72
views
Align images to the left of the content
I am using WordPress 6.2 and the Twenty Twenty-Three theme. I am using a local version of WordPress so I am able to edit the style.css and other files.
How can I make the left-aligned image blocks ...
0
votes
1
answer
42
views
Hook a search form anywhere on the site, using a custom plugin
I'm new and I apologize if I ask an already existing question. But I can't find the information I'm looking for.
I need to know how a search form works in wordpress.
I'm creating a custom theme and ...
0
votes
0
answers
41
views
Image and font support missing in editor when deploying theme remotely
So I am starting to learn Wordpress development and today I uploaded my first custom theme from my local environment to the remote hosting server. My theme installed with no issues and I was ready to ...