Skip to main content

Unanswered Questions

1,006 questions with no answers
5 votes
0 answers
614 views

How to support Lazy Loading Assets in a WordPress Theme?

I'm using the create-block module provided in Gutenberg Core to build my custom blocks within a plugin. It works great, but I'm struggling to figure out how to conditionally load the assets on the ...
3 votes
0 answers
74 views

Registering a block in "My Patterns"

I have created a bunch of blocks, and every time I have saved it as a pattern by selecting the block in the list view > three dots > Create pattern. All these patterns appeared in a new category ...
3 votes
0 answers
105 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 ...
3 votes
0 answers
193 views

Is there a way to prevent wp_head from outputting self-closing tags?

I'm a beginner in WP development, so maybe I'm missing something obvious. Is there a way to prevent wp_head from outputting self-closing tags? Here are two example lines taken from my website: <...
3 votes
0 answers
695 views

Gutenberg text field validation

I have been searching for ages but can't seem to find an exact method on how to perform text input validation when building custom blocks. I saw that for TextControl inputs you can just pass the ...
3 votes
0 answers
82 views

Can I customize any WordPress parent block-based theme template files by child theme like a parent classic theme?

Usually, I can replace the template files and PHP codes of any parent classic theme with child themes. Since block-based theme templates rely on HTML, how can I replace parent block-based theme files ...
3 votes
0 answers
1k views

Wordpress Block Theme: Customize meta viewport

I am building a custom Block theme and I need to have this meta viewport in my <head> : <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, ...
3 votes
0 answers
2k views

Changing order title and featured image in blog post (Astra theme)

The HTML of a post type, I want to swap the position of the title and the thumbnail. I noticed that the title and thumbnail are inside a <header> tag. So I went looking which template file has ...
3 votes
0 answers
386 views

WordPress Customizer Control with React

I am just doing a demo on the WordPress customizer API to edit the header with custom controls. I have designed a custom control by extending WP_Customize_Control and Jquery to refresh/postMessage ...
3 votes
0 answers
1k views

Add Product categories to Wordpress menu without losing hierarchy

I need to add product categories to Wordpress menu, but when I'm doing this with WP interface it lose the hierarchy I tried with WP-CLI, but there is no method to specify wich item is the child. ...
3 votes
0 answers
2k views

Add a theme via symlink

I want to keep my theme files separate from my WordPress install. I’ve done that by symlinking the theme directory to the WordPress wp-content/themes directory. Unfortunately, the theme won’t show up ...
3 votes
0 answers
1k views

Create Custom Post Type Archive Page with Sub Categories Navigation Sidebar

I have 8 custom post types (which are actually for 8 different blogs and used as "blog landing pages"). Each custom post type is also a Blog Category and each has several sub categories to it. For ...
3 votes
0 answers
1k views

How to add ID and class in nav menu walker?

I would like to set up a custom walker that produces the following output: <div id="navbarHolder"> <div id="navbar"> <ul> <li><a id="nav_about" ...
3 votes
0 answers
1k views

wp_nav_menu custom walker - child items

I have written a custom walker to integrate a jQuery drop-down nav script into my WordPress template. I need to add .dropdown-link to each of my parent menu items and .dropdown-wrapper to the ...
2 votes
0 answers
80 views

How to Use Webpack with WordPress Script Modules and Enqueue a Custom Class

I am working on a WordPress project using version 6.5, which introduced support for JavaScript modules. I have a parent theme that exports a JavaScript class, and I want to import this class in a ...

15 30 50 per page
1
2 3 4 5
68