Questions tagged [theme-development]
Themes create the public (front-end) interface for a WordPress site.
4,428
questions
0
votes
1
answer
1k
views
Add multiple sections, settings and controls at once to the Customizer
I am trying to make a slider configurable via the customizer. In order to let the user decide how many sliders he wants, I added a setting where the user can enter a number.
Based on this number I ...
1
vote
1
answer
641
views
Is it possible to save more than one image to an option?
The following code allows you to upload multiple images but only one is saved to the option. Can multiple images be saved to the option as an array or would I have to create separate controls?
$...
1
vote
1
answer
1k
views
How to Upload CSV Data into Custom Post Type Data with Metabox programmatically
I have a Custom Post Type called movies which had only title enabled from post support and 3 custom field of metabax as box office, year, and director like
now I have like 150 rows CSV formatted ...
0
votes
0
answers
18
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
42
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/...
1
vote
1
answer
1k
views
Wordpress shows error related to allow_url_fopen
I just installed wordpress with plugins, everything works find except on a 'contact me' page, where I can see an error like this.
Warning: getimagesize(): php_network_getaddresses: getaddrinfo
...
1
vote
1
answer
989
views
How to set the currently active page in the menu including parents
I have the following problem:
There is a custom post type. There are several pages each listing some of the posts based on some post criteria (custom WP_Query).
When I click on a link to open the ...
5
votes
3
answers
13k
views
How to get Images included in Post
is possible to get images added to a post programmatically? I am working on custom template (my first) and I need to display Images added to a post in specific way.(first image as title image and the ...
0
votes
0
answers
17
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
2
answers
2k
views
Need help with adding custom wordpress menu and sub-menu
I've got my HTML Custom Nav set up and it works fine for static template. I want to convert it into wordpress navigation menu. I am totally new to wordpress and i want help to convert html menu to ...
0
votes
2
answers
5k
views
How to output wp_enqueue_style() in HTML head instead of footer
I added some actions to wp_enqueue_scripts to load my custom css and js files in the header section by using wp_head(); right before the closing </head> tag.
function mytheme_scripts(){
// ...
0
votes
1
answer
51
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
657
views
How to display only child category post in related posts in custom post type?
I'm trying to display only those posts which are under the same category of the post which I have clicked as related posts. My custom taxonomy are like this :
Fsc year 1 => Biology => Bio chapter 1 . ...
0
votes
1
answer
58
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 ...
0
votes
1
answer
863
views
enqueue styles for only mobile wp
I tried to enqueue some styles on mobile only using wp_is_mobile() function, but it always give me true, Here is the code (From functions.php file) :
add_action('wp_enqueue_scripts','...
0
votes
2
answers
1k
views
have_posts() return false on single post
I'm a little bit confused with the use of the Loop. This is my first theme and i just use index.php currently to display all my pages. It works fine for pages but have_posts return false when i try to ...
0
votes
2
answers
2k
views
How to disable controls in theme customizer?
Edit: I have rewritten the question in hopes I will get a reply from someone who knows the theme customizer.
I am trying to figure out how to disable setting controls in the Wordpress theme ...
2
votes
1
answer
838
views
How can I get full attachment url from wp_get_attachment_metadata?
I want to get all sizes of an attachment. I can use wp_get_attachment_metadata to do this. But it only return filenames, not file urls.
How can I do this?
This is a workaround, but doesn't take ...
14
votes
5
answers
45k
views
Custom single template for a specific category
What is the best way (performance & code structure) to create a custom template for a WordPress Post, which belong to a specific category? I realized that you can’t just create single-catname.php.
...
1
vote
1
answer
665
views
How can I make my options in an array and store theme in WP options one DB row?
I am making a theme with theme options but for customization, I have completed my theme options more than half. Suddenly I have triggered one problem and that is I have checked my wp_options DB I have ...
0
votes
1
answer
21
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-...
0
votes
1
answer
851
views
How to use posts as tabs in a custom page?
everyone. I'm a beginner at coding/Wordpress and need some help with a custom page I'm developing right now. The idea is simple:
A list of items on the left
An image with a description below on the ...
1
vote
1
answer
16
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 ...
1
vote
3
answers
220
views
Theme showing incorrect update
We have a totally custom theme that we have built in house, recently the WordPress updater has started saying the theme is out of date.
When I investigated this supposed update it links me to a ...
1
vote
1
answer
737
views
Template selection area is not visible on page editor sidebar in wordpress twentty sixteen default theme
Template selection area is not visible on page editor sidebar in wordpress twentty sixteen default theme
<?php
/**
* Template Name:Zoho testAPI
*
*
*
*
*/
echo phpinfo();
?>
0
votes
1
answer
1k
views
Display content on Single page
I am building a single page theme, And I am having a problem with get_post_meta()
The Problem
This code bellow does not work, and I cannot see anything on the website as it's blank. Here is my index....
0
votes
0
answers
19
views
Add text when displying attribute with a hook on single product page
I have books as products in woocommerce and I'm trying to show the order of the book in the series. It should look something like this:
"The book 1 of Series"
I've managed to add the link to ...
0
votes
1
answer
780
views
Fatal error: Class WP_Customize_Image_Control not found
I'm using WAMP on Windows 8.1 64 bits to develop a custom theme.
Right now, I'm getting the following errors when trying to create a custom control with the WP_Customize_Image_Control class:
Fatal ...
3
votes
2
answers
963
views
Cache Busting using htaccess Rewrite rule?
I am trying to follow this tutorial that says i can make a server to send a file like style.css if the requested file is style.15458888.css with a rewrite rule to be put inside the htaccess file.
...
0
votes
2
answers
47
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
2k
views
Woocommerce Theme Reviews / Comments
Ok so i'm creating a Wordpress theme and i'm at the point where i'm trying to get a list of the reviews but the default comments_template() HTML isn't how I need it.
I don't have a /comments.php ...
0
votes
1
answer
703
views
Filter URL and shortcodes from the_excerpt
I just noticed a weird behavior on a theme I'm working on. If I have a post with just one link or shortcode, the_excerpt will print that URL or shortcode. But if I have some text in the post, below or ...
1
vote
1
answer
1k
views
Using WordPress' Theme Customizer to select page templates that update layout in the preview
I wasn't sure where to post this question..
I recently discovered WordPress' "Theme Customizer" and am using it to make the pages easier to update for clients. Rather than the standard way of editing ...
0
votes
1
answer
1k
views
How to load mediaelement.js in theme template?
I'm developing a video oriented theme. I need to include native WordPress video player in my page template. This is what I'm doing:
$video url comes from a custom field. It outputs the video file url ...
1
vote
1
answer
2k
views
Divi - How can we show background video on mobile
By default, Divi theme forcibly stops background videos from ever displaying on mobile devices. Is there a way around this, even if not all devices are supported, at least to show the mp4/webm to the ...
0
votes
2
answers
1k
views
change background image on scroll
I want to create a background image effect that will change the image when the user scroll. I'm facing a problem with the images urls, how i can fix this? How I can link an image url in jquery from a ...
0
votes
1
answer
130
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(), ...
2
votes
1
answer
2k
views
front-page.php is not Listing in Static Front Page List
I have a in my theme directory and I would like to set the WP to be static based on page. I didnt create any pages so far because my assumption was the must be listed as a page in the front page ...
0
votes
0
answers
15
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 ...
0
votes
0
answers
36
views
I am using update_option function to update theme options programatically but page needs to be refreshed many time for changes to reflect!
update_option( 'my-settings', $my_options, true );
This is updating the option but I need to refresh many times or clear cache every time for changes to reflect in frontend, is there a way for ...
1
vote
1
answer
31
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 ...
14
votes
3
answers
78k
views
The proper way to include/require PHP files in WordPress
I'm a new WordPress developer and recently I've been having problems (on multiple sites) with include_once and require_once for PHP files. If I include (get_theme_directory_uri() . 'subdir/file') the ...
0
votes
2
answers
2k
views
Bootstrap 4 mobile menu not working for Wordpress Development
I have a custom bootstrap 4 theme I am building out in wordpress. The drop down mobile menu does not work when the hamburger menu is pressed at smaller viewports. I am not sure if I need to add a ...
2
votes
1
answer
1k
views
Adding wp_enqueue_media(); causes problem
I want to add the media uploader in the theme options page. If I add following code in the options page, the media uploader works fine there, but it creates problem in the standard posts featured ...
0
votes
1
answer
1k
views
CSS loading as empty file in Custom Theme
Hello I made a custom theme and moved it from MAMP to a cloud server. For some reason the CSS is an empty file. File path is correct, checked the file in cPanel and it has the full .css sheet. But ...
0
votes
0
answers
10
views
Getting error when accessing Customizer Page
i get this error when i try to access my multisite customizer page.I tried to see what it was, i thought it was a plugin conflict, but i think its something else, i guess
Fatal error: Uncaught ...
0
votes
1
answer
2k
views
Check if redirected from a specific page template
I have a page template, which redirects to the homepage using this:
wp_redirect( home_url() );
Now, on the homepage is it possible to check if it has been redirected from a specific page template ...
1
vote
1
answer
37
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
2
answers
2k
views
creating a custom post template
I want to customize my individual posts. I have an example of what I'm trying to achieve below. Would I make a custom post template for this? If so how would I do this? Or should I add to my single....
0
votes
2
answers
1k
views
WordPress Customizer Help with FontAwesome Icon
Here's the scenario - I want to select fontawesome icons from the dropdown list but it's not working. For some reason the class inside span is not adding up (I have tried jQuery().append(), CSS) but ...