Questions tagged [theme-development]

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

2
votes
0answers
620 views

unzip a folder on specific location and delete the zip file

After the lots of search. I am deciding to post my question here. Basically i want to upload a zip file in my wordpress site from my admin panel. And also extract this file to specific location with ...
2
votes
0answers
987 views

Overwrite Parent Theme add_image_size in Child Theme

I'm using a child theme of a parent theme. Now on my parent theme, theveloper adds some custom image sizes like this - if ( function_exists( 'add_image_size' ) ) { add_image_size( '...
2
votes
0answers
47 views

Theme unit test data Foreign fonts come in garbled on my machine

Having just tried out the Theme Unit Test Data from the WordPress.org Codex, I noticed that some of the body text doesn't import properly on my set up which is a Mac running Mavericks. The effect is ...
2
votes
0answers
81 views

gallery option is not available in media upload box in costum theme option page

I am creating a theme in which I have to create a sponsor's image gallery on the admin panel in theme option page. It's a slide show on the front panel. For this, I followed a tutorial to create a ...
1
vote
0answers
14 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
vote
0answers
22 views

How can I use $wp_query->tax_query as tax_query parameter for a new WP_Query instatiation?

I am trying to use $wp_query->tax_query right out of the box as tax_query parameter, however I cannot work this out. The parameters for my new WP_Query is actually the same as the default query of the ...
1
vote
0answers
19 views

Underscores Theme Unit Testing - Catching Untitled Posts

Wordpress 5.0.3 | Underscores Theme I'm unit testing a theme I based on underscores using the wptest.io xml. Underscores does not gracefully catch untitled posts. There is no title in either ...
1
vote
0answers
106 views

How do you replace content generated by custom fields with custom blocks in Block Editor?

I am wanting to support the new Block Editor for a theme that I made for a client. However, one of the page types has part of the theme that is displayed depending on whether custom fields are set ...
1
vote
0answers
13 views

How to display all subpages and short by year

How can I display all child-pages and short by year in Wordpress For example: all subpages in 2016, 2017, 2018: • 2018: ----- Subpage A ----- Subpage B ----- Subpage C • 2017: ----- ...
1
vote
0answers
69 views

How do i define the location of a git push to WP Engine

Ive been using Gits version control system for local theme development on a Wordpress site. I decided to take advantage of WPEngine's git capabilities which has caused more frustration than not. I ...
1
vote
0answers
18 views

WP_Comment_Query - Get comments and answers separately

I was developing a theme and this time I chose to use the bootstrap4, I found some difficulties in the way but I managed to solve them and the result was satisfactory, however creating my comments.php ...
1
vote
0answers
188 views

populate form fields in a loop with ajax

