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

learn more… | top users | synonyms (1)

0
votes
1answer
44 views

Controlling image output size ACF repeater [closed]

I am using ACF repeater and am not able to control the output size incorporating Wordpress theme support custom image sizes add_theme_support('post-thumbnails'); add_image_size('large', 700, ...
0
votes
1answer
24 views

Nav menu from plugin to theme

I would to take nav menu reference (I have id and class) from plugin to theme header.php...How can I do this? I used something like this<?php wp_nav_menu('id'); ?> but of course with failure ...
3
votes
1answer
42 views

wp_get_attachment_url filter won't accept two arguments

Here is the specification for the filter for the wp_get_attachment_url filter: /** * Filter the attachment URL. * * @since 2.1.0 * * @param string $url URL for the given attachment. * ...
0
votes
2answers
37 views

Using wordpress function to retrieve data

I have been working on open source plugin and trying to add a new feature to it. For now I have been doing like this else if( $selected_report == "greport" ) { $sql = mysql_query( "SELECT ...
0
votes
0answers
19 views

wordpress query between zipcodes not working

Ok, I have this code that checks for zipcodes in the database, normally I can simply do a between query, but the zipcodes are stored in the following way: zip_code::2025 (meta_value in the usermeta ...
1
vote
2answers
32 views

ACF check if variable has http, if else return string

Trying to check if $link has http:// in front of it or not. If someone puts in www.google.com for the link field it acts as a link within the WordPress site, ie: www.website.com/www.google.com. $link ...
0
votes
1answer
23 views

Creating a child theme after numerous edits to parent theme

So a quick explanation: I started messing with Wordpress a couple of years ago, having experience with HTML, CSS and some PHP. At that time I was paid a few hundred bucks to whip together a ...
0
votes
0answers
27 views

Single-{custom}.php doesn't exist not matter what I do

This question has been asked and re-asked, I know because I've found every one of them here already. I don't know why I can't find the hint that I've messed differently than others so after hours of ...
0
votes
0answers
21 views

Converting Static HTML to Wordpress using little wordpress functionality

I'm trying to convert a site that was built as a standalone HTML site with various assets based off of the Smarty template that also includes custom CSS and JS. The site has a total of 6 pages with ...
2
votes
0answers
32 views

category_name not working (not showing up in sql query debug)

My plugin has a shortcode and it retrieves animals. There are filters/arguments and they all work well except the category argument or parameter. The category name(s) is/are well passed to my ...
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
21 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
39 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
12 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
65 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
38 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
27 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
15 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
33 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
23 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
29 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
50 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
58 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
17 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
47 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
44 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
34 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
50 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
51 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
0answers
174 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
45 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
26 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
71 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
15 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
37 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
39 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
67 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
31 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
58 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
37 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; ...
0
votes
1answer
77 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
22 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
50 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
22 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
23 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', ...