The server-side programming language that the WordPress core, plugins and themes are written in.

learn more… | top users | synonyms (1)

-1
votes
2answers
61 views

How to create a loop that will display one post and stop?

I am trying to create a part on my wordpress theme that will only display one featured post. I have installed this plugin - https://wordpress.org/plugins/featured-post/ . I know I am supposed to ...
0
votes
2answers
64 views

Displaying theme options in css

I am literally pulling my hair out trying to figure this out. I have been at it for almost 12 hours now. Being new to PHP and theme development I am having a hard time understanding how to get ...
0
votes
1answer
21 views

ACF - How to set the menu order for the relationship field

So, I've got a relationship field where I select a certain amount of posts to show on the home page. What I am trying to achieve is to apply the menu order of the posts as they are in the back end so ...
0
votes
1answer
36 views

Creating an admin meta box to save post as pending

The workflow when using Wordpress to change a draft post to pending involves several clicks and button presses, especially on mobile So to simplify my process I would like to create a meta box that ...
0
votes
0answers
12 views

Multiplying shipping cost

My site is selling a monthly box of which you can order a 3, 6 or 12 month subscription, but the total price is collected up front through woocommerce. I would like to also be able to multiple the ...
0
votes
0answers
30 views

Create custom post type and content of custom post type display in a single product page of woocommerce

Code to create custom post type is here and it's working: $args = array( 'labels' => $labels, 'description' => __( 'Description.', $this->plugin_name ), ...
0
votes
0answers
35 views

Change Gallery Shortcode Image Size

I am developing a WordPress theme and have a few posts with galleries (displayed via Jetpack slideshow). Gallery example: [gallery type="slideshow" size="full" ids="1672,1682,1674,1670,1676"] ...
0
votes
1answer
26 views

A custom RSS feed link, how do I modify the XML structure?

I'm working on this website and I can not find where I can modify it. It has a different link, than regular RSS feed links. While a normal RSS feed looks like this websiteaddress.com/?feed=rss ...
1
vote
1answer
41 views

Wordpress php filter admin_body_class not working

