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

learn more… | top users | synonyms (1)

-1
votes
0answers
21 views

Help in editing the code, image dimension, image file size and image type [duplicate]

Help in editing the code, the code works but there is thing one conflict. What I wanted is only 3 things, 1-image dimension, 2-image file size and 3-image type. what I wanted is if the users doesn't ...
-1
votes
1answer
56 views

Can someone help me edit the code for limiting image dimensions

Can someone help me to edit the code. The code seems to be working, but there is a problem, when I add a new plugin in wordpress, it prompts error. This code alert/error should only be in media ...
-1
votes
0answers
19 views

Change “Back” button text depending on where you came from?

I have added a custom "Back" button to the product pages of a website I am working on. I used this code: <input type="button" value="Back" onclick="window.history.back()" /> However, I ...
0
votes
0answers
20 views

How do I add and verify new user meta data?

I'd like to give users a field that they can fill out -- with an option for me to verify / not verify. Take for example every user has a field -- Total Cars Owned : [number] They can enter in ...
0
votes
0answers
30 views

How can I convert this SQL query to delete duplicate posts by specific meta_value instead of post_title?

This query works exactly as it should to DELETE all duplicate posts by post_title for my custom post type: $sql = " DELETE a.* FROM wp_posts AS a INNER JOIN ( SELECT ...
-2
votes
1answer
22 views

Issues trying to add a href statment with PHP into a PHP Echo Statement [closed]

Having issues with a line of code that's in an if/else statement. It's PHP so I should be using php echo to make it work but I can't seem to get the coding correct. Here's what it should be ...
-1
votes
1answer
30 views

Create new WooCommerce product (PHP) after submit form [SOLVED] [closed]

EDIT: You'll find my own solution at the bottom, on a new answer I have a website where the user uploads a file, then I calculate the price for whatever I do with his file and then they pay for it if ...
0
votes
1answer
68 views

Why does $_SESSION only work when I am logged in?

I am including a pure PHP library (nothing to do with WordPress) into a few of my page templates. This library calls PHP session_start() function and references the $_SESSION["cart"] global variable. ...
0
votes
0answers
8 views

WordPress - Breadcrumb in custom post types

So, I am trying to use breadcrumbs underneath my navigation, but with no luck. I am following this tutorial but when I start browsing into my custom post types, it goes wrong. For example - I have ...
0
votes
1answer
23 views

form $_post action value gets truncated after it passes through two forms

There are three pages page1, page2 and page3. When I press submit on my first form on page 1 my group name field can be catched with $_POST['groupname'] in the destination page but in the page 2 I ...
0
votes
0answers
15 views

Passed variable gets undefined variable error on insert on next page

I am passing a variable with $_POST to another page and on the destination page I want to perform an insert operation and want to use that passed value . The variable "$mygroup" is coming from a forms ...
0
votes
0answers
6 views

Utilizing 'link format' in WordPress without losing SEO value?

In many WordPress themes that support formats, applying the link format to a post makes its title point to a URL (examples can be found: Daring Fireball and MacSparky). In the theme I'm using, the ...
0
votes
0answers
14 views

myCRED do_shortcode issue

i found a code to create a timer. I want to use it for delaying a do_shortcode commands but i don't work... the shortcode is execute when the timer is to 1:00 and i want to execut it when the timer is ...
0
votes
2answers
16 views

Accessing values entered via form - try again

I have entered a form element into the page contents editor in wordpress. form action="/home4/stevekeo/public_html/wp-includes/testforms.php" method="post"> ... I want to use the selected value, and ...
0
votes
0answers
13 views

Accessing values entered via form

I have entered this form element into the page contents editor in wordpress. <form action="/home4/stevekeo/public_html/wp-includes/testforms.php" method="post"> <input type="radio" ...
0
votes
1answer
42 views

submit the form to same page

I have a simple form , all I want is to submit the form to same page. I have tried reading other answers including action="" - wordpress says Oops! That page can’t be found. action="#" - wordpress ...
1
vote
1answer
33 views

