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

learn more… | top users | synonyms (1)

0
votes
1answer
34 views

meta query not retrieving posts

I am attempting to use get_posts() to retrieve posts that have certain topics attached to them, in my custom post type named 'leaders' Here is my query. $args = array( 'post-type' => ...
0
votes
1answer
22 views

Why is 'admin' missing from my admin links?

I cloned a wordpress site to my local machine. Then I ran PHP's built in web server in the root of the WordPress site, via 'php -S localhost:3000'. I added my db credentials in wp-config.php. Then I ...
0
votes
0answers
61 views

Unusable menus and “Illegal widget setting ID: nav_menu_item[]” error

This is a bug in my WP install that has crept up unknowingly; I can't say for sure when it began. To describe it: there were menus created in the Appearance -> Menus page early in the site's history, ...
1
vote
1answer
13 views

Randomly Assign an Image's Alt Text Based on Data From Post

I would like randomly assign an image an alt text based on taxonomy entered by the user on a post that the image is attached if there is no alt text entered. For example, on a post that has an image, ...
1
vote
0answers
105 views

PHP array to JS array to use in google map

Hi I want to use some data stored in a php array to use it in google map api, to populate multiple locations in a the map. I use the loop to create my php array. <?php while ( ...
0
votes
1answer
29 views

Create a a form for custom taxonomy terms

Currently i am displaying a list of my custom taxonomy (contenttags). These are displayed in a list using the code below, which then displays the posts under that taxonomy. <?php $taxonomy = ...
1
vote
2answers
39 views

Breaking up CPT output into two columns

I have the following code. I have a left div and a right div. How would I edit the below code to pull the first X CPT data and put it in the right column, and the next XX number CPT data to put in the ...
0
votes
1answer
33 views

Call to undefined function error in plugin

I wrote a function inside a class that gets a user's country from the IP address... function getcountry() { if (!class_exists('GeoIP')) { include_once("geoip.inc"); } if ...
1
vote
0answers
17 views

When to use Exceptions vs Error Objects vs just plain false/null

I'm in the process of writing a plugin and I'm trying to gauge when to use different approaches of handling errors. There are three methods I'm considering: Throwing an Exception (custom class) ...
0
votes
1answer
34 views

Initial offset of number of posts in home page on the posts page

I've got a problem. Im using WP_query on my static home page, and i've set up an 'archive' page (not like archives/tags etc) as my 'page 2' which has all my other posts on it. My home page is a ...
1
vote
1answer
36 views

Translating add to cart woocommerce button

I am trying to translate add to cart button. I have 2 code snippets from woocommerce documentation here are they: FOR SINGLE PRODUCT - THIS ONE WORKS add_filter( ...
0
votes
1answer
26 views

Custom Form Processing Issue

I have created a form on my wordpress site, a function to process the data located in functions.php, and an action php file. I have tested the processing function and know it works, but I'm having ...
0
votes
0answers
33 views

Test if fragment caching is working

I had this fragment caching function added in the `function.php. it goes like this: function fragment_cache($key, $ttl, $function) { if ( is_user_logged_in() ) { ...
0
votes
1answer
54 views

Display only text to WordPress loop without loosing the text formatting

I want to display text from content (only text) with the formating (paragraph, bold, italic.) on loop. When I am using this code: <?php echo mb_substr( strip_tags( get_the_excerpt() ),0,255); ...
0
votes
0answers
34 views

How would you connect to 100 different databases in wp-config.php

We have a setup where we have 100 sites using exactly the same code base, and all files are stored on Amazon S3. But right now we are running 100 different WordPress installations. Now I was thinking ...
0
votes
1answer
62 views

seo meta description issue in google search

This is my first time to use Yoast SEO plugin in my website, I'm trying to add meta description to every pages and every post in my website. When I search it on google, seems like the meta ...
0
votes
0answers
18 views

How do I redefine wm_navigation() or wp_logo() within a theme that uses hooks?

What I want to do: Move the title of my website from it's current location to be in the "menu" div so that it is to the left of the menu/page list. Demo page: http://aaronmoore.me/visartsassignments/ ...
0
votes
1answer
55 views

Pods pagination erases my sub menu

I've build a taxonomy that holds the categories of a custom post type. This is going to be used to create a sub-menu called categories that is a filter to generate all the custom post types that have ...
0
votes
0answers
56 views

Make Wordpress upload directory outside wordpress root with custom url

I want to change the upload directory for Wordpress from project.dev/wp-content/uploads to cdn.project.dev Where subdomain cdn has DocumentRoot: HostPath/project.dev/cdn while Wordpress is located at ...
0
votes
0answers
36 views

Meta Box Plugin - Adding field value inside echo

I am using Meta Box Plugin to add some custom options to my Page Edit. I added a field to add an image background to the header which is working great. This image background has a parallax background ...
0
votes
1answer
67 views

Shortcode for Visual Composer Grid fails turning string to integer

I am working in a shortcode for visual composer grid. I want to show the list of terms of a taxonomy (portfolio_tag) associated to a custom post type (portfolio). The shortcode gets the ID from the ...
0
votes
1answer
57 views

Does wp_query and query_posts affect website performance? [duplicate]

I've been aware about the difference of wp_query and query_posts. I just want to know what impact does both query methods to the performance of the page? Which query method makes the page load quicker ...
0
votes
1answer
43 views

wp_query (or hook) posts by date (id) in array then set post_type

Hi I am building a plugin and am not as familiar with wordpress hooks as I would like. The code would not be used to display on a page rather just setting in the database. I am looking for a hook or ...
0
votes
1answer
251 views

WooCommerce - Customer Order History Pagination

I'm trying to implement pagination into WC's customer order history that can be seen on the "My Account" page using woo_pagination(). https://docs.woothemes.com/document/woo_pagination/ The template ...
0
votes
1answer
53 views

I need help implement a Javascript code into the PHP file

I need help implementing a Javascript code into my PHP file that would replace the default search box with a new one. Do I have to use echo? How would it look like? Thanks in advance or your help, ...
1
vote
0answers
28 views

How to append element after thumbnail

Hey I just wanted to know how to add an element after the first thumbnail image in my loop. Basically I want an HTML div tag inserted after the first image in my post. Anyone know how to do that in ...
5
votes
1answer
73 views

When unit testing a plugin, does the plugin need to be in the wp-content/plugins directory of the WordPress tests install?

I'm currently setting up unit testing for my plugin. In my tests/phpunit/bootstrap.php file I have: require_once $wp_tests_dir . '/includes/functions.php'; tests_add_filter( 'muplugins_loaded', ...
0
votes
0answers
19 views

How to hide a Control in the Customizer?

I know contextual controls hide if for example the user navigates from the viewer certain pages. But how can I achieve hiding a control under this scenario: There is a type Select Control with an ...
0
votes
0answers
46 views

Post date displayed double using Underscores Components Theme Starter

I'm building a WordPress theme based on components.underscores.me but after post a content, left the template tags untouched, the post date displayed double. Like this: Here is the the php codes ...
0
votes
0answers
48 views

how to make video autoplay on website in mobile using revolution slider

I understand that the video can't be played on mobile devices because of the ruling of the mobile data and other requirement. i also read comments on other articles on support. but i read some ...
0
votes
1answer
75 views

How to replace native comment_count with Comments Evolved aggregate count

What I Am Trying To DO I am using a plugin called Comments Evolved which aggregates comments that are tabbed from Faceook, G+, and WordPress native. I am trying to replace the native comments_number ...
0
votes
0answers
32 views

Retrieving meta values from database to CSV

I am working on this database in which the data is serialized and it's in a multidimensional array. I am trying to retrieve the data from WordPress into a CSV file. I read that WordPress automatically ...
0
votes
1answer
73 views

How to merge local and live databases?

We've been developing for Wordpress for several years and whilst our workflow has been upgraded at several points there's one thing that we've never solved... merging a local Wordpress database with a ...
0
votes
1answer
40 views

Custom contact form data does save in database

Here is my HTML part:- <input type="text" name="wd-name" /> <input type="submit" value="Send Message" name="send" /> Here is the php file:- function db_connect(){ global $wpdb; ...
1
vote
1answer
110 views

Remove css styles from specific page

I need to remove all theme (both child and parent) css styles from a singular page using functions.php in a child theme. Here's what I'm currently adding to the child's functions.php // import parent ...
0
votes
0answers
26 views

Tried creating a WP_query to add specific post category to page template

I am trying to add a specific post category to a page template but when refreshing my page just spins. Everything looks correct but it seems like my loop is infinitely looping. Can someone take a ...
0
votes
0answers
25 views

Best Way To Merge My Existing Custom User Database With WordPress?

I'm sure this has been asked before though I can't seem to find a clear answer or clear direction on how to handle this. I would appreciate a point in the right direction. I have an existing custom ...
1
vote
1answer
55 views

Modify custom field input data before creating a new post

I'm try to check input data before it is added to DB. For example: I have a custom post meta named book_isbn in post page. I want to make sure that this variable $_POST['book_isbn'] is valid before ...
0
votes
0answers
24 views

Option for en-queue and de-enqueue stylesheets

I wanted to create option in the admin area on a custom page to load and unload stylesheets or scripts using a dropdown option, only 1 can be selected at a time so when one is enqueued the other ...
0
votes
1answer
25 views

How to set the plugin load order when updating the active_plugins option?

When using the active_plugins option to update the list of active plugins, is it possible to set the plugin load order? For example: $plugins_to_activate = array( 'my-plugin/my-plugin.php', ...
-4
votes
1answer
143 views

Switch currency does not convert the amount in WPML and woocommerce?

am using woocommerce and WPML currency switcher The currency switcher is work in the product detail / product list page However, there are problems at the product cart / checkout page , 1) when I ...
0
votes
1answer
60 views

How to stop or remove an action being called inside a function of an extended class

The Problem I am trying to remove an JSON+LD block being added by a WordPress plugin called The Events Calendar. I believe it is being added by the function called: ...
1
vote
1answer
56 views

Admin Options page. Save as Array

I'm not great with PHP. I've just created a WordPress admin options page and it works OK: // Admin Menu add_action('admin_menu', 'my_cool_plugin_create_menu'); function my_cool_plugin_create_menu() { ...
0
votes
1answer
41 views

Do I need to prepare query before get_results(), get_row() and get_var()?

I know that we don't need to use prepare($query) when we put it in insert() and update() because these functions sanitize data for us but I'm not sure if we need to prepare query before putting it in ...
0
votes
2answers
37 views

How to add custom post meta to default blog post?

I have a code which calculates estimated reading time of a blog post (feel free to use it as you wish): function estimated_reading_time( $post ) { $words = str_word_count( strip_tags( ...
4
votes
2answers
303 views

the_author_meta() vs get_the_author_meta()

As far as I know, the_author_meta() automatically displays the data while get_the_author_meta() has to be echo-d, it can also be saved as variable and do something with it. Is there something else to ...
0
votes
1answer
158 views

Chosen Select jquery Not Working in Plugin

For some reason js and css files are not loading in my plugin. Here's what I have: (ostensibly unrelated code replaced with '...') class Location_Specific_Menu_Items { private static $instance = ...
0
votes
1answer
90 views

How to get post category list as select in front-end?

I use widget plugin Getting the random post & URL via ajax. I want to add function, that allows users on frontend choose category, and than display random posts from this category. function ...
0
votes
0answers
27 views

How to solve Undefined index: rules in class-wcml-dynamic-pricing.php

Just installed dynamic-pricing plugin. Developers made a misstake by forget to declare an index called rules. Now I get this error message:"Notice: Undefined index: rules in ...
0
votes
0answers
39 views

Custom email if woocommerce order quantity is more than 1

I'm trying to edit the default Woocommerce completed & processing emails that are sent after checking out with some conditional criteria. I have some info to include that is only relevant is a ...