Questions tagged [theme-development]

Themes create the public (front-end) interface for a WordPress site.

Filter by
Sorted by
Tagged with
0 votes
0 answers
17 views

Trying to create a cutom query with pagination and page 2 breaking. Any help?

This is what I have tried so far: <?php /* Template Name: Archive-posts */ ?> <?php get_header(); ?> <main id="primary" class="site-main"> <div class=&...
Ivan Bezerra's user avatar
0 votes
1 answer
13 views

Where to find the category page in Bosa Theme

I have a WP site based on the Bosa Restaurant Cafe theme. I gave fully customized it by editing the php files, since it is easier for me to edit the files becaues the customizer don't have many ...
Adam Basha's user avatar
0 votes
1 answer
13 views

WooCommerce custom add to cart buttons does not add products to cart if you're logged out

I'm actually doing custom template for my client. My client want to have few specific products to show with their add to cart button on homepage. On internet I didn't found the answer for this ...
Martin Orešanský's user avatar
1 vote
0 answers
10 views

WP Bootstrap NavWaker: Dropdown Menu Opens All Dropdown Menus at Once

I'm having difficulty implementing a dropdown menu with Bootstrap and WordPress. I've used filters to add the 'dropdown-toggle-split' class to the link elements of menu items that have submenus. ...
Hendra's user avatar
  • 15
1 vote
0 answers
13 views

User set default settings for a Block in Site Editor

For a block I want the user to be able to set a couple of defaults for each newly generated block, think e.g colors and other attributes. Then every time a new block is created on the website, the ...
Sina's user avatar
  • 111
0 votes
0 answers
9 views

Trying to create wordpress pagination and breaking while live [duplicate]

I have been coding a pagination for my WordPress site, for a custom post query. and while it works just fine in my local machine it breaks online. I get a 404 when trying to click on page 2, while ...
Ivan Bezerra's user avatar
0 votes
0 answers
26 views

Lazy loading in my own WordPress theme

I am designing a theme for WordPress and, as I read in the official documentation, the loading="lazy" parameter is added only since WP 5.5 as long as the post images have a defined width and ...
Javi's user avatar
  • 1
0 votes
0 answers
21 views

How do I access the current post object within a block theme template or pattern?

How should I be able to query things like specific metadata or any other thing from the post object? Apparently I don't have access to basic functions like get_the_ID() or similar functions inside ...
thebigJ's user avatar
0 votes
1 answer
20 views

How to customize password reset message page on success if no error in password reset

I tried login_message filter with $_GET['action'] && resetpass but I want it on success password message page.
Wordpress developer's user avatar
0 votes
1 answer
45 views

Querying by post category slug with core/query block markup

I know how to query all posts in a certain category by slug with WP_Query. What I would like to do is the same with the core/query block markup. I am able to get it working with the category ID, but I'...
JDQ's user avatar
  • 149
0 votes
1 answer
20 views

Dropdown Toggle Split in Bootstrap Navwalker Wordpress

It's about Wordpress Theme Development. When working on a WordPress theme using Bootstrap 5, I used Bootstrap NavWalker to create a navigation bar (navbar). The dropdown feature is already built into ...
Hendra's user avatar
  • 15
0 votes
1 answer
41 views

Only show read more text when when wp:post-excerpt meets excerptLength

NOTE: The issue I'm encountering is specific to Block Themes; I understand how to filter the text returned from the_excerpt in a Classic Theme. What I would like to only show read more text when when ...
JDQ's user avatar
  • 149
0 votes
0 answers
37 views

Wordpress 6.4.2 - can't load editor style css using 'after_setup_theme' or 'admin_init' actions

My hosting company upgraded my remote Wordpress version of my site to 6.4.2 and as I mentioned in a previous ticket alot of things stopped working. One item that seems to be broken are the custom ...
Mike Sav's user avatar
  • 127
0 votes
0 answers
21 views

Why is wp_nav_menu() not removing the container around the nav <ul>?

I am trying to remove the <div> that wraps the <ul>, but when I set 'container' to false or '' the <div> still shows up. Why is it not being removed? Example with false: <nav id=&...
JayDev95's user avatar
  • 169
1 vote
1 answer
72 views

Convert base64 string to WordPress attachment uploads multiple images instead of a single one

I'm trying to convert a base64 string to an image file and upload it into WordPress media library. It seems like the code is working, but, for some reason, every time I call this function it uploads ...
benjah's user avatar
  • 111
1 vote
0 answers
19 views

WP "optimizing" PNGs into thumbnails 5X larger than originals - FIX

As I am about to add over 50,000 product photos to a site in development, I am more than concerned about the thumbnails being generated and “optimized” by WordPress. Between WordPress, Woocommerce, ...
Swapot's user avatar
  • 11