I have the following function in a plugin I have built: static function filter_add_body_classes( $body_classes ) { $new_classes = array(); // Only when logged in if ( ! ...
1
vote
1answer
34 views

Anyone can register via backend

My question is simple. Is it possible to enable option "Anyone can register" with php function? Thanks.
0
votes
0answers
8 views

Woocommerce variants CSS targetting issue

When a user is not logged in, they will not see certain things. I've accomplished this with a php/css hack in header.php <?php if (!is_user_logged_in()): ?> <style> ...
0
votes
0answers
26 views

Woocommerce, insert attributes with php

I've created a php program to dynamically insert products into the Woocommerce library. I've some problems with the attributes of my products, I've two php variables. $attribute->titleIt - It ...
0
votes
1answer
26 views

Custom post type url Rewrite (conflicting with page url)

I have a website that has many different custom type posts. I want to use pages as parent templates for those custom type posts (listing all particular custom posts) For example I have a page called ...
-1
votes
2answers
35 views

shortcode doesn't work

I made my first WP plugin, it is a contact form - here is the code: <?php /* Plugin Name: Example Contact Form Plugin Plugin URI: http://example.com Description: Simple non-bloated WordPress ...
0
votes
1answer
42 views

How to get the original price of the product in woocommerce?

I have created the code to loop through the product list and display the price $args = array( 'post_type' => 'product', 'posts_per_page' => 100, 'product_cat' => 'hot-deals'); ...
0
votes
0answers
18 views

comment visible only for author post and admin and user comment

i have a custom post called "service" in this custom post i want a possibility to send proposal-comment by user. but i want this comment are visible only for admin + author of post + user that send ...
0
votes
2answers
29 views

Issue adding featured image option to functions.php

I'm creating my own theme and I'm looking to add a featured image option by adding: add_theme_support( $feature, $arguments ); Into the functions.php file. When I do this I get this error: ...
0
votes
0answers
24 views

Featured image in custom post is being disabled

I'm trying to create a custom post as a plugin and so far I'm having some trouble trying to enable featured image on my custom post type. Right now I have created two custom post types but the problem ...
0
votes
1answer
26 views

How to add query vars with paginated URLs?

How I can insert some custom url parameters to pagination links? the code below display like page.php?cpage=2 But I would like to add a parameter category with value fruit. So, the final url will ...
-1
votes
1answer
46 views

Using is home to get content [closed]

I'm looking to use is_home to 'get content' as I would like my blog page to echo a header, content and date/time but I only want all other pages to get the content. This is what i have so far... ...
0
votes
1answer
23 views

How to implement conditional PHP in Footer

Hoping for a little bit of help...I have added a script in footer.php and I want the script to run on all pages but not on "contact" page. What would be the coding/conditional to do this? Thank you.
0
votes
0answers
16 views

Create a custom theme-specific page, invisible in the admin-panel?

I've learned that when I want a custom page, I need to create a page template, create my page and assign the template to it. Also I've read about fake/virtual pages, where the page is generated on the ...
-3
votes
1answer
35 views

What does this if-statement do?: if($pages=' ') {}

This is an excerpt from a tutorial on how to create pagination for an blogpost overview page. What does the first part if($pages == '' exactly do? Quote from tutorial: Now we know which page we ...
0
votes
1answer
64 views

Why I'm Not Having Access to “$_POST” Data Outside My AJAX Callback?

I'm trying to pass some data from the Back-end to JavaScript. The thing is, when I try to console.log() the variable passed through the wp_localize_script() it shows me on Console the structure that ...
0
votes
0answers
54 views

WordPress multiple loops on home optimization

I am running an News Website based on WordPress with several plug-ins, including W3C Total Cache on my VPS (Nginx + PHP-FPM) server. The code of our home.php is: <!-- STICKY POSTS ...
-2
votes
1answer
24 views

How make wp_nav() with my css?

I'm make small theme for company. We have html code made by fronted developer. How will be code menu from html to wordpress by php. <nav class="top-nav"> <a href="">О ...
3
votes
1answer
51 views

Modify Maximum upload file size text

I have an issue with user uploading large images. I have prevented this with this snippet... add_filter('wp_handle_upload_prefilter', 'f711_image_size_prevent'); function ...
0
votes
0answers
18 views

Custom Fields with pre-filled content

as this is my first post here I first of all like to say "Thanks" because I found a lot of hints here for my problems in the past. Now I have to ask for the first time: We are offering news under ...
0
votes
1answer
22 views

Call custom posttype outside the functions.php

In WordPress I can create a user with a checkbox YES or NO. When the checkbox is YES I want to create a custom post type. Is that possible? I tried to call the function in the if statement : global ...
0
votes
0answers
21 views

Can't pick up a field created with Advanced Custom Fields

I have a situation where: I need to create a custom link per image on an image gallery. I did that via ACF. I have created a text field with HTML outputing so that hyperlinks get converted ...
0
votes
1answer
48 views

linking stylesheets and scripts with functions.php

I am following along with this tutorial. I am trying to link the javascript and css files that are usually linked in the header using wp_enqueue_scripts in functions.php. With what I have now, only a ...
0
votes
2answers
70 views

What to create new post using wp_insert_post, but it repeat the post infinitely

this is my source global $page; $page_exists = $page->post_title; $another_db_user = 'user'; $another_db_pass = 'pass'; $another_db_name = 'name'; $another_db_host = ...
0
votes
1answer
31 views

Ajax form submit within a Post Metabox

I have a custom wordpress MetaBox assigned to post. I have the function running on the post save_action. However I was wonder if I can get a button inside of the metabox the will run the function on ...
0
votes
1answer
29 views

Batch update a post meta field value of each post in Post Type

I need some help on making a batch post meta updater I'm trying to add to my options/setting page. Basically I'm looking for a way to click a button a batch runs through all post of a selected CPT ...
0
votes
1answer
18 views

Can I remove or edit an include() from a function with a filter?

I need to edit the output of a plugin and the part I need to change is actually a html file that is brought in using include(name-of-file.html). The function has a filter, but I am just now beginning ...
0
votes
3answers
62 views

How to get the active theme's slug?

I'm able to get certain info about the active theme using wp_get_theme(). For example: $theme = wp_get_theme(); echo $theme->get( 'TextDomain' ); // twentyfifteen echo $theme->get( 'ThemeURI' ...
-2
votes
1answer
54 views

Submit cf7 form to cfdb as pdf/BLOB

I have a form created in CF7 with a signature field. I am also using CFDB. Rather than do the usual submit, I would like to capture the form as an image in a pdf and insert it into CFDB in a BLOB. I ...
-4
votes
1answer
25 views

How to remove the intro animation which appears during the load up of some Wordpress themes? [closed]

How do you find and delete the code which makes the loading animation at the very start of every page on many wordpress sites appear? Sometimes the animation is a simple loading wheel gif image and ...
1
vote
1answer
45 views

How to select the contents in the text view textrea in wp_editor?

I am trying to count words among other text stats entered into the default post editor (wp_editor). Its supposed the write word count out to <div id="word count"> in the meta box immediately ...
1
vote
2answers
49 views

Creating a Multi-Level Associative Object Using AJAX

I'd like to create a Multi-Level Associative Object on $.post method using WordPress, in order to make my code cleaner. The problem is, I don't know how to get those values to manipulate on the ...
0
votes
1answer
37 views

Editing existing pre-created menus in PHP

Here's my pickle. I'm using a script to automatically create a fully pledged WordPress site. In this process new pages, etc are created automatically. I now need a way to add the newly created page(s) ...
0
votes
1answer
40 views

Removing custom sort order from admin page listing

For the background to my question: On my page listing, I've got a set of pages that are countries and the child pages of those are categorised into 'Types'. So I've got a page structure like this: ...
0
votes
1answer
74 views

If Custom Field is empty don't display div

I'm looking for a better way to hide a div when a custom field is empty. I've figured out how to hide the div but I have quite a few custom fields and I'd rather not write the code for each one. ...
1
vote
1answer
47 views

Remove &nbsp; from shortcode

I'm not sure why I can't get this to work. I'm trying to remove the &nbsp; that is added inside this shortcode... [box] Text [/box] Which results in this HTML output: <div ...
0
votes
2answers
85 views

Correct use of curly braces vs alternative synax

In most themes I've looked at and WordPress core, I'm seeing the use of endwhile and endif. Is there a good reason why WordPress uses these instead of curly braces for block statements?
0
votes
0answers
14 views

WordPress Stored Procedure - Commands out of sync, you can't run this command now

I'm having trouble trying to call a stored procedure for my WordPress plugin. I am receiving the following error: CALL category_GetName(3) Commands out of sync; you can't run this command now ...
0
votes
1answer
91 views

WooCommerce dynamic price by quantity

I use plugin WooCommerce Dynamic Pricing Display to show calculated price by quantity on product page. Problem is that css styles don't load for my block product-count-price from style.css...I have ...
0
votes
1answer
38 views

add_rewrite_rule with bottom priority doesn't handle the Wordpress pages

I have a php file named test.php that outputs the page querystring parameter. I want to use add_rewrite_rule to serve my php file, while the WordPress pages which exist already or will be created ...
0
votes
0answers
24 views

How can i move something from user panel to frontend user edit

Hellow stackexchange, How can i move this : It's from a widget that put that there and i want to move it here: On Frontend user edit panel. I look into the widget code and i try something but ...
0
votes
0answers
26 views

Add tags to kses_post array parameter

I think I butchered the title but (code below) I am trying to wrap some tags around whatever is written in the $message array, is there a way to do that? Also, is there an easy way to change the ...