Any way to add -1 suffix to the end of every new post?

As you probably know, if a new post has the same post_name as another one, WordPress automatically appends it with -2, -3 etc. But is there any way to add -1 at the end of a post if there isn't one ...
0
votes
1answer
48 views

Add prefix to link url

I want to add image link on wordpress site which redirect the user to the another page of same url but with different prefix. for example page url is mydomain.com/post1234 when user click the image on ...
0
votes
0answers
9 views

If meta_data <= 50 [migrated]

I'm trying to automate the delivery (free above 50) message in my template. Currently I'm echo'ing the normal price & discount price (if available) which results in digits. I have a post with ...
0
votes
1answer
32 views

plugins_loaded action is not working properly

I am trying to send an email to the user after form submission but I get an errorCall to undefined function wp_mail() in C:\xampp\htdocs\wordpress\wp-content\plugins\contact ...
0
votes
0answers
50 views

Get month and day from a Date Picker custom field

I've got a custom field called fecha_del_evento from which I want to obtain the day and the month in different formats; day in numbers, and month with the 3 first letters. The code I'm using is a ...
0
votes
1answer
26 views

Nonce fail after second submit attempt

I am refactoring my plugin that resets the WordPress database tables back to their defaults and came across an issue. The form submission itself works fine. However, after the first submit, and if ...
0
votes
0answers
25 views

Shortcode At top of Page - PHP 5.5 vs 5.4 - ob_start();