0 votes
0 answers
15 views

ACF Pro simple Business Directory - Requesting assistance with created Templates and associated Functions.php Coding

I want to replicate the basic Business Directory functionality found at this URL. We've not had any luck with off-the-shelf software and our needs are very basic. https://onetopanga.com/directory This ...
Micah K's user avatar
  • 15
0 votes
1 answer
30 views

Dashboard and Site Language only partially translated (in own theme)

I developed my own Block Theme. The default language of my Wordpress installation is English (US). If I change it to e.g. German (Switzerland), only a few words/sentences are translated in the ...
beat's user avatar
  • 33
2 votes
1 answer
98 views

Dynamic PHP content in Block Theme template file

I am still adjusting to the paradigm shift to Block Themes after being away from WordPress for some time. I understand the practical reasons for many aspects of the Block Theme, and for the shift to ...
JDQ's user avatar
  • 149
0 votes
1 answer
45 views

Gulp dev environment set up for Wordpress theme development

I am slowly learning about WordPress custom theme development. I red that many people seem to be using gulp.js to automate many tasks and I am now trying to figure out the "best" way to set ...
ghost's user avatar
  • 3
0 votes
1 answer
100 views

How do I create a single.php file as the default template for single posts in the twentytwentythree theme?

I am trying to create a single.php file to be the default template for displaying single posts in a child theme that I have created from the TwentyTwentyThree theme. The reason I want to set this as ...
Shanahando's user avatar
1 vote
0 answers
49 views

Use PHP variable defined in parent file in included pattern (WordPress Block Theme)

I am developing a custom Block Theme based off of the Twenty Twenty-Four Theme. It has been a long time since I have developed a custom theme, so Block Themes are new to me. I'm still reluctant to use ...
JDQ's user avatar
  • 149
1 vote
0 answers
21 views

get_theme_mode & set_theme_mode in block editor

Background: I'm transitioning from a traditional theme to a block theme. Previously, I used customize_register to store theme data like footer credits, social links, etc. and retrieve them using ...
e-lab innovations's user avatar
0 votes
1 answer
201 views

Twenty Twenty-Four Theme, where to put the personalized CSS style rules?

With this new theme there seem to be no way to write CSS style rules that work. CSS style files aren't loaded. and I find no space to modify CSS directly when editing the pages. But the "blocks&...
DavidTaubmann's user avatar
0 votes
0 answers
20 views

Get a custom post type's taxonomy type term names displayed as checkboxes and filter

I using this code to get all the taxonomies associated with a custom post type "newsroom" $post_type = 'newsroom'; // Get taxonomies associated with the custom post type $taxonomies = ...
Justin's user avatar
  • 101
0 votes
0 answers
32 views

filter the custom post type using wp ajax request

I want to filter the custom post type (events) using wp ajax request on behalf of the keyword supplied to it. Explanation: I have a from which has 4 fields displaying search keyword, event category (...
Manish Agarwal's user avatar
0 votes
0 answers
20 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 ...
Ehsan Aliverdi's user avatar
0 votes
0 answers
18 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 ...
glowbright77's user avatar
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 ...
John Hon's user avatar
  • 101
0 votes
0 answers
30 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 : ...
firstchoice entertainments's user avatar
0 votes
1 answer
29 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 ...
johannes_k's user avatar
0 votes
1 answer
37 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 ...
user3362364's user avatar
0 votes
1 answer
27 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 = ...
user3362364's user avatar
0 votes
1 answer
35 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 ...
Dreamyth's user avatar
0 votes
1 answer
20 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 ...
MKay's user avatar
  • 179
0 votes
0 answers
28 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 ...
ICTDEV's user avatar
  • 113
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 ...
Alvaro's user avatar
  • 131
0 votes
0 answers
23 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 ...
Erasus's user avatar
  • 101
0 votes
0 answers
81 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 ...
webthesign's user avatar
0 votes
1 answer
118 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 ...
Mateusz's user avatar
  • 155
1 vote
0 answers
27 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 ...
S. Peats's user avatar
0 votes
1 answer
29 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 ...
RogerW's user avatar
  • 1
1 vote
0 answers
14 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 ...
Alvaro's user avatar
  • 131
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 ....
Marko's user avatar
  • 1
2 votes
1 answer
199 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 ...
imagIne's user avatar
  • 53
0 votes
0 answers
41 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 ...
Naren Verma's user avatar
0 votes
0 answers
45 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 ...
Frenzy's user avatar
  • 1
0 votes
0 answers
46 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 ...
Rookie Recruits's user avatar
0 votes
0 answers
128 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. ...
Jos's user avatar
  • 101
0 votes
0 answers
18 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 ) { ...
Tian's user avatar
  • 1

1
2 3 4 5
90