Questions tagged [theme-development]
Themes create the public (front-end) interface for a WordPress site.
4,367
questions
1
vote
0
answers
35
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 ...
0
votes
1
answer
16
views
Why Wordpress AJAX returns undefined however it works fine when I add static url instead of dynamic function?
Code from functions.php
function university_files()
{
wp_localize_script('main-university-js', 'universityData', array(
'root-url' => get_site_url()
));
};
add_action('...
0
votes
1
answer
13
views
Wordpress giving me the index
i'm having a problem and i can't seem to figure out how to solve it. I'm just beginning to develop custom themes in wordpress and i wanted to create the custom template for portfolio and a single page ...
0
votes
0
answers
9
views
Using Learndash or other plugin templates in Timber based theme [closed]
I've seen some discussion on the topic of how to use Timber in plugin templates. But this is not my question. I use Learndash to sell courses. Learndash has a lot of templates and assets included that ...
0
votes
0
answers
19
views
Change default rel attributes for Image Block & Button Block
currently inside the Gutenberg editor, if I add an image and then click on the link icon to hyperlink that image to some external URL, after adding the URL if I turn on the Open in New Tab toggle, it ...
0
votes
0
answers
14
views
Not Able to Add New Class To CPT Attachment Image
Testing against WordPress 6.0 and using Codex, get_image_tag_class filter to remove all existing default classes and add new class img-fluid is not working
Here is the code that I am using in ...
0
votes
1
answer
33
views
Displaying images outside the content
I am trying to achieve to following design:
This is what I got so far:
I'd like to have the bottom images as in my design example.
This is, how my single.php looks like. I just can't find a solution ...
0
votes
0
answers
12
views
How to set a custom URL for the iframe in the customize page
I am using Wordpress as a headless cms. The frontend won't load on the customize page, it is just completely blank and the title just says "Loading...".
Is it possible to show the frontend(...
0
votes
0
answers
16
views
Related Post Category Filter
How can I set a category filter for the related posts display so that a certain category is not displayed?
here is an example link: https://bit.ly/3zNSoso
the category with the id 390 should be hidden
0
votes
0
answers
9
views
Change modified date to current date when title updated automatically
I use shortcode in title for everyday date (1 Aug 2022), so daily the title has been modified because of date change but modified date is not updated every time when title modified. How to update ...
0
votes
1
answer
16
views
WP Still Generating 150x150 Thumbnail Size Even After Un-Setting Small Size in Functions.php
I am using following code to prevent WordPress from creating some un required image sizes for my theme and only upload the original size
add_filter( 'intermediate_image_sizes_advanced', '...
0
votes
0
answers
6
views
how to add a badge on product based on filter?
i want to make a compatibility badge based on the user filter, basically its an autoparts wordpress shop and i need the user to choose their car first and then save it for future (it's like a filter ...
0
votes
0
answers
11
views
WooCommerce shared categories
I am working on a WooCommerce site where different electronics products are sold. A Product can be either a used or a new product. There are different categories e.g. Refrigerator, Freezer, Microwave ...
0
votes
0
answers
27
views
Why does website stretch and white space on load? [duplicate]
On loading my friends website is stretching and has a white space. Does anyone know what is causing the white space and stretch on load ?
https://bit.ly/treesurgeons
0
votes
0
answers
10
views
How to change a local wordpress installation xml export file urls? and change them to what if you don't have a live website?
This is my first time developing a Wordpress theme and i have created some demo content on a local installation. I need to make a xml file available for theme users to import it to their new ...
0
votes
2
answers
32
views
ACF get_sub_field ALT TAG in the repeater doesn't show
I have one problem. I can't get the alt tag inside me repeater fields in ACF, I've tried multiple methods and nothing works for me, could you please help me? I can't fix this problem for a week :(
...
-2
votes
0
answers
10
views
Adding feature image to the sidebar -
I am currently doing some testing of themes using a test theme and a staging site URL
I am trying to find a way to make the feature image show as the first sidebar object " Just above the social ...
0
votes
0
answers
21
views
Pagination don't work with active filters
I'm make a custom theme para Wordpress and all works fine except the pagination when the filters are active. The console return 400 error and the navigation show /wp-admin/admin-ajax.php?paged=2
The ...
1
vote
1
answer
87
views
What is the purpose of a companion plugin
I have run into several themes, that clients have chosen, that have "companion plugins." These plugins have to be installed as a separate step after the theme is installed. What is the ...
0
votes
1
answer
14
views
Localize script not working in ajax
I'm getting the error "Uncaught ReferenceError: WPURLS is not defined" when I try to use ajax. Have I done something wrong here? Running the localize script after the script.min.js file, is ...
0
votes
0
answers
8
views
Cart displayed above header
i'm new to wordpress and I can't figure out why when I add product to my cart, the header goes down
Here is the website : https://portfolio.isekaibrand.com/
I don't see where to change that, i'm using ...
0
votes
0
answers
30
views
WordPress redirects page query parameter in URL
I am trying to create pagination in my theme. Everything is ok except when I click on pagination buttons for example [example.com/blog/?page=2] it will redirect to example.com/blog, but it's ok for ...
0
votes
0
answers
20
views
Remove Custom Post Category In Wordpress Slug Using .Htaccess
I am battling for days now to remove a custom post slug from Wordpress permalink.
My theme Category permalink looks like this: example.com/listing-category/category
I want to get rid of the custom ...
1
vote
1
answer
47
views
Full documentation about $args for register_rest_route?
I'm currently setting up a WP REST API, and the tool is really impressive and the amount of possibilities vast. I would however really love it to have a full documentation listing all of the possible ...
2
votes
3
answers
109
views
Validate and Sanitize WP REST API Request using WP JSON Schema?
I'm currently setting up my first WP REST API and am attempting to understand how WP implements JSON Schema for the API endpoints, and the docs are imho really poor and confusing; so I wanted to make ...
1
vote
0
answers
22
views
Gutenberg theme development: how to add "headers" option under styles > colors > elements?
I'm not sure if this is even possible as I'm still learning about Gutenberg full site editing theme development. I've done my best to research this and read over the documentation before asking this ...
0
votes
1
answer
19
views
Seperate plugin and theme files
I am in desperate need of help, regarding the following issue:
I need to establish an API Connection to Salesforce, so that a user can search and retrieve certain data out of Salesforce.
I thought, ...
0
votes
0
answers
7
views
Xamp installed local wordpress not allowing to publish or install plugin
I installed wordpress locally with xamp on my pc (Macbook pro Apple silicon 2021), yesterday I could normaly install a plugin (starter template) but today if I try to install a plugin it says at first ...
0
votes
1
answer
14
views
How to Enable Ascending or Descending In WordPress Default Built-in Loop
Can someone please let me know how we can add Order functionality to WordPress Built-in Loop?
<?php
if (have_posts()) {
while (have_posts()) {
the_post();
// Post Content ...
0
votes
1
answer
21
views
Wordpress get_media_embedded
test text
<div class="video">
<?php
$media = get_media_embedded_in_content( apply_filters( 'the_content', get_the_content() ));
print_r($media);
...
0
votes
1
answer
20
views
Can I make a Customizer dropdown-pages list include private pages?
I'm using the following code to add a field to the Customizer where the user can select a page from the available pages on the site:
$wp_customize->add_control( 'resources_page', array(
'type' =...
2
votes
0
answers
36
views
Hide categories that are not used in the post type
I have a situation where I need to display categories on the Archive Page of CPTs, but if the category is not used anywhere in the CPT, it needs to be excluded from the list.
For example, I have a CPT ...
2
votes
1
answer
41
views
What VSCode extensions are there for working with block themes? [closed]
I recently took another dive into Wordpress block themes by looking at the TwentyTwentyTwo theme. I'm noticing that all templating seems to take place either in PHP strings or HTML files chalked full ...
0
votes
1
answer
150
views
Wordpress 6.x / PHP 8.x deprecated warnings in development environment
The problem:
I want to run Wordpress 6.x with PHP 8.x in development mode - meaning define('WP_DEBUG', true); but Wordpress 6.x partial support for PHP 8.x throws a lot of deprecated warnings which do ...
1
vote
1
answer
43
views
What is the "correct" way to add hooks or similar PHP behavior to a blocktheme?
I'm building a new site and I wanted to build my theme from scratch. However, the WordPress ecosystem is moving more towards blocks and blockthemes. As far as I can tell, it is possible to put hooks (...
1
vote
1
answer
30
views
Alias to theme folder for local development
I am locally developing a parent theme and child themes simultaneously (perhaps not best practice, but...). It looks something like this:
parent.local
/wp-content/themes/parent-theme/
child1.local
...
0
votes
1
answer
18
views
How to get authors who have added the post in the specific custom post type
I have a custom post called event and I have to show all the authors who have added the post. I have tried the below code but I am getting all the users on the page.
For example. There are 4 users ...
0
votes
1
answer
25
views
For some time, some of my pages do not display the content anymore. Any idea where this could be coming from?
I recently worked on this website : https://semaine.com/
But since some time the content of the pages https://semaine.com/classroom/ and https://semaine.com/cinema/ are not displayed anymore.
The ...
0
votes
1
answer
25
views
How to allow certain PHP functions when using sanitize_callback in the word press customizer
Hi I am making my own theme in WordPress and setting up some customizer options and I have one for the text in my footer but I would like to still use <? echo date('Y');?> in the footer to ...
0
votes
1
answer
50
views
registering a global template wordpress 6.0
<?php
/*
* Template Name : Amaizing Inner Page 1 Template from me*
* @package WordPress
* @subpackage CADENTIC® BUSINESS THEME
* @since MY BUSINESS THEME 0.0.1
*/...
0
votes
0
answers
23
views
Getting text from custom field from customizer
So I've created a panel in the customizer section in WordPress to add the phone number to the site.
It works fine in the back end but it wont show up in the front end
here is my functions.php
...
0
votes
0
answers
27
views
enqueuing external and internal js and css in wordpress did not work with owl.js animate.css
<?php
function cadentic_files () {
wp_enqueue_script('cadentic_owl_carousel',get_theme_file_uri('js/owl.carousel.min.js'), array('jquery'), time(), true );
wp_enqueue_script('...
0
votes
1
answer
27
views
I don't think WordPress is loading jquery or bootstrap js
I'm building a WordPress theme and I've used the code from https://codeinhouse.com/how-to-create-custom-post-type-slider-in-wordpress-without-plugin/ to build my slider I've also used https://github....
0
votes
1
answer
21
views
WordPress navigation wont appear with wp_head
so im building a custom theme and ive got stuck on the navigation
if i use wp_head(); it loads bootstrap and my custom style sheet but not the navigation
if i use get_header(); it loads the navigation ...
0
votes
0
answers
72
views
get_the_terms() returning wrong results inside of loop
When I use get_the_terms() inside a loop, the whole thing behaves very strangely. Sometimes the terms are included twice or three times and sometimes a post inside of the loop returns only false.
I ...
0
votes
0
answers
20
views
How do you remove header sitewide from mobile only?
I'm having trouble hiding my header on mobile devices. My wordpress theme does not have an option to hide it, so I was looking at the theme's header.php file if there was anything I could add to it. ...
0
votes
0
answers
38
views
WordPress custom menu can't show 3. level submenu
I Use a custom walker from my menu in WordPress and my menu doesn't show all levels.
https://soulofcroatia.com/ ->One Day menu item.
This is my code in header.php
<?php
...
0
votes
1
answer
56
views
How do I get the trackback count of a post in wordpress without writing an SQL query?
How do I get the trackback count of a post in wordpress without writing an SQL query?
I tried searching Brave Search and I couldn't find anything helpful. To fetch the amount of comments a post has, ...
0
votes
1
answer
22
views
Post and page content not displaying in search results
I am using a content-search.php template part to output my search results. The post/page titles and links to those posts/pages are working correctly, but for some reason the the_content() function is ...
0
votes
0
answers
58
views
Adding google fonts to WordPress theme
I am trying to add google fonts to a custom WordPress theme. Therefore I tried to enqueue selected three font faces at once to make it fast loading. So, I use the below codes to register and enqueue ...