add_shortcode( 'recent-events', 'recent_events' ); function recent_events( $atts ) { ob_start(); $atts = shortcode_atts(array( 'count' => '2', 'columns' => '1' ...
0
votes
1answer
47 views

Add logo to admin menu in my plugin

I want to add a simple piece of code: <img src="logo.png"> to the top of the admin menu. I know how to do it if I am just replacing a logo within an already existing class but there is no ...
0
votes
0answers
24 views

After refresh settings field disappers

I'm working on a little plugin project to help gain a better understanding of wordpress development. So far i've been able to create dynamic text fields which a user can add themselves. Whatever the ...
-2
votes
0answers
31 views

How to use abstraction layer with WordPress [on hold]

I am new in WordPress. I want to use abstraction layer with WordPress. Please help me. How can i implement abstraction layer with WordPress. If have any plugin please let me know. Thanks in advanced. ...
0
votes
0answers
12 views

Creating a user 'add custom field' section

I'm trying to make this plugin where users can add a custom attribute for something i working on: So far what i've done is: which uses this code here: window.addEventListener("DOMContentLoaded", ...
0
votes
1answer
44 views

how to disabled a button when press three times

Hi I just wanted to ask if there is a possible way when the word edit was press three times, the edit will be disable. on the image I have attach is a multivendor page, vendors can edit there ...
0
votes
1answer
19 views

Inserting two categories

I am trying to define two categories together in a post. please tell me where i am doing wrong. 'post_author' => $user_id, 'post_status' => 'pending', ...
-1
votes
0answers
12 views

How to add custom fields to a form?

How can i add simple text input custom fields to this kind of front end submission form? The code <form id="new_post" name="new_post" method="post" action=""> ...
0
votes
1answer
12 views

Access preview settings in php

I'm working with the customize section of my theme framework. And I'm trying to get the preview settings in PHP when using refresh, but I only know how to access the saved settings. Short Story I ...
0
votes
1answer
47 views

Get html data with javascript to php array and store to wordpress database

What I wanted to do is get the items that are dropped to the droppable area and stored it a php array so that I can store into database so that I can access the stored array from other parts of my ...
2
votes
0answers
18 views

Cropping, Re-sizing and Saving images from one folder to another folder in wordpress

I'm adding an upgrade for the WordPress plugin which I have developed ages ago. This plugin is just a product catalog, so just show products and their images. Products can have more than one images. ...
0
votes
0answers
25 views

Error:The Page isn't redirecting properly

I've mounted my wordpress under a subdomain while I am working on theme development. The code in question is placed in the functions.php file under my child theme. Here is the functions.php file in ...
0
votes
1answer
52 views

How to check if a plugin (WooCommerce) is active?

I am trying to modify the head and foot of my WooCommerce pages. I have an if statement that is supposed to target the shop and cart of WooCommerce, but it isn't. If I modify the PHP after the if ...
0
votes
0answers
13 views

How to control the the URL of a Custom Post Type to have multiple slugs?

I currently have a custom post type whose rewrite rule is this: 'rewrite' => array( 'slug' => 'tests', 'with_front'=> false ), So the URL is www.domain.com/tests/post-name ...
-1
votes
0answers
18 views

Why is my foreach loop preventing other subsequent loops working in php document?

I'm trying to create a section on my wordpress site for latest posts to be displayed with date title and an excerpt. I don't know what is causing this, but the loop I am using stops all subsequent ...
0
votes
1answer
14 views

Are all hooks/functions tied to Kses meant for sanitization?

I'm currently learning WordPress hooks and am delving into core to see what's happening in there. I noticed there are filters in wp-includes/default-filters.php with PHP comments about Kses. I wasn't ...
1
vote
2answers
35 views

Database query works fine outside Wordpress

This is my code <?php global $wpdb; $rows = $wpdb->get_results("SELECT `submit_time` AS 'Submitted', max( if( `field_name` = 'Salutation', `field_value` , NULL ) ) AS 'Salutation', max( if( ...
3
votes
1answer
59 views

Display message once per session to users with a specific role

I need to display a message to only users with a specific role. The message should appear either as soon as the user logs in or if they re-open their browser after having closed it when logged in to ...
0
votes
1answer
36 views

Echo a shortcode div after every 3 posts

In my wordpress home.php file, I have placed an increment loop with the help of a few stackexchange threads: <?php if (have_posts()) : ?> <?php $count = 0; ?> <?php while ...
0
votes
0answers
12 views

Php function modifying the page's rendering engine buffer and blocking caching plugin

I tried to create a plugin which creates pages based on a CSV or excel file containing hundreds of city names and postal codes. It creates one page per city, with always the same design but different ...
1
vote
2answers
34 views

WP Query. Is there a maximum size?

I develop a plugin that searches for a duplicates of WooCommerce products in a very specific way. It works great in our test environment, but on the client's original setup it does not execute. It ...
1
vote
2answers
52 views

Display latest x posts from all categories in Custom Post Type/Taxonomy

I am attempting to display the latest x posts from all categories using a custom taxonomy called 'case-studies' in WordPress. I have managed to output all the category names as heading links I have ...
0
votes
1answer
23 views

wp_nav_menu prints children with parent name

This code echo wp_nav_menu( array( 'theme_location' => 'primary-menu', 'depth' => '2', 'echo' => false ) ); prints Parent - Parent - Parent - Parent instead of: Parent - Child 1 - ...
0
votes
1answer
45 views

Remove price from Woocommerce variable product dropdown menu

I'm trying to hidden or remove the price on each variable products inside dropdown menu on a single product page. Please see image attached below. I believe here is the codes that needs to be ...
0
votes
0answers
37 views

How Can I use WPUF Pro for storing values in one other plugin

First of all i want to say i am a nob in this field of PHP coding. However, I collected some pieces of code that if some professional make some edits, it will be of great help to me. I have a plugin ...
0
votes
1answer
28 views

WP_Post is not from correct array

A bit of a complicated problem here, but I figured I'd see if I could get any help. My logic is this: WordPress custom post query > for each of the results, factor in distance (calculated ...
0
votes
1answer
34 views

Pagination reset problem

I need a fix for this web page. The page is attached if you wish to review the code. The pagination on each tab does not reset to 1 when the user has made a selection. This needs to reset when they ...
0
votes
1answer
37 views

Use WP_Query Data In Cookie

I've collected an array and set-up a cookie via functions.php, both work fine. However, I really need to post the data to the function and set the cookie as this information will vary per customer. ...