The first row only works in my row. <?PHP for ($i = 1; $i <= 20; $i++){ ?> <div id="lines" class="row"> <div class="col-sm-1" style="text-align:left;...
1
vote
0answers
109 views

Customizer: active_callback and sanitize_callback incompatibility?

Below are a few Customizer controls I have for my site logo - Display Logo, Logo File and Logo Size. As you can see, I'm using an active_callback so that when the display_logo checkbox is unchecked, ...
1
vote
0answers
178 views

excerpt() shows different result between remote and localhost(development environment)

Something strange when I am developing my own theme. Not sure what have I changed recently, but the the_excerpt() or get_the_excerpt() started to show full text on my localhost dev environment, while ...
1
vote
0answers
34 views

Disabling Customizer Selective Refresh shortcut icons for selected controls

Sometimes, on using the selective refresh feature, the shortcut looks little meaningless when an element is sort of removed from the view. For example, if I remove the custom logo and replace it ...
1
vote
0answers
28 views

JavaScript stops working on selectively refreshed sections one inside the other

I have two sections, a header and a logo in my theme. The logo is inside the header. A control in the customizer is responsible to handle the alignment of the header through selective refreshing. I ...
1
vote
0answers
38 views

How to change the post type a theme shows by default?

I have a theme that displays the normal post_type post, but want it to take the post from my custom post type my_posts_custom. I don't want to make this change manually on the theme. Are there any ...
1
vote
0answers
258 views

Fetch wordpress video attachment with post ID

So I have wasted 5 hours of my life to figure how to fetch wordpress custom post videos and been unsuccessful and here i am. Looking for expert advice. My Requirement: - Fetch all video attachments ...
1
vote
0answers
425 views

Best choice of options/settings framework for plugin/theme development

My question is what is the best options/settings framework out there now to safely build custom plugin/theme upon? I found the similar question here, but it was asked 7 years ago and definitely, ...
1
vote
0answers
426 views

How to export post meta with images in wordpress

Hi i have a custom post type in my two websites and i have to to export all posts in that post type and import to second site . So my post type is "products" . Actually i can use wordpress default ...
1
vote
0answers
33 views

Calling post_exists() causes white screen in after_setup_theme

My theme is executing code in response to the after_setup_theme action. My code uses the function post_exists and when I use this function I am getting the 'white screen of death'. I have debugging on ...
1
vote
0answers
94 views

Password field is empty when using wp_signon();

I'm trying to make a custom login action for my custom login page. Registration page with custom user meta works fine, but the problem with login page is that everything should work, but it doesn't ...
1
vote
0answers
18 views

Making sure that a plugin's scripts and stylesheets are included for dynamicaly loaded content

I'm currently making a theme that uses admin-ajax.php to dynamicaly load pages and posts. Some of this content uses plugins like final tiles gallery and Video Embed & Thumbnail Generator. If ...
1
vote
0answers
14 views

How to use format post in a pertinent way

I need to create a video post for my theme. I want to use post format via: add_theme_support( 'post-formats', array( 'video' ) ); So it is good, in my single.php I will able to get: if ( ...
1
vote
0answers
55 views

How can I fetch the WordPress cart errors normally displayed in woocommerce-error?

I'm working on adding these errors to our AJAX fragments callback, but I'm not sure what filter I need to use to fetch them. It's the errors reported by this template file: https://github.com/...
1
vote
0answers
17 views

Posting page on all subdomains

I'm just asking to see if anyone has done this or any ideas how it could be done. I have 11 Wordpress sites(on a network/multisite, 1 domain and 10 subdomains) that will grow. I'm in the process of ...
1
vote
0answers
108 views

wp_remote_get times out on api request but jquery GET and postman work?

I'm working on a project with two themes. Theme 1 contains a custom WP REST endpoint I made. Theme 2 needs to make a GET request to the endpoint. Both projects are hosted locally. When I make a ...
1
vote
0answers
26 views

In this snippet how do I force the function to use gravatar rated G and fill in the alt for get_avatar()?

$title = sprintf( '%1$s<span class="vcard">%2$s</span>', get_avatar( get_the_author_meta( 'ID' ), 75, set_url_scheme( 'https'), '', '' ),//TODO Full avatar via gravatar ...
1
vote
0answers
502 views

how can I edit flexslider in woocommerce. [Urgent]

Can anyone please tell me how I can edit flexslider settings in woocommerce. I am actually trying to get this result. http://flexslider.woothemes.com/thumbnail-slider.html someone please help me ...
1
vote
0answers
14 views

Single translation for many locales

Greetings to everyone, Is it possible to do make a single translation for many locales? Let me explain it better: Can I create a single translation file for my theme called es.po and es.mo so it ...
1
vote
0answers
108 views

page.php dependent sites are not working in custom woocommerce theme

I simply want to add woocommerce to a very lite, selfmade wp-theme. Therefore I followed the guide provided on the woocommerce website. I actually reduced the page.php to <?php get_header(); ?>...
1
vote
0answers
36 views

WordPress default theme css units

Is there a specific rule the default WordPress themes follow for CSS units? I see em's on some font sizes and rems on others and px on certain places. Referred the following links but I couldn't ...
1
vote
0answers
21 views

comment form args are not translatable (customized comment form)

I customized the comment form by changing the 'args'. Short Example: $comments_args = array( 'title_reply' => esc_html__( 'Leave a comment', 'mytheme' ), 'title_reply_to' =&...
1
vote
0answers
178 views

“Add A Widget” button in the Customizer

I'm developing a theme and working on the Customizer at the moment. I've been able to add sections, panels and controls to change text, colours and images. One thing I've seen on other themes is an "...
1
vote
0answers
149 views

Zoom on custom theme without child

I'm currently developing my own theme in WooCommerce, it's a great way to get familiar with it, and a rather fantastic plugin... I worked on a lot of aspects, including carts, but now, I'm attacking ...
1
vote
0answers
353 views

Wordpress Media Uploader in page template (On Front-end)

I've tried to use Media Uploader in a page template, so registered users can upload some images, but I'm not sure is it possible. I know I need to include some scripts and I've called wp_enqueue_media(...
1
vote
0answers
22 views

Differences between developing custom themes for wordpress.com and wordpress.org?

A potential client has asked me to develop a custom theme for their wordpress.com, which you can now do with a business account. I've built a lot of custom themes for the wordpress.org platform. I'm ...
1
vote
0answers
661 views

admin-ajax.php + load-scripts.php hanging for minutes

My issue is that when I do a simple Admin Dashboard change, like updating a post or page, I sometimes wait up to 10 minutes for the request to finish. I have tried restarting the process and my ...
1
vote
0answers
74 views

Sort wp_query by sum of two meta fields

Hi I have two custom fields amount1 and amount2. I want to sort my posts in descending order of the sum of amount1 & amount2. How can I achieve this? I know for a single custom field I can do this:...
1
vote
0answers
194 views

Adding column to wp_posts table or join wp_posts table with another table

I need to save many details like vites, likes, dislikes, voted day, page views about posts. Custom Fields? Yes, I know that custom fields are for that. But I need to order by many multiple custom ...
1
vote
0answers
55 views

Can I add multiple arrays within add_theme_support( 'colors' )?

I would like to add all possible options to add_theme_support( 'colors' ) in WP Customizer. What I have that worked was: add_theme_support( 'colors' , array( // Add colors section to Customizer. ...
1
vote
0answers
39 views

How to change title tag at page after loaded post?

I have sequence stack of filters\actions in custom plugin WP: add_action('the_post', 'post_callback'); add_filter('the_content', 'modify_content'); add_filter( 'the_title', '...
1
vote
0answers
116 views

Issue on Adding A Class to Bootstrap Navbar Walker Dropdown

Using Bootstrap 3 and Navbar Walker I am able to create dynamic dropdown on the Bootstrap and WP template but I need to add .dropdown-menu-left to the .dropdown-menu class, as well. As you can see I ...
1
vote
0answers
30 views

Prefix best practice, should we use framework name or theme name?

Assuming there is the theme A built on top of the theme framework B, A has its post meta named like a_{post_meta_created_by_a}, it's ok. But for post meta created by B, there are two choices: Use B'...
1
vote
0answers
26 views

Following Wordpress Markup Is mandatory, got awkward resultyby wordpress standard markup?

I had used the standard wordpress class entry-title, entry-meta etc, First my theme worked well later all at once the width changed vigorously. Do Wordpress generate css properties or can i use my ...
1
vote
0answers
91 views

Show woocommerce categories on my theme menu styling

I am modifying a Theme I purchased since it is not prepared for woocommerce. It has an option to select a megamenu from a dropdown list on the menu where it says not megamenu. This is the code I find ...
1
vote
0answers
35 views

Event Custom Post Type Title show by upcoming Event Dates

I've few Custom Post Type "Events" on different dates. Event Date is coming from Metabox. Example: Event Title 1 - Event Date: 20-10-06 Event Title 2 - Event Date: 20-03-26 Event Title 3 - ...
1
vote
0answers
82 views

Customizer: save setting/control content to post/page

Is it possible to have a custom Customizer control/setting that saves the content in a new post/page instead of a theme mod/option. Each control would be assigned a post/page, and that control would ...
1
vote
0answers
31 views

How to customize output of plugin

I'm developing my own theme for WordPress and I need plugin to fit into it (styles, layout), but I'm pretty new to PHP and can't make this work. So, code from plugin looks like: function ...
1
vote
0answers
128 views

Two queries for a WP_User_Query search work perfectly apart, but not together

I'm putting together a page that pulls User data and displays it in an attractive social-media-like format. I want to use a variable passed in through an input on the site to search multiple fields, ...