Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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

0
votes
1answer
5 views

Problem with using get_template_part() in footer

First off let me just say, I'm new to theme development, I hope there isn't something obvious I'm missing. I'm trying to get this form contactform.php <form method="POST" action=""> <...
0
votes
0answers
26 views

Tweaking custom post attribute sortation

I've set up a custom field called "Priority" for posts in my Wordpress theme. They're basically integer values that the user can set, which are used in operations elsewhere on the site, and are ...
0
votes
1answer
13 views

using themename_the_custom_logo() in template-tags?

I am trying to learn how to create a theme for wordpress so i looked at the default theme 'twenty sixteen'. I was crawling around it and searching everything that i find strange then i saw this code ...
0
votes
0answers
17 views

How to display single post and the 3 previous posts on home and single

I am looking to have my site display a single blog post at a time, with the 3 previous posts displayed by thumbnail/title on the right. I was successful in getting this to work for the current post ...
0
votes
0answers
15 views

How to call a plugin function / variable from the theme

I'm trying to access to a specific plugin function in my theme. I really don't know what I'm doing wrong. I tried with include, no luck. I tried wit add_action and do_action, no luck. What should I ...
0
votes
1answer
15 views

How to prevent clicking on posts

I have a home page that is consist of Wordpress posts. I want the posts to be static so when someone clicks the post it won't redirect to the created blog post and only will stay static. how do I do ...
0
votes
0answers
12 views

add Boolean / setting / meta data to PAGE via add / edit section of admin for use in theme

I would like to add an attribute / Boolean variable / meta data to a page when editing / adding via admin (right hand sidebar), that is then accessible by my theme for sidebar creation and navigation ...
1
vote
2answers
32 views

Best way to start becoming a wordpress developer

It's my mission this year to become a wordpress developer. I've been using wordpress for years as a frontside user but I now want to be able to develop wordpress sites from themes to functionality and ...
-1
votes
0answers
14 views

Is it OK to have many page templates in a theme?

Simple question. Should I try to unify my templates to have as few of them as possible or it does not break any WP theme development standards and I can have dozens of them? Are there any standards ...
0
votes
1answer
30 views

Removing an Action in a Parent theme from a child theme [closed]

I am currently working on a website, which has the following Folder Directories: parent_theme/inc/functions/tgm-functions.php parent_theme/inc/plugins/class-tgm-plugin-activation.php I would like to ...
0
votes
1answer
20 views

WordPress Menu item > Sub menu Class update

I'm a newbie to WordPress core and development process. As I have a little knowledge of WordPress functions. But I need the help from you guys. Actually, i'm developing my first theme and i already ...
0
votes
0answers
14 views

In the 2014 theme, why wont edits from the editor show up?

I edited the single page (page.php)file by adding some text just above the "start the loop comment" but this does not show up on the sample page. Why is this? <div id="primary" class="...
0
votes
1answer
27 views

Separation of presentation and code - Wordpress

I would like to get max amount of info on how the Wordpress implements the separation of presentation from code. I know that there is themes that one can load through the admin, but how does this get ...
1
vote
1answer
41 views

When trying to override plugin's function by theme, my filter executes two times, I want it to run only a single time

Here's plugin function: function dokan_get_admin_commission_by($order, $seller_id) { $saved_admin_fee = get_post_meta(dokan_get_prop($order, 'id') , '_dokan_admin_fee', true); if ($...
0
votes
0answers
11 views

Retrieve a specific ACF Repeater Sub field similar to a veriable

I have a veriable $journey_value = $_GET['onward-date'] != '' ? $_GET['onward-date'] : ''; And in a custom query I want to retrieve a specific acf repeater suv field simillar to the above veriable. ...
0
votes
1answer
28 views

Having issue on Loading Meta Data From CSV to CPT

