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

learn more… | top users | synonyms (1)

0
votes
1answer
27 views

Create Customization Controls from Array

Coming from a Javascript background and humbly jumping into WP dev I'm having some trouble with PHP (especially in a WordPress context). Here's what I'm trying to do: Create controls for the ...
0
votes
0answers
18 views

Loop through multidimensional array for values, then interest into mySQL table

I have a package of JSON that gives me something like this: [{"a":"5", "b":"9", "c":"3"}] I have a table with with three columns: a, b, c. I want to create entries into the table to match 'a', 'b', ...
0
votes
0answers
3 views

Dynamically PHP-generated content and SEO [migrated]

So I'm using a function in my functions.php file to add some text to all my posts. I was wondering if that will be used by Google when they index my website, and how that will affect my SEO ratings. ...
0
votes
2answers
17 views

Adding `post_author` in php

So, I have following markup to show a shortcode: <div class="my_edit_button"> <?php echo do_shortcode('[something]'); ?> </div> Then I am trying to make it so that the ...
0
votes
0answers
34 views

Add extra markup to WP menus

Have been asked to redevelop a HTML website in to a WP theme, it has quite an advanced menu structure and i'm not quite sure how I can replicate it. The second menu item has a sub-menu, but it is not ...
0
votes
0answers
28 views

preg_replace to switch urls

I've searched everywhere here and I just can not find the right setup; I'm trying to take a url and replace it with a non functional url... for example; CURRENT HTML URL STRUCTURE <a ...
0
votes
3answers
51 views

php string inside shortcode does not work

I want to automatically get products from woocommerce for a chosen brand, inside a brand's listing on a other part of the site using Sabai Directory. this <?php ...
0
votes
1answer
19 views

Post class only applying to first excerpt; why?

I have a page with three excerpts. Only the first excerpt is being given the post class, not the second or third. I presume something is wrong in my PHP: <table width="100%" border="0" ...
0
votes
0answers
23 views

Not including wp-load.php in plugin

Okay, so I'm trying to get a plugin approved, and I've fixed most issues except the fact that I'm using require_once to load wp-load.php. I create a button in the admin bar, and there is a javascript ...
0
votes
1answer
48 views

Custom Wordpress+PHP+MYSQL+AJAX form, submit event not captured by Javascript, but does POST data to the DB

I'm building a little form to let users update their contact information outside of the vanilla Wordpress user management systems. I plan to use a simple CRUD setup and throw in some sanitation. I've ...
0
votes
2answers
18 views

how to use php in custom toolbar form

i'm customzing my admin bar/tool bar and i've added login/logout/lostpassword. but when it comes to the registrations form i've met a brick wall function registration_admin_bar() { global ...
-2
votes
0answers
14 views

Customizing the product addon section in woocommerce? [closed]

I am working on an ecommerce project I have added the product addons on the product page with four options. I want to add a radio button for the first upload option and when user selects that option I ...
0
votes
0answers
19 views

Extract and amend variables from 'like' plugin and put into visual meter gauge plugin

I am trying to extract the total number of likes associated with different posts from the WTI Like Post Pro wordpress plugin, then subtract the number of unlikes and feed this total into a meter gauge ...
0
votes
1answer
28 views

Pass the updated value of aid from form using ajax

I am working in wordpress and I want to fetch the updated value of aid field from form each time a submit button is pressed. There are two submit buttons and I want the id as per the clicked row HTML ...
1
vote
0answers
31 views

woocommerce place order using curl? [closed]

