Questions tagged [theme-development]
Themes create the public (front-end) interface for a WordPress site.
4,485
questions
0
votes
1
answer
155
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
91
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 ...
0
votes
2
answers
107
views
Why is my Toggle field not showing in Gutenberg?
I am adding a PluginSidebar to Gutenberg and it works until I try to add a meta field to the sidebar. Then it doesn't work. I'm not sure why though.
import { registerPlugin } from "@wordpress/...
0
votes
0
answers
212
views
Why isn't custom sidebar panel not showing up in the Gutenberg Editor?
I am trying to add a custom Gutenberg sidebar panel but it isn't showing up. I'm not sure why though as I have the sidebar.js and then enqueue it in PHP. I ran npm run start and it compiled the JSX ...
0
votes
1
answer
217
views
functions.php doesn't load all custom theme assets
I'm writing a simple wordpress theme. I've added this function inside the functions.php file and I've noticed that only style.css is loaded. Is there something wrong that will cause that the other ...
0
votes
1
answer
27
views
Wordpress search field won't get wider
I've tried everything I know how to get this input field to 100% but I can't seem to do it. It always stays at some stuck width. .search-field is the stock class and I've targeted that class using max-...
1
vote
1
answer
140
views
How to set the margin on an innerBlock in a block variation?
I am trying to define a block variation that has an innerblock with a margin. I was able to set the color of the innerBlock just fine, but for the life of me, I can't make the margin work.
Here's what ...
0
votes
2
answers
368
views
Font Awesome Icons as squares [closed]
I have been trying to migrate my html css and javascript static website to a wordpress dynamic theme. Everything worked fine and looks perfect but for some reason my font awesome icons appear as ...
0
votes
1
answer
3k
views
WordPress PHP8 Critical Error in class-wp-widget.php
Recently updated to PHP8 and I'm getting a critical error related to the theme.
The critical error is:
Fatal error: Uncaught ArgumentCountError: Too few arguments to function WP_Widget::__construct(), ...
0
votes
0
answers
66
views
When trying to run build script with gutenberg (with SVG import) - Error: Plugin name should be specified
I have a theme that is live and has some 10-20 custom gutenberg blocks,
Those blocks sometime have svg imported to them like so
import logo from './logo.svg'
Today when I was trying to work and ...
1
vote
1
answer
165
views
Full site editing templates folder vs block-templates
I have a modified Bedrock installation that moves the theme folder outside of the wp-content folder (and the normal app folder for Bedrock). In this setup, the app folder has a data folder that is the ...
1
vote
1
answer
214
views
How to make content as required in custom post type?
I created custom post type Testimonials and made the title required using the code in this link:
Require title for pages
Now I applied the code in order to make the content required, and it works fine....
0
votes
1
answer
81
views
How can I use pre declared blocks in a php file?
Is there a way/ a function to insert a block and user reusable blocks from inside a php page/template-part like use_block('jetpack/google-calendar') to a block?
(I am using a partial block theme, ...
3
votes
1
answer
42
views
Execute javscript when theme customizer loads (autosave issue)
I have a theme that is having an issue when there are unsaved theme changes, then the user restores an autosave.
My theme has some jquery that watches for a font to be changed, then updates a second ...
4
votes
1
answer
222
views
Return the_content() with custom div class for a subset of posts
Is it possible to have the_content() function return the post content in a div with a custom CSS class (i.e. something other than the-content)?
I have a unique post I'm trying to lay out that requires ...
0
votes
0
answers
18
views
Wordpress administration is gone after creating base theme
I have following files for a base theme:
wp-content/themes/base/style.css (empty)
wp-content/themes/base/index.php
// index.php
<?php declare(strict_types=1);
echo wp_nav_menu();
After ...
2
votes
1
answer
50
views
WordPress Two Level Filters on Getting Custom Taxonomy Terms
I have a Custom Post Type Called movie and I have two taxonomies genre and quality associated with that.
Now I need to get/filter all terms IF
genre = 'action'
AND
quality = 'HD'
Using this code I ...
2
votes
2
answers
220
views
Theme's featured image option is not showing up
I'm new to WordPress development. I watched a video on how to add featured images. For some reason it's not working, and I can't really figure out why. The option for featured image is not showing at ...
4
votes
1
answer
662
views
Is there any filter or action hook to remove layout classes from appearing in my templates?
With the new WordPress 6.1 core update, my site is now having a is-layout-flow class added to the layout.
Normally this wouldn't be a huge issue. However, we are using the WP API to feed the content ...
1
vote
0
answers
290
views
WordPress Ajax load doesn't work
Hello I have set up custom Ajax load more without plugins, but it’s only showing 3 posts on home page, and when clicking on button to load more it’s not loading anything. As I am a beginner I am ...
4
votes
1
answer
82
views
Theme template file for a specific custom taxonomy
Is it possible to create a template file specific for a custom taxonomy?
For example, I have music Custom Post Type and it has three taxonomies artist, album, and genre. So the hierarchy would be like ...
0
votes
0
answers
59
views
How to make it so I can "use" template parts in (classic/full) site editor
I want to make a website with an editable front page for a client with no coding knowledge,
the client should be able to edit the front page in the site editor like a regular page, but should be able ...
0
votes
1
answer
56
views
How to automatically set a Template Page Name next to a page in menu screen such as WooCommerce pages, front page, or posts page in wordpress?
When creating a menu, and after selecting a page as front page and another page as posts page..it appears next to the page in menu screen. For example, "Front Page" appears next to home page,...
2
votes
1
answer
226
views
Can't select my block by clicking on it on apiVersion - but using blockProps
I'm building my first Wordpress block but I've ran into an issue. If I set my block's apiVersion to 2, I am not able to select my block.
I'm aware that for apiVersion 2, you need to use the ...
0
votes
2
answers
22
views
Not Able to Access Terms Under Custom Taxonomy Archive
Having a Custom Taxonomy called movie-genres
'rewrite' => array('slug' => 'movie-genres', 'with_front' => true) );
register_taxonomy( 'movie-genres', array( 'movies' ), $args );
And I have ...
0
votes
1
answer
22
views
orderby property of query on pre_get_posts returns incorrect value
I am attempting to implement some custom sorting logic for a column but are facing issues in the pre_get_posts hook. The value of the orderby property on the query is not returning the value ...
0
votes
1
answer
201
views
My theme is full of error messages in the "Customize" screen, but nowhere else
I'm making a custom Wordpress theme. At some point, the "Customize" page in the admin panel has completely broken, giving me tons of these errors:
Notice: Trying to get property '...
1
vote
1
answer
2k
views
How do I work with responsive images in Wordpress? (img srcset/sizes)
I'm trying to make a Wordpress theme and I'm very confused about how I should use responsive images. Here's how I'm currently displaying each thumbnail in my post list:
<? the_post_thumbnail() ?>...
1
vote
1
answer
522
views
Webpack does not create or update index.asset.php file in build folder
I am using @wordpress/scripts package to set up Webpack in a WordPress theme. However, I ran into a problem with default Webpack configuration as it is creating an unnecessary .js file inside the ...
0
votes
1
answer
307
views
Custom Theme functions.php – Using add_settings_field and input type="file" to set custom logo
I've seen several examples for "add custom logo" to wordpress theme, most of which use this basic code, specifically
function display_logo_element()
{
?>
<input type="...
0
votes
1
answer
151
views
How to show associated fields if checkbox is checked in customize widget screen using wp_customize?
I created a checkbox section to let user to choose whether wants to display a button in the menu or not, I set the default value to false, and created two fields for the label of the button and the ...
0
votes
1
answer
105
views
How to Enfroce Domain Licensing Limits? [closed]
I'm looking to sell premium WordPress plugins (using Easy Digital Downloads licensing manager) and I want to limit the number of domains the plugin can be activated on (to receive automatic updates). ...
0
votes
0
answers
54
views
Meta box not displaying on the plugin page
I am working on a plugin and I am creating a meta box on my page using the below code but it's not displaying anything.
Any idea where is the issue with my code?
class bt_dashboard
{
function ...
1
vote
0
answers
371
views
How to Enable Hot Module Replacement with Webpack
I am using @wordpress/scripts to set up WordPress with Webpack in a Wordpress theme. The current configuration works fine and compiles the scss and js files from the src folder when I run npm run ...
0
votes
1
answer
110
views
Default Wordpress Query for a Specific Custom Post Type URL
I need a little more clarification on the default query for a specific custom post type url. I am learning how to use WP default functions and queries via Udemy. However, I feel like this little part ...
0
votes
0
answers
348
views
After a while attachment meta data is missing "sizes" data
We like to use custom image sizes for custom WP themes. This way, we can provide appropriate images for the custom elements and we can ensure that images don't load too large or too heavy. Now we've ...
0
votes
1
answer
168
views
Override plugin constant using a theme
I have a plugin which starts:
<?php
define( 'MAX_THINGS', 30 );
I would like to change the constant to be 2.
I know I can edit the plugin file directly - but that will be overwritten if the plugin ...
0
votes
1
answer
657
views
Template for posts of category in block theme?
I am trying to use a custom template for posts of a given category in a block theme. I have created the template file in html (post-show.html). And I have edited the template in the site editor. As I ...
0
votes
1
answer
59
views
Website Developer has gone missing! How to gain full access of your code from a Wordpress website?
I have hired a website developer to create a Wordpress website for me.
The website is nearly finished, but the website developer has gone missing!
I have admin access to the Wordpress dashboard.
How ...
0
votes
1
answer
299
views
How to fix wp-env: "error: Your local changes to the following files would be overwritten by checkout"
I have been using @wordpress/env for a few weeks, starting it with npm run wp-env start. Since this morning, that now fails with:
> wp-env "start"
✖ error: Your local changes to the ...
-1
votes
1
answer
96
views
Configuring static page with add_rewrite_rule gives 404 after navigating to Permalinks admin panel
I would like to create a simple static page in my theme which would then show some practical information on a certain event. The page would be served on the path /practical. For now, there are no ...
0
votes
0
answers
33
views
Do core themes normally allow automatic upgrades?
I understand that in general WordPress core and plugins automatically upgrade themselves, depends on the theme, but is it true for core themes?
I am planning to create a website which is basically all ...
0
votes
1
answer
40
views
the_author() str_replace error
I Am Using WordPress 6.1 In Which I Am Calling the_author() function to get author name in single blog page. The problem is that it works properly when we call it in blog page but when I Call it in ...
1
vote
1
answer
329
views
How to get postId from the argument $block when register_block_type()?
I'm trying to register custom block type in the file functions.php of my block theme:
function render_custom_block($attributes, $content, $block) {
return $block->available_context['postId'];
}
...
2
votes
0
answers
53
views
Is there a block to print post link standalone in a block theme?
I know we can print post property (e.g. title or date) wrapped into the link to the post by using a block with the attribute "isLink":true i.e.
<!-- wp:post-title {"level":1, &...
0
votes
1
answer
174
views
.submenu class missing in output from wp_nav_menu
I Am Developing A Custom Theme. I have registered nav menus as you can see below
register_nav_menus(
[
'hub_header_menu' => __('Header Menu', 'HUB_WP'),
...
-1
votes
1
answer
637
views
My wordpress site memory exhausted more than 1GB trying to debug with default
My wordpress site memory is exhausted
[02-Nov-2022 08:41:33 UTC] PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 262144 bytes) in /home/ahzabcollections/...
1
vote
0
answers
26
views
WordPress is adding pagination for all pages not only for blog page, How to remove pagination for all pages except blog/posts page?
You know WordPress is adding pagination for all pages not only for posts page/blog page.
For example www.mysite.com, I'm getting URLs like www.mysite.com/page/15, etc.
Here, www.mysite.com has a ...
1
vote
0
answers
73
views
How do I add new layout width options in Wordpress editor?
How can I add new custom widths to the block alignment menu?
I have set the two inbuilt ones in my theme.json, but how do I add more? Eg. narrowSize etc.
{
"settings": {
"...
1
vote
1
answer
87
views
DIV containing iframe disappears below break point of 992 in Oxygen Builder
I have a dynamic CSS grid using a repeater in Oxygen Builder that displays a mix of images and videos from an ACF repeater.
I have used the following CSS which works fine up to 992px.
.embed-...