Questions tagged [theme-development]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
78 views

Problem with get_page_by_path() using with WP_Query

I get error when i use get_page_by_path() with WP_Query in a php class. I use after_switch_theme and switch_theme in that class. And while the theme is activated then everything is fine as expected. ...
0
votes
0answers
39 views

Wordpress files break if I edit them, but adding a closing PHP tag fixes it

So, I'm kind of stumped by this one, and I'm unable to find many other folks experiencing it. I'm extending the "largo" theme for a site we're getting ready to launch, and am working within the child ...
0
votes
0answers
12 views

Custom archive page pagination issue

The WP Setup I created a template, broadcast-archive-template.php, that contains code that functions as a custom post type archive page. We set the page template to the template in the WP admin to ...
3
votes
2answers
66 views

How to deploy a new theme/theme options from staging to production site

Let's say you are building a new theme on a staging site. While you were building, the production database has changed due to new user registrations/orders. So now the question becomes how do you ...
0
votes
1answer
23 views

How do I change the tagline input to textarea?

I have had looked around for a while without success. I would like to make the default tagline editor in the Wordpress admin area being rendered as <textarea></textarea> instead of <...
0
votes
1answer
16 views

What is difference between add_theme_support and Theme Customization API?

I'm interested in adding customizable features to a theme. What is the difference between the following add_theme_support(...) and Theme Customization API Are they just 2 different ways to ...
-1
votes
1answer
16 views

Using <style> tag or inline style attribute?

I have a widget in plugin that will display a list of items <li> and I'd like to add one color to those items as option (color picker)... The question here, do I throw that color as a: <...
0
votes
1answer
17 views

Get post categories

I want te make a filter based on post-categories. I'm trying to add the category-names in a data-category-attribute, but It doesn't seem to work. This is what I tried: <article id="post-<?php ...
0
votes
2answers
33 views

How to use plugin's shortcode in custom design? [closed]

This might be a beginner question, for disclaimer I'm just getting used to the WordPress templating system: I have a purchased theme installed on my working WordPress site, looking great sofar, was ...
7
votes
1answer
346 views

Can I make plugins required?

I'm developing my own Wordpress theme that I'm going to use for multiple clients. It has a Theme Options-page so I can easily customize the website every time, but I will also be using some plugins on ...
0
votes
1answer
39 views

is_rtl returns false while it should return true

I have two cases for is_rtl, one doesn't work the other does, but don't know why. Case1: doesn't work i define a variable to hold a value depending on is_rtl, then var_dump it within the ...
0
votes
0answers
20 views

Problem with multi checkboxes value in metabox?

I'm a beginner and I have a problem with a part of the script that I found in a post. Practically when printing the checkboxes it does it outside the table. I can't bring the content of the foreach ...
0
votes
0answers
14 views

wordpress pagination issue

because of some duplication and as i am not getting my desired result i have removed my previous questions i have asked about pagination issue , i am posting again so i might get any help . if ( ...
2
votes
1answer
36 views

How to attach different React Components to different Dom Roots using the new WP wordpress/scripts webpack/babel

Since WP now comes with webpack/babel build baked into core it is so easy to integrated React in WP. I am working on a theme and created my React Blog Page to list all of my posts. Works perfectly! ...
0
votes
1answer
24 views

Include Minit plugin in theme [closed]

I'm trying to include the Minit plugin in the inc folder of my WordPress theme and calling it in my functions.php file: require get_template_directory() . '/inc/minit-master/minit.php'; However, ...
1
vote
3answers
58 views

Wordpress Theme Development: How to redirect templates the right way?

I'm developing a theme for WordPress. I have a doubt about templates redirect. For example, I have a theme that have the front-page.php template and I don't use the index.php template. What I should ...
0
votes
0answers
34 views

Cannot save with wp_dropdown_pages() in page options

I don't understand why, the custom select option works, but even when wp_dropdown_pages() is outputting the same exact HTML, it doesn't save as the select option does! I'm out of ideas :( Here's my ...
-1
votes
1answer
18 views

How to create more templates to the same theme?

Some theme contains more than one templates to chose in Page editor. What is this called? How can I register more templates to my theme?
1
vote
1answer
68 views

I want to get the home root path

I have created a file for ajax in theme/mytheme/ajax-form.php and there was an error while using this code: $db_result = $wpdb->get_results( 'select * from batch_number' ); Error: get_result is ...
0
votes
0answers
29 views

the_content() is getting null in Preview Debug

I'm not able to edit Page (post-type: page) by Elementor, the Preview could not be loaded theme. I just created a very simple theme to test, like this: <!DOCTYPE html> <html lang="en"> &...
0
votes
0answers
96 views

Kirki inline styles with Understrap theme

I am using Kirki and it’s ‘output’ argument for typography, background and color control fields. I am using Kirki in the Understrap theme and the theme uses gulp and SCSS. I also wanted to use ...
0
votes
0answers
149 views

Infinite scroll without plugin using ajax

I've created an infinite scroll without using any plugin to achieve the objective. The problem is that the bootstrap masonry cards grid are loading all the posts cards at the first scroll or will load ...
1
vote
2answers
40 views

Add dynamic links in WordPress custom theme

I want to implement a system to insert custom links in my wordpress custom theme. I don't want to hardcode these links inside my theme. These links are for the socials or partners website. So they ...
0
votes
1answer
68 views

wp_nav_menu not working correctly in my underscores theme

I'm using a theme based on underscores, and I have registered my menus in the following way. function register_my_menu() { register_nav_menus( array( 'primary' => esc_html__( 'Primary' ...
0
votes
0answers
12 views

Custom wordpress theme with modular components/widgets

I am new to wordpress and I'm in the process of developing a wordpress theme. I was wondering if it is possible for the user to specify what components they want for a particular page. A component ...
0
votes
1answer
19 views

Can I have two files with same name but different directory?

I'm developing a theme where home page is organized in sections & made template parts for each one of them. like: hero-home.php, featured-home.php Now the customizer settings for those sections ...
0
votes
0answers
30 views

Put CSS Content inside tag <style amp-custom> for Wordpress

I just want to put the CSS's content inside tag <style amp-custom> This is my action inside function function amp_template_add_styles() { $stylesheets = get_template_directory_uri() . '/...
1
vote
1answer
178 views

Do I need normalize.css when developing my own Wordpress-theme?

I'm developing my own Wordpress theme and I'm trying to make it as light as possible. I started from the Underscores starter theme, but they use normalize.css to reset the styles. Is it necessary to ...
2
votes
1answer
146 views

How to add Font Awesome 5 icons in WP Admin dashboard menu?

If you are currently using or looking to start using Font Awesome in your theme to get icons for your dashboard menu, but the icons you are wanting to use are in Font Awesome 5 and the version 4 ...
1
vote
0answers
15 views

Bootstrap card columns change images size

I have a bootstrao masonry grid made using the card columns technique. The images that will be part of the grid are all of the same size and this will not give the desired masonry like effect when the ...
-1
votes
1answer
111 views

using wordpress without javascript

is it possible to develop a wordpress theme with 0% javascript code if you are wondering why, I need to make a blog on TOR network and as you may know TOR browser doesn't support javascript is that ...
0
votes
0answers
59 views

Is there a way to add classes to a page when using a Gutenberg reusable block as page layout?

I want to make some page layouts with the Gutenberg page builder so I can reuse them as sort of page templates. An example: banner image on top of the page main title under the banner 3 rows with ...
0
votes
0answers
53 views

Duplicate automatic website theme

I have a question about the multisite. I will consider a default theme for sites that users create. My question is; how when regester a subsite by user, site is created with the template and the demo ...
0
votes
0answers
51 views

Pages not displaying as sections on static page

I'm currently working on the Twenty-Nineteen theme. I'm trying to make each "page" display as a section on my homepage. This has worked in previous themes (i.e. Twenty Seventeen), however I'm clearly ...
0
votes
1answer
23 views

Loading issue on Chrome for my Wordpress theme

I am getting a weird loading issue on my Wordpress theme that happens on Chrome only, I've tested it on Safari and Firefox, the content gets loaded all in once, but if you scroll down the page fast on ...
0
votes
1answer
38 views

How can I show a custom WordPress menu anywhere I want on my website?

I went into Appearances > Menus and created my own menu called "default menu." Then I tried to include it in my WordPress theme, but was unsuccessful. I am trying to include it just before the footer. ...
0
votes
1answer
23 views

How to code custom special page

I'm looking for how to code custom "special" page as use many plugins. An idea is that I have in theme links to the custom special page. Then admin can chose which of his pages is the one "special" ...
0
votes
0answers
25 views

Search Results not displaying for multiple words ( more than 2 words) search

Searching for a single word works as expected. Searching for multiple words that should have returned results shows blank results. Manually changing the "+" character in the URL to "-" displays the ...
0
votes
0answers
11 views

How might I display the childless and the children of a custom taxonomy separately on a taxonomy page?

The structure is simple, most posts will have only one category but some might be in a child of that category. I want to display the ones without a child category first, and then all the posts ...
0
votes
0answers
5 views

How to make save for later and history read for logged in user?

I want to make a feature like save for later widget and history list for logged in user, should I use database, jscookie, or local storage for save the data for user. And how to make it?
1
vote
1answer
125 views

“add_theme_support” for custom footer color?

I've seen theme support (add_theme_support) for "custom-header", "custom-background" and "custom-logo", but not for footer (footer colur or image). Is there no option to let users choose footer ...
0
votes
0answers
23 views

Change WooCommerce Add Product To Order Behaviour

I Want to alter the behaviour of the search function in WooCommerce order edit page, when we search a product to add into de order: Someone knows what is the name of the function that receive the ...
1
vote
1answer
20 views

What allows a template file from plugin to be copied in child theme and overridden?

In popular plugins, like WooCoommerce, a developer can copy the template files into a [child] theme to override files. I believe this is possible with Beaver Builder as well with some of their modules....
0
votes
1answer
32 views

How can I measure CPU and RAM used by my theme or plugin

I have produced a few plugins for WordPress, but other than generating errors, I don´t have a way to tell if my plugin is doing things right. How can I tell the ammount of CPU time and RAM my ...
1
vote
2answers
89 views

Disable front-page.php template

I use front-page.php on my template to display home page. But I want to disable if the user uses another page for the home page from settings. Is there a solution? When user select a page from ...
0
votes
1answer
50 views

Reason to add a name of the theme like ('menu-1' => __( 'Primary', 'twentynineteen' ),) in PHP?

Sorry for this novice question. I'd like to know why WordPress themes add their theme names many occasions in PHP files (e.g. where 'twentynineteen' is repeated below, this is from functions.php in ...
0
votes
0answers
12 views

How to Select post parent for CPT from another post type?

I'm developing a Sports website, covering cricket football, etc. The goal is: .pk /cricket (Landing page) .pk /cricket/ipl (IPL Landing Page) .pk /cricket/ipl/year (IPL Landing Page by ...
0
votes
1answer
26 views

How to properly add and access a JavaScript file in Wordpress?

I intend to use a JavaScript library on my WP website and have uploaded the JS file via FTP to the following directory belonging to the currently activated theme Salient: /public_html/wp-content/...
-1
votes
1answer
35 views

Bootstrap isn't called into my Wordpress theme

I keep getting an error when I look into my page resource about my bootstrap.min.css file, which gives me a "Failed to load resource: the server responded with a status of 404 (Not Found)" => http://...
0
votes
0answers
34 views

REQUIRED: The theme uses the register_post_type() function, which is plugin-territory

I am developing a car rental theme, but I encountered a big problem, when I upload the theme I get the "REQUIRED: The theme uses the register_post_type() function, which is plugin-territory" the ...