I have a custom post type which has one Title, and two meta box custom fields as $price = isset( $we_productMetas['price_box'] ) ? esc_attr( $we_productMetas['price_box'][0] ) : ''; $color = isset( $...
-2
votes
2answers
32 views

How to install Woocommerce without plugin?

I followed this guide https://docs.woocommerce.com/document/template-structure/ Then I installed a Woocommerce folder inside of my theme folder and added some lines in functions.php function ...
0
votes
1answer
22 views

How to Use Custom Meta Field Instead of CPT Title in Post URL

I have a custom Post Type which is not using any of WP builtin supports like( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ). Instead I am using my own metaboxes to publish the CPT. ...
0
votes
0answers
32 views

Custom theme admin-ajax.php 400 (Bad Request)

I am trying to load posts via ajax in WordPress but I am getting admin-ajax.php 400 (Bad Request) error. I have used the same code in one other website and it was working there but here in this ...
0
votes
0answers
27 views

Avoiding do_shortcode() loops

I have a situation with a custom theme I'm developing that creates custom widgets made to accept shortcode. Issues arise though when that shortcode evokes shortcode of its own. The potential arises ...
0
votes
0answers
20 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
1answer
13 views

Replace “content-area” of themes 404 page with plugin?

So I don't want to dive into the whys behind what I need to do but I have a very important piece of code that I need to insert into the 404 page regardless of the theme as a replacement of the content-...
0
votes
1answer
23 views

Getting posts to exclude from array

I have an array, where keys are the post ID's and values are post titles. $options = []; $args = array( 'posts_per_page' => -1, 'fields' => '', ); $posts = get_posts( $args ...
0
votes
1answer
42 views

Search filter by Post title OR Meta Title Value [duplicate]

I am trying to search Movies by it's Post title OR Meta Title value. But it is not working, it only search's by Meta value. I need to search by Post title as well and i.e check if the keyword is ...
0
votes
3answers
39 views

Get all posts as an array ID => Name

I need to query all of my posts as an array in example: 'options' => [ 'Post ID' => __('Post Name'), 'Post ID' => __('Post Name'), ], How can i do it? tried this but it gives me ...
0
votes
1answer
33 views

I don't know why categories are showing below post

I have created a function which shows categories list. When I call it above the entry-header, It is also shown below content even I haven't call it there. Also, the categories get duplicated e.g Our ...
0
votes
0answers
21 views

No 'Header' option on Customizer page? I need to change my header image

what I want to do is very straight-to-the-point: I want to change the header image as shown below to something else, however when I look for tutorials I see that people have the option of 'Header' on ...
0
votes
0answers
22 views

Adding language string to all URLs

I'm trying to set up some simple localisation on a site but I can't seem to get Wordpress to prepend the path with a language. I've set up some JavaScript that detects the user's language and ...
3
votes
1answer
37 views

Overriding core functions in child theme

Is it good practice to use children functions.php to override parent core functions? Example in Storefront theme : Core function if ( ! function_exists( 'storefront_primary_navigation_wrapper' ) ) {...
8
votes
1answer
204 views

How to move page template files like page-{slug}.php to a sub-directory?

I want to move page template files like page-{slug}.php to a sub-directory within my theme, in a way that WordPress will recognize them automatically. If the page templates of the said form doesn't ...
1
vote
1answer
16 views

Getting custom posts by post id from cutomizer text input

I want's to show custom posts in a page by using post id which is taken from customizer text input my code is here <?php $query = new WP_Query( array( 'post_type' => 'post', 'post__in' =>...
0
votes
0answers
19 views

Customizer settings do not transfer from dev to staging

I'm running a local dev server and a staging server for my site. After pushing to remote, the customizer settings are all lost. I am using the underscores theme with one added custom text area in inc/...
1
vote
2answers
42 views

<small> tag is being auto inserted

The tag is being automatically inserted in my HTML document. It is only being applied in my home page. I've already disabled all plugins but it is still there. My website is https://www.casinowired....
1
vote
1answer
34 views

What's the better way to add an inline script?

What's the better way to add an inline script in WordPress theme or plugin? Is it by the function wp_add_inline_script, or using the hook wp_footer? and why?
-1
votes
1answer
29 views

Add CSS class to PHP Statement

A newbie question, I have been trying to style certain PHP code and I keep hitting the wall. I need to add CSS class to the No results found text bellow: <?php } else{ ...
-1
votes
0answers
24 views

How to add next button to my paginated post in wordpress

Please my wordpress post is already paginated, but it's just numerical. I want it to be showing nextpage instead of numbering the pages in the post. See my post here.. https://omgbase.org/27-photo-...
0
votes
0answers
11 views

Displaying Pages in Nav Sub-Menu with Specific Taxonomy Terms?

I am trying to see if there is a way to have the sub-menu items change depending the taxonomy of the of the page that is in the menu? I currently use the following WP_Query I use to grab the top three ...
0
votes
1answer
19 views

Change Responsive Images Maximum Width of 1600px

Sorry for my English first. Just started with responsive Images and read https://make.wordpress.org/core/2015/11/10/responsive-images-in-wordpress-4-4/ So according to this post, there is a maximum ...
1
vote
0answers
22 views

Use second time navigation.js in underscores [closed]

I try to add a button dropdown in my theme underscores (without menu, simple div). I would like to use the script of navigation.js already present to notduplicate : ( function() { var container, ...
1
vote
1answer
20 views

wp-cli: For development, how can I activate a theme that is on the local disk but not zipped?

I am developing a WP theme which I'm referring to as foobar for the sake of this question. It's located in /var/www/html/wp-content/themes/foobar. At the moment, I am activating it via wp-admin ...
0
votes
2answers
35 views

Is there any way to register custom background images like header images?

I wonder if there exists a quick way to register custom background images as simple as we do with the custom headers. $header_images = array( 'ferrari' => array( 'url' => ...
0
votes
1answer
19 views

AMP for WordPress - Add Custom CSS? Or Template?

The AMP for WordPress plugin is really awesome. Does anyone know a way of overwriting the templates it uses or adding custom css?
1
vote
1answer
29 views

add filter not working when cancatenating variables

I am getting a problem while applying a code. My code works fine when i use only one variable. e.g; $posts_per_page = 'posts_per_page=3'; but it doesn't work if i use concatenation.e.g $...
0
votes
1answer
25 views

Customizer: How to Sanitize a Decimal Number Range

I have the following Customizer control/settings to control an image's opacity: // Image Opacity $wp_customize->add_setting( 'image_opacity', array( 'default' => '1.000', '...
0
votes
1answer
16 views

Duplicate child theme incl. design changes

My goal is to be able to have two identical child themes except one thing (e.g. the color of a button) for the purpose of A/B testing using the Nelio AB Testing plugin. However, if I upload another ...
0
votes
1answer
24 views

Move the social media icons to the left of a Wordpress nav menu for Soledad child Theme

I've been trying to move some social media icons (class="penci-topbar-social") to the left of a wp_nav_menu element for a bit and am stumped. I tried moving the social media code above the wp_nav_menu ...
2
votes
3answers
60 views

wp_enqueue_script being ignored in custom theme

I am trying to enqueue a js file (calculator.js) from my theme's functions.php file. I have a desktop theme and a smartphone theme, and I am using a plugin to switch between the two themes depending ...
0
votes
0answers
16 views

Doing context-aware previews in the WordPress Customizer

Initially I was using active_callback to make my Customizer controls contextual in nature, and was satisfied with the kind product I had with it. But then I cam across this article about Content-aware ...
0
votes
2answers
22 views

How to set Post meta-box defaults based on the choices made by user in Customizer?

I have a radio control in the theme customizer. The code for that control is like below: $wp_customize->add_setting( 'post_layout', array( 'capability' => 'edit_theme_options', 'default' =&...
1
vote
0answers
12 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 ...