I need to place order using curl in wordpress woocommerce. i already tried this but its not working. My error {"result":"failure","messages":" \n\t\t\t We were unable to process your order, ...
0
votes
1answer
25 views

Create dynamic content from one WP page to multiple other pages

I want to create dynamic content that is taken from a specific paragraph from one page and writes to a paragraph on multiple pages that feature that same content. I am new to PHP and not sure how to ...
0
votes
0answers
24 views

Update a div with ajax result

I am working in wordpress and this is an ajax call and I want the result of a row returned to a div with id #hero. Now since the result is a for loop and hero div is in each row. And the form has ...
1
vote
1answer
18 views

How do I use this PHP library to access OpenGraph data in a child theme?

I'm fleshing out post formats in a child theme. For link-type posts, if a featured image hasn't been set, I'd like to fetch the OpenGraph image associated with the link and display it. I've found ...
0
votes
0answers
31 views

Set cookies based on visitor choose (first time visit site)

i am working on solution to set cookies based on visitor choose. when the visitor first time visit my site, popup uppers with "select branch". so when the visitor select the branch i make the ...
0
votes
0answers
15 views

Call to undefined function wp_email()

Good Day, I'm just new in Wordpress, I have a custom product form inquiry create and all of its data are sent through ajax. The problem is although I included the wp-load.php file for wp functions and ...
0
votes
1answer
15 views

It possible to implement an adhoc php web application with wordpress?

I need to implement a web app in php and I wonder if it would be a good solution to use wordpress or just do it with external php code my web app: Has some panels with forms for the users to fill, ...
1
vote
4answers
198 views

How can I execute some small piece of PHP code in a sandbox area of my WP?

I'd like to execute some small piece of code like the following one: global $wpdb; $rows = $wpdb->query('SELECT DATE(post_date) AS date, COUNT(*) AS count FROM ' . $wpdb->posts . ' GROUP BY ...
0
votes
1answer
31 views

Allow only 1 taxonomy per custom post type [duplicate]

Wordpress allows Admin to select more than one category for a post , I would like to change that so user is allowed to select only 1 category for a custom post type. Please note I cannot remove ...
0
votes
0answers
29 views

WP dynamic featured image - Can't get second featured image url

(I've already opened a thread on stack overflow: https://stackoverflow.com/questions/30079269/wp-dynamic-featured-image-cant-get-second-featured-image-url Hope it's not considered as double) I'm ...
0
votes
0answers
14 views

Admin Editor Issue

I want to enable multiple <br /> tags in the back office editor as user press [SHIFT + ENTER]. Like Gmail Editor. Otherwise I need to disable linebreaks on [SHIFT + ENTER] and it should just ...
-4
votes
0answers
12 views

return body text of a post by sending a link

I need a code with this functionality(in php): As input I send a link And in output it returns me the body text (or Body Copy Box) of this wordpress post. Best Wishes
0
votes
0answers
20 views

wordpress custom post type with boostrap modal box

I would like to show WordPress custom post type in Boostrap modal box but as the result of codes below the Modal box always loop all the post and disappear. Thank you, Decneo <?php if ...
1
vote
1answer
29 views

WordPress template_include filter not working properly

I am working on a plugin. The plugin make custom post type "product". First i use template_redirect action for redirection to single and category pages. Here is my template_redirect code: ...
0
votes
1answer
23 views

How to keep empty fields from appearing in php?

Please help... I have managed to do some basic PHP coding to call author meta and url information on single post, but I do not know how to hide the empty data fields. Can anybody give me any ...
1
vote
0answers
29 views

How to use update and delete query in wordpress

First i write manually update, delete, insert and select query and execute data with mysql_query function Like this: Select query $prefix = $wpdb->prefix; $postSql = "SELECT DISTINCT post_id ...
0
votes
0answers
24 views

PHP errors are logged but not displayed

On my local development server, PHP errors are logged to the file wp-content/debug.log, but they don't display on the page or halt execution. This problem seems confined to the administrative ...
0
votes
1answer
53 views

Passing PHP Variables to JS using Localize Script

Im trying to pass some variables (author of the post, category of the post, and title of the post) to a js file using wp_localize_script. I cannot, for the life of me get these correct. How can I ...
0
votes
2answers
17 views

admin menu naming

how can I change the 1st child name of the admin menu in wp? I have upload a picture, I want to have a different name of the 1st child of the menu and the parent will be the same. this is mycode ...
1
vote
1answer
20 views

Replace text in post from cvs

I have constructed a post template that i want to use to all post. I use visual composer and some add ons . I need to create post with vcs file but i don't know hot to organize the cvs inside to do ...
0
votes
1answer
19 views

problem in inserting row to database

I have a custom table in database (named "wp_tasks") it has 5 fields. the problem is when i wanna insert the current time to this table it wouldn't, i checked for the first 4 fields, it works ...
0
votes
0answers
104 views

ajax form with multiple submit buttons and values

I am working in wordpress and I have an html form with two submit buttons with same classname and different value. I am passing the submit button clicked value through ajax and show it on the screen. ...
0
votes
1answer
54 views

Angular not defined [closed]

I have this code on my website and I don't know why the angular is not being defined and neither is the jquery. I'm fairly new to web development so I don't know what to do with the coding in order ...
0
votes
0answers
45 views

set external image as featured image

currently with the code below i am able to set an image from media library as featured image via functions.php below is my code functions.php set_post_thumbnail($post_id,$imageid); where ...
-2
votes
1answer
36 views

How can I search for usr_id within my date range with WP List Table?

I've fiddled around with the custom list table plugin for some time now but I'm not so much into MySQLi yet, so I hope there is someone here able to help me with my problem. My current code looks ...
0
votes
0answers
14 views

Custom Taxonomy as Link

I have this image here http://i.imgur.com/5szTQNy.png which shows the download button I will be talking about. I am trying to make it so that when I put in a custom taxonomy box in the back end the ...
0
votes
0answers
13 views

Loop childpage content

I need help with how to loop out all children posts with a specific template, so basicly I need a loop the gather all pages that is a child and has a template named "puff". Is this doable??
0
votes
1answer
18 views

Cannot load media and I get “PHP Warning: Invalid argument supplied for foreach(”

if I don't have active debug mode, I can't see any media in back end (in Media menu or even as in created gallery in a post editor). When I turn on debug mode: define('WP_DEBUG', true); // Enable ...
0
votes
0answers
12 views

Wordpress select adding an extra post

I have this script that is supposed to pull all of the posts with the same category id as the page titles name. So if the page titles name is "non-profit" it pulls all the posts with the category ...
0
votes
2answers
22 views

How do you detect if a specific word is at the end of a the_title()

I have event listings that look like this PAPA ROACH AT THE PARAMOUNT IN HUNTINGTON ON APR 28, 2015 Im trying to remove everything after the last "ON" $s = the_title(); echo substr($s, 0, ...
0
votes
0answers
21 views

count click on link class on posts and add it to custom field

I have 4 links on each of my posts (facebook, twitter, etc ...), what I'm trying to do, is that everytime someone click on one of this link, i'll have a counter incremented, and store the reslut in a ...
0
votes
1answer
60 views

Add jQuery to WordPress page

I need to add jQuery library to WordPress page. The page is rendered by a plugin shortcode. I've used the below methods but I don't see it working for my jQuery script. I tried to add these below ...
-3
votes
1answer
17 views

Event plugin problem any one solve .? [duplicate]

bool(false) object(stdClass)#5590 (3) { ["price_struct_id"]=> string(2) "11" ["product_id"]=> string(4) "1294" ["display_order"]=> string(1) "0" }
0
votes
0answers
36 views

Missing data in admin ajax calls on fresh install 4.2.1

I have a fresh install of wordpress (no plugins installed), and i noticed that $_REQUEST in admin-ajax.php doesn't have data fields. For example, $_REQUEST for adding new menu looks like this: Dump ...
2
votes
0answers
38 views

Making a follow button, Ajax not talking to php

I'm trying to make a user follow button using AJAX, but for some reason my AJAX isn't talking to my jk_user_follow function and setting the wp_set_object_terms. PHP function ...
0
votes
2answers
55 views

Search result page - display values from the result's metaboxes

i have this custom search-result page global $query_string; $query_args = explode("&", $query_string); $search_query = array( 'nopaging' => true, 'post_type' => ...