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

learn more… | top users | synonyms (1)

-4
votes
0answers
21 views

Woocommerce API

I am trying to take control of my e-commerce website using the Woocommerce API and PHP, I'm wondering if I can add products, edit price and stuff using only the API and PHP if i can't , with wich ...
0
votes
2answers
35 views

Simple jQuery AJAX Request fails to run PHP Script

I have a fairly simple AJAX request for my WordPress site. My PHP function is a switch statement and all the other switch statements work except for the recent one I added (change_due_date). I ...
0
votes
0answers
9 views

Edit the output of visual composer for homepage

so i want to put in some php code into my home page, so that if the user is logged in one wordpress element is show, and if the user is not logged in, another wordpress element is shown. By "element" ...
1
vote
2answers
33 views

how to create and show sessions in word press?

I am new to word press but know all the required PHP skills. I am using a form to create session in one page and then accessing those sessions in another page. I have done this already without word ...
0
votes
1answer
30 views

Every time I use wp_get_current_user() my plugin breaks

I have been trying to make a sign-out plugin that allows users to sign out from military training activities that they should be at. After they fill out a form explaining why they are not going to be ...
-2
votes
0answers
14 views

Multiple language shortcodes in php

Im new in PHP developing ,I want my slider is with multilanguage ,and I write some little codes lines ,but these doesn't work. CODE <? if (is_front_page() || is_home()) { wpml_e__if_language( ...
-2
votes
0answers
35 views

To remove css code in source code of my website

I have installed Slicknav Menu plugin on my wordpress site ali-coupons.net. Now, when I go to the main page of my site and run a source code, i see a part of this plugin's css code: <head> ...
1
vote
1answer
20 views

Set WP_MAX_MEMORY_LIMIT higher than PHP.ini memory_limit

I've read here, but I want to ask if I have understood this correctly. We have a server in which WordPress admin needed more memory. The PHP memory_limit, in PHP.ini, is set to 256M, and so was ...
1
vote
0answers
16 views

Displaying admin notice dynamically

I would like show the admin notice while post text is being edited (before Save post). I suppose admin_notice hook wont work in this (it doesn't for me). Any idea how to show some error message to ...
0
votes
2answers
40 views

Conditional in foreach loop is outputting content twice

I have a website that displays a slideshow using custom fields and the Slick carousel, using the code below. <?php $entries = get_post_meta( get_the_ID(), '_mysite_homepage_slider_group', ...
0
votes
1answer
34 views

Adding my own custom template page but got white page

I'm working on a e-shop with WordPress and Woocommerce. I bought a template and i'm looking for create my own custom single page. So i followed this tutorial but when i tried to acces to my page with ...
-2
votes
0answers
15 views

Remove hook from a woocommerce class [duplicate]

I would like to remove a specific action from the class "class-wc-gateway-bacs.php" // Customer Emails add_action( 'woocommerce_email_before_order_table', array( $this, 'email_instructions' ), 10,...
0
votes
1answer
35 views

Add post class in custom loop (WP_QUERY)

Normally if I wanted to add a custom post class I would use the post_class filter. However, when using a custom loop the post_class filter is not accessible. I am trying to apply classes that will ...
0
votes
2answers
47 views

Querying Database with wpdb

I am trying to access a single value from my database through my functions.php. I have tried three different ways to get a result using a dynamic ID and none have worked. I always get NULL as the ...
0
votes
0answers
25 views

Passing dynamic local variables without using class

I creating functions in my function.php and I have a question regarding passing local variables between functions if the variable is a dynamic one that changes according to certain conditions. Let ...
1
vote
0answers
18 views

Pass updated local variable between functions? [duplicate]

I creating functions in my function.php and I have a question regarding passing local variables between functions. Let say I have the functions below, A and B, and I have the variable $amount. Now ...
-3
votes
0answers
14 views

Using namespaces without fatal error in PHP 5.2

I have decided to stop supporting PHP 5.2 for my WordPress plugin and want to use namespaces and other new syntax in my code. But at the same time I don't want it to result in a fatal error for ...
1
vote
1answer
27 views

Can't get wp_insert_post to work

I'm trying to code a loop that will post articles from a SQL database. However, whenever I try to load the page I get a 500 error and nothing is showing up in the error logs. Code: <?php define('...
0
votes
1answer
7 views

Issue Enqueueing Wordpress style.css

I'm beginning the frustrating process of migrating an existing site over to a wordpress theme and have run into trouble immediately. For some reason that I can't pinpoint, my style.css theme is not ...
-5
votes
0answers
27 views

Echo Title text to h1 using PHP [on hold]

I need to create text within h1 tags by copying the existing text in the title tags. My plan is to add a sitewide subheader with inline php e.g. <h1><?php echo $titletext ?></h1> ...
0
votes
1answer
28 views

Permalinks and custom PHP application

I have Wordpress installed in the root directory and configured properly using permalinks. Alongside the Wordpress blog, I have a full-fledged custom developed php application with several pages. I ...
0
votes
1answer
36 views

What is the best practice for restricting a section to logged in users?

As a newbie, I've had a hard time finding a good starting point. I believe my case is fairly common and maybe this question has been answered comprehensively elsewhere. I am creating a simple site ...
1
vote
0answers
19 views

Programmatically create page when saving custom post type post

I want to create page when saving new post on my CPT and i want it to be created only when first saving (by pressing Publish button) that post, not when i click Add new (it then saves the post first ...
1
vote
0answers
14 views

How to escape attachment image caption text?

I'm outputting an attachment image's caption but feel I should escape the output: <figcaption> <?php echo get_post( get_post_thumbnail_id() )->post_excerpt; ?> </figcaption> ...
-3
votes
0answers
28 views

How can I edit a woocommerce / visual composer shortcode?

There's this element in Visual Composer: Product Category, which retrieves all products in a specific category. I would like to know where can I edit it, so I can modify its HTML output.
-1
votes
0answers
9 views

Deleting one multidimensional array in options based on button click [on hold]

I am trying to delete a specific options based on an button click. They are all displaced through a php foreach loop echo. Currently I have the delete working like this if (isset ($_POST['plugin-...
-4
votes
0answers
27 views

Changing code output of 'woocommerce_content()'

I am relatively new to WooCommerce and have been working with a custom template. Anyway, on my shop page it is using woocommerce.php: <?php get_header(); ?> <?php if (is_product()) : ?> &...
0
votes
1answer
14 views

I'm trying to create a custom version of the wp_list_authors function that includes custom post types

I'm trying to create a custom version of the wp_list_authors function that includes custom post types. I have 3 authors on the site I'm working on (www.healthyeatingadventure.org). Two of them only ...
0
votes
1answer
23 views

Unable to pass variable to database

I'm trying to write a simple plugin which saves a backend form's inputs and selects to the db. Everything's fine until the script tries to pass the variables which store the field's values to the db. ...
-1
votes
0answers
18 views

unzip file/folder in wordpress using command

create a folder and put this code and save with .php $unzip = shell_exec("unzip file-name.zip");//file-name is your zip file name echo 'Unzip command executed'; Copy your zip folder where your this ...
0
votes
0answers
3 views

is it possible to pass a multidimensional array via declaring it in a function? better just to declare it global? [migrated]

good afternoon, i've been trying to figure out build an array for use in multiple functions, inside functions.php. it appears that i need to create the array in its own function, and then refer to it ...
1
vote
1answer
41 views

Do not execute If User is login as Administrator or any Specific Role

How can I not execute some <script> </script> if the user is an administrator or any specific role? Basically I need to do something like this: <?php if( !User( 'Administrator', '...
1
vote
2answers
43 views

List authors with posts in a category

I'm trying to create a custom widget to display contributing authors for the current category being viewed on a WordPress site. I have the following PHP code: <?php if (is_category()) { ?> // ...
0
votes
0answers
20 views

Issue with retrieving taxonomy slug

I am trying to integrate two plugins on wordpress and am extremely frustrated and hope somebody can point out what I am doing incorrectly. I am trying to integrate the mycred plugin which gives users ...
-1
votes
1answer
21 views

Load a Header in wordpress

I'm trying to added upload header in Wordpress but not upload the image but it print out the link of the header. How do I fix the problem the him have with wordpress. <?php if ( get_header_image()...
-1
votes
0answers
23 views

WooCommerce Shop Page Display Product Div as a Weird Loop

function neato() { global $product; if ( $product->get_permalink() ) { echo '<script src="https://code.jquery.com/jquery-1.10.2.js"></script><div class="new-projects"></div> ...
0
votes
1answer
33 views

using a shortcode in a hyperlink

I am trying to use a shortcode inside of a hyperlink <a class="wpb_button_a" title="Reserve Now" href="/reservation/?unitrate=[print_csv position="5"]&amp;unitsize=5%20X%205&amp;...
1
vote
3answers
60 views

How to use wp_localize_script in a WordPress page other than functions.php?

I have a contact form in a WordPress page like this: $( '#contact_form' ).bootstrapValidator({ fields: { // ... }, submitHandler: function( formInstance ) { $.post( "../...
0
votes
0answers
21 views

WordPress Link - Custom Project

hope doing fine. I have a project and um really stuck in. Concept: http://abd.press/fU4yH Here is a little code, which i was successful to get from different sources but unable to manage next. <...
4
votes
2answers
73 views

Easy way to process search results before displaying

I've got several search forms on my site and I want them to show different results. My website has a very strict hierarchy and the search form on a parent site should only show results from it's child ...
0
votes
1answer
29 views

Plugin Development sqlite or WordPress' database

I am developing a plugin for WordPress that has to store between 4.5-200mb of data. I thought of using sqlite to store and access the data instead of using WP's database. From a performance ...
0
votes
1answer
25 views

Update post meta - Custom field does not match meta-key

I am trying to update my acf with update-post-meta: //ga_analytics_settings update_post_meta($my_post, 'ganalytics_settings', serialize($ganalytics_settings)); $ganalytics_settings is an array, ...
0
votes
1answer
40 views

Updating meta_value in a custom key

I have a custom meta_key called 'sales' this holds information of all sales a sales person has carried out along with a flag to say if it has been authorised, awaiting authorisation or if it has been ...
-4
votes
1answer
22 views

Add a “Next Post” & “Previous Post” styled button manually to a post

Can anyone walk me through the exact steps? I want to create two buttons that sit next to each other at the bottom of a post for the NEXT and PREVIOUS posts...I want to be able to insert this ...
-5
votes
0answers
24 views

Change Woocommerce total cart rates [on hold]

I have two categories names Regular Notebook Personal Notebook I want user to give 2 options in cart page before checkout. Canada England First Option: I want if user select only Regular ...
0
votes
0answers
26 views

How to escape ampersand in redirect URL?

I have hooked the 'login_url' function, so that the user can login via different means. Here is what the code looks like: add_filter( 'login_url', 'my_login_page', 10, 3 ); function my_login_page( $...
0
votes
0answers
15 views

Multiple file upload frontend and capture their paths

<input name="image_url" type="file" /> <input name="Submit" type="Value" value="Přidat" /> I have this in html form and this in php : if ( $_FILES['image_url']['name'] != "" ) { ...
1
vote
3answers
44 views

How to check if comments are paginated?

I'm trying to determine if there's more than one page of comments in single.php. In archive.php I can do something like this to check if there's more than one page of posts: if ( $wp_query->...
1
vote
1answer
34 views

Display a message if posts dosen't exist on loop

I have a loop for bookmarked/favorite posts and for a fresh account if you don't have a bookmark post on bookmark page will show this message: Bummer, no bookmarks posts! After the fresh account ...
0
votes
0answers
14 views

Pagination not working for custom post loop [duplicate]

I have a loop for my custom post, and it displays the pagination links fine, however when i click to the next page it displays the same posts again (event though the URL shows its on page 2). Below ...