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

learn more… | top users | synonyms (1)

1
vote
1answer
45 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
35 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
10 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
39 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
41 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
40 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
91 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
35 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
35 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
29 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
48 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
32 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
18 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
70 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 I'...
0
votes
0answers
63 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="">О студии</a&...
3
votes
1answer
74 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 f711_image_size_prevent($...
0
votes
0answers
19 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 ...
-1
votes
1answer
28 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
22 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
71 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
89 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
74 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
42 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
22 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
93 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
86 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
29 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
56 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
57 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 back-...
0
votes
1answer
39 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
46 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
132 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
71 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 class="box">&...
0
votes
2answers
98 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
18 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
186 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
48 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
30 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
29 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 $...
0
votes
0answers
34 views

Pagination on Front Page

I'm having an issue trying to get pagination to work on the homepage of a site I'm working on. The "Older" and "Newer" links show correctly, and it updates the url to reflect the page number but the ...
0
votes
1answer
25 views

WSOD but WP_DEBUG not giving any errors

I am running Wordpress on a WAMP stack and I'm trying to debug a WSOD error, which I think is a PHP error, as I have tried disabling all my plugins and themes and they don't seem to be the problem. I'...
0
votes
1answer
91 views

Remove &nbsp; in post content

I have been trying to figure out since yesterday on how I can remove the code &nbsp; on my post. In the WYSIWYG editor it shows spaces, but once after I publish my post, it shows words sticking ...
0
votes
1answer
48 views

Login to wordpress using another sites authentication.

I am looking for a solution to access wordpress through another websites login authentication. Most of the pages are pulling from this external site via api including the login, but I need to also ...
0
votes
2answers
92 views

Jquery window.send_to_editor function

I have created a metabox to upload images. Whenever I click on the "Select Image" button the Image Uploader Box successfully pops up but when I select an image and click the "Insert" button the image ...
0
votes
0answers
41 views

Upload media via PHP

I'm trying to upload an image to the media-section, that is uploaded as dataurl to the server. I already have the image written into the database and uploaded to the most recent uploads subfolder. ...
0
votes
1answer
131 views

JS file is not loading when i put wp_head() and wp_footer

In my WordPress project I need to use a WordPress plugin, For that plugin to work I have to put wp_head() and wp_footer(). But when I put that than my slider's JS file don't load. <script src="<?...
0
votes
2answers
26 views

How to add style in functions.php depending on conditions?

I'm a newbie for coding, I would like to learn how to add css style conditionally in functions.php My header controlled by .header-outer class. What would it be the best way to add css depending on ...