Questions tagged [theme-development]

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

0
votes
0answers
2 views

WordPress wp_get_current_user returning blank values until refresh

I'm developing a site in WordPress and creating my own theme. As part of the theme, I have a custom user login. When a user logs in, the form action directs back to itself and in the header of the ...
-1
votes
0answers
11 views

Wordpress theme similar to Airbnb [on hold]

I want to build a website in wordpress that has similar functionalities to airbnb (availabilities, bookings, direct messaging, commision for each transaction done between the users). Is there a ...
0
votes
2answers
13 views

Error Handling when building Wordpress themes

I'm very new to the developing world and have been, with the help of Youtube, been learning to design Wordpress themes with HTML, CSS and PHP. I am using MAMP to locally host my wordpress site. When ...
0
votes
0answers
11 views

I need Slider Advice [on hold]

Can you give me slider that could be easly include in themes which are for trade ( if it is free,if buyer see premium adverts, it is not problem)advice? i dont know how to include popular sliders ...
0
votes
0answers
19 views

WordPress Starter Content: can't access the created posts

I'm having a big pain with starter content feature of Wordpress. At the moment I'm using the hook customize_save_after to get the posts, using the normal function I use to get posts get_posts. It's ...
0
votes
1answer
22 views

How save ContactForm7 data in a cookie

I am developing a WordPress theme that has a custom post type called 'Insights'. Then in single-insights.php the administrator can upload a PDF file so that the user can download it by clicking on a ...
0
votes
1answer
30 views

Proper use of Output Buffer for a whole php clas

For my ajax popup login i want to use Output Buffer for a whole oop php class. I just want to start buffering from the start of class and end it when the class is finished. class Wp_Ajax_Popup_Login {...
0
votes
1answer
20 views

use a single nonce in three different nonce field

i want to use a single nonce in three different form (login, register, lost password). But I am not sure how to use nonce in wp_localize_script( $handle, $object_name, array() ). In here $handle ...
0
votes
1answer
40 views

the_content() not displaying description correctly

I'm trying to display a description of a WooCommerce single product, but the instead of displaying the correct description, the loop starts over again displaying the image, price, add to cart etc. I'...
0
votes
1answer
16 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 ...
0
votes
1answer
21 views

Templates without a loop, best practice?

I'm working with a custom theme that someone else created, and it's becoming obvious the author(s) were not familiar with WordPress. I'm doing cleanup and I'm just finding all sorts of bad things. ...
0
votes
1answer
10 views

Disqus comment system not show

I've installed the disqus comment system plugin. I need some help to use it, I'm not able to display the comment box inside my post or pages. I'm using a custom theme, and there is no a comment.php ...
1
vote
1answer
25 views

Get a setting value conditionally in the Customizer api

I'm doing this the normal way, instead of refresh I edit the element with JS according to the user selection, but in one case, I need a value that depends on another value and I can't get that. Here'...
0
votes
1answer
33 views

Import/Export WordPress demo

We are a team of developers who are beginning to publish our theme on Themeforest. We are facing an issue in presenting the demo of our theme and wanted to seek your help. Whenever we try to export ...
1
vote
1answer
26 views

Theme Development: Starter Content after hook

I'm making a Wordpress theme that generate placeholder menus using the theme support "starter content". I read the documentation and is very vague: https://make.wordpress.org/core/2016/11/30/starter-...
0
votes
0answers
15 views

Custom theme index layout not displayed correctly

I'm making a custom theme that I'm planning to sell. I'm reading some guides about themes creation, I have already experience with wordpress but this time I want to make a nice theme. I'm facing a ...
0
votes
2answers
30 views

Warning: count(): syntax problem of the count () function

I'm trying to repair a function that was working properly before going to php 7.2. The error comes from the count () function but I do not know how to rewrite it. Can you help me ? Here is the error ...
2
votes
4answers
81 views

Getting the wrong page ID

I am developing a theme and I need to get the actual page ID, when I do: global $post; $thePostID = $post->ID; I get the wrong ID. I tried get_the_ID() and I get the same ID that in the code ...
0
votes
1answer
17 views

customize theme with get_template_part() [closed]

I'm often using the get_template_part() function. I read the theme handbook about this function and the codex, but I'm not sure when this function can be useful. For example I've made some modular ...
0
votes
1answer
11 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
36 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
9 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
59 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
16 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
12 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
13 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
29 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 ...
-1
votes
0answers
18 views

React Error “Target container is not a DOM element” [closed]

This is my first time working with the WordPress build/scripts package which allows us to build our ESNext and React JS code without having to struggle with setting up Webpack yourself. I am building ...
5
votes
1answer
324 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
0answers
21 views

i want to know is there any builtin way of ajax pagination [closed]

I have searched alot and comllete my task also but i really want to know is there any "builtin" features or way to make ajax pagination in wordpress index.php file or static homepage etc
0
votes
1answer
18 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
19 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
13 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
26 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! ...
-1
votes
0answers
9 views

set_query_var form wordpress dashboard

I'm working with template part to build a custom theme. I'm using the set_query_var() and get_query_var() functions to set some queries to get part of the contents that are present inside my templates ...
0
votes
1answer
20 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
43 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
32 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
48 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
38 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
56 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
36 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
39 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
10 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
17 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
24 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
83 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 ...