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

learn more… | top users | synonyms (1)

0
votes
1answer
19 views

How to remove image on single product and get product to span page?

I'm using applay and have created some minor customisations with a child theme. I'm wanting to have a single product displayed without an image. I'm using this code in my theme's functions.php ...
3
votes
1answer
52 views

Correct regex for wp_embed_register_handler

THE GOAL I'm trying to parse a url and convert it to an embedded video player in my post's content but I think my regEx is off or I'm not creating a provider correctly. THE CODE Here is what I have ...
1
vote
2answers
44 views

What is a valid parent for get_terms()?

get_terms($taxonomy, array('parent' => $parent)); This works for some parents and returns an empty array for others. I checked if a term with the parent ID exists and if the same ID is in the ...
0
votes
0answers
25 views

Using wp_localize_script to output info from anchor text

I’m venturing into unfamiliar territory using a WordPress script that collects user data and saves it to the database, allowing administrator to access and manipulate that info. I need such because ...
0
votes
1answer
50 views

Paginated Comments “reply” does not work!

I use plugin Paginated Comments. I edit template and CSS in paginated-comments.php but "reply" does not work. "reply" does not appear at all. http://i.imgur.com/ieIeadO.jpg (There should be a button ...
0
votes
1answer
35 views

WordPress Custom Contact Form

So for my Custom Theme I've created a Custom Contact form and I have error messages but the thing is the error messages are showing even though it's the person first time on the page. Basically I only ...
1
vote
0answers
37 views

Change logo based on incoming domain

The agency I work for are trying to get a client's logo to change based upon the incoming URL. Now, we have 4 different URLs, therefore 4 different logos. Currently, we are using an if/else ...
0
votes
1answer
26 views

Display Content Based on Custom Field Value

I have the following code which is trying to show an image based on the value selected from a custom field in the admin screen. <?php if( get_field('bias') != 'Neutral' ) { ?> <img ...
0
votes
0answers
23 views

XML feed for Wordpress Social Board plugin modifications

At work, I've been tasked with modifying the Wordpress Social Board plugin by duplicating their RSS feed functionality to display an XML feed specific to our calendaring system. For example, this is ...
0
votes
0answers
23 views

How to tell where <title> tag is being pulled from

I'm working on a site, http://vibrantnation.com, and the meta info is jacked. I've looked in .header.php of both the child and parent theme, and it looks OK. I've checked plugins, like Yoasts' SEO ...
0
votes
1answer
17 views

When using shortcode, content stops generating after the_content

Yesterday I implemented a shortcode, but now my comments and related posts stop appearing. The source of a rendered page now only displays <div class="posts-group"> ...
1
vote
1answer
45 views

Some code in shortcode function being ignored

I have the following code that's part of the shortcodes for a plugin, and I've been trying to debug why it seems to skip a call to do_shortcode. To debug I've been trying to have it write to a log ...
0
votes
0answers
8 views

taxemony forech loop issue

I am trying to create tabs reviewing that child categories are in within the parent categories tabs tab heading will be the parent name and in that tab content will be the categories I tried to do it ...
0
votes
1answer
48 views

Reusable code that I can store in the function.php and apply to other templates as need. Dry Code

I am trying to apply reusable code to some single-posttype template and I was wonder if I can store the code somehow in the function.php and include it where i want to. Here is the code if ...
0
votes
1answer
9 views

the_post_thumbnail(); only works with fullsize images

The author of the theme, im using, used "the_post_thumbnail(array(120,120));" to define the thumbnail size. but for some reason, it only works with small banners (300x84), but i need those banners to ...
0
votes
1answer
49 views

how to make custom ajax handler?

i'm trying to make custom ajax handler because the admin-ajax.php is taking to long to handle ajax requests from 7s to 10s so i google it and mange to do some custom ajax-handler.php like this ...
0
votes
0answers
18 views

Edit PHP / “Categories Images” Plugin

I need to upload YouTube videos to one of the folders/categories using "Categories Images" plugin. I know it is designed to create a gallery of images only, but with the way the website is structured, ...
0
votes
1answer
13 views

Create 2-layered dropdown menus for custom taxonomy and custom post type

I want to display one dropdown menu with a list of values for a custom taxonomy. My taxonomy is "issue-year" and the dropdown would look like this: <select name="issue-year"> <option ...
0
votes
0answers
16 views

plugin development for woocommerce

i create this plugin: A discount in % for woocommerce price, but i have a problem: add_action( 'woocommerce_product_options_general_product_data', 'crele_add_custom_general_fields' ); add_action( ...
-1
votes
1answer
22 views

Get custom post fields and display them

I am using the wpfacet plugin. I have two custom fields: I am trying to display these by the following code: <?php while ( have_posts() ) : the_post(); ?> <span ...
4
votes
2answers
98 views

Why include a composer.json file with my plugin?

What is the advantage of explicitly including a composer.json file in my plugin if potential users of my plugin can already get it as a package through WPackagist?
0
votes
0answers
44 views

Warning: Invalid argument supplied for foreach() (custom post type)

Caveat: I'm a designer not a developer. I've created a custom post type called laptop. I've created a child theme of twentytwelve. I've set my front page to use the template laptops.php, which ...
0
votes
1answer
18 views

How to get property out of image object

Very new to php. i have the following var_dump($largeImage) that has the below output. I'm trying to get the thumbnail url. I have tried $tempLargeImage = $largeImage["url"]; $overlayImage = ...
0
votes
0answers
50 views

enqueue css in a wordpress plugin condition

I have found a bug in a wordpress plugin /plugins/woocommerce-eu-vat-assistant/ In checkout page if the option "Added possibility to make EU VAT field compulsory when the customer enters a company ...
0
votes
1answer
24 views

Custom User Registration script only allowing usernames with 16 characters

I'm noticing a weird issue on a custom User Registration page I'm using in WordPress. It seems as if WordPress will only accept usernames with 16 characters (NO MORE, NO LESS). The custom ...
0
votes
1answer
26 views

Why is it necessary to prevent direct access to included files?

Why is it necessary to prevent direct access to included files? For example: if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } I notice many plugins do this but I don't see ...
-2
votes
1answer
36 views

Where is the POST response body generated in PHP? [closed]

I am trying to understand a web app template for wordpress. They do not follow the POST/REDIRECT/GET pattern, and it's very annoying on an HTTPS website. There is a static page with a next button on ...
1
vote
1answer
34 views

My form action url is being prepended with a directory that does not exists

I'm trying to allow users to upload audio via form and HTTP POST request. Here is the relevant form code, from my page-profile.php : <form method="post" ...
1
vote
1answer
41 views

WP functions in .js

I have a huge main.js which includes 99% of my JS + plugins' JS. While loading time is a little bit longer when user visits the site for the first time, it gets cached and there will not be any other ...
1
vote
2answers
39 views

PHP code inside shortcodes

Basically, I have this line of code: <?php echo do_shortcode('[O_U user_name="operator" blocked_message="This page is restricted for guests."] **Content Goes here** [/O_U]'); ?> Now, inside ...
0
votes
0answers
30 views

Inline Styling a div from a Custom Metabox

I am building a custom page with repeatable metaboxes that controls content, images and background image. I am having issues when it comes to displaying the background image as an inline style. As of ...
0
votes
1answer
19 views

Set post title based on first h2 element in the content section

I have a front end editor set up for users to create posts and I would like to make it as simple as possible to create posts with the least amount of fields involved. Is it possible to generate the ...
1
vote
1answer
26 views

Checking array against author id in loop

So I have a function in Wordpress with a plugin that returns a list of friends as an array. The function code is here: function friends_get_list($tmp_uid, $friend_status=1) { global $wpdb; ...
0
votes
0answers
21 views

Displaying friend's posts only

So I am using the WPMU Dev friends plugin which adds functionality for WP members to search for friends and to add new friends etc. There is a specific function defined in the PHP file which says it ...
0
votes
0answers
37 views

Extreme delay on SMTP email with Contact Form7 after update wordpress on 4.0.4. Why?

I have a wordpress 4.0.2 with ContactForm7 and WP-Mail-SMTP plugin. My ContactForm7 form sends an email with smtp option within (1) second.No delay , everything fine. But If I update my wordpress ...
0
votes
2answers
20 views

PHP - Multiple variables in insert post array

I am currently creating a post programmatically, with the wp_insert_post function but am having some difficulties when adding two variables into the content part of the array. I would like to add ...
0
votes
0answers
28 views

update_user_meta and wp_update_user not working

I have an array of users that I've successfully updated as described here foreach ($users_out as $key_u => $value_u) { $user_id = $value_u['writer_id']; $user_login = $value_u['username']; ...
0
votes
0answers
38 views

Getting invalid user ID error when creating a new user with wp_insert_user

I'm trying to insert users into wordpress from a foreign database and I've prepared my $userdata as foreach ($users_out as $key_u => $value_u) { $user_id = $value_u['writer_id']; ...
0
votes
1answer
29 views

Create a Wordpress shortcode using PHP [duplicate]

I am currently using the following code within single.php (after the_content) This gets the store_name from custom field as $merchant from the post and then returns a list of products from that ...
2
votes
1answer
25 views

How can I add a specific, custom widget to my theme's header.php?

I've created a custom widget that I've named openingTimesWidget which extends the WP_Widgets class and follows the guidelines for creating widgets... What I'd now like to do is not only add this to a ...
1
vote
1answer
27 views

How Restrict access to admin dashboard by specific static ip?

i'm trying to restrict access to admin dashboard (wp-admin.php) by specific static ip so tried to add .htaccess to the wp-admin and set <FilesMatch "admin\.php$"> Order deny,allow Deny from ...
0
votes
1answer
33 views

get second ID from array

I need to get the second attachment ID from this function and put it into a separate custom field: add_action('pmxi_saved_post', 'replace_thumbnail', 10, 3); function replace_thumbnail($id) { ...
1
vote
1answer
24 views

Getting id of poll from WP database

So I have a php statement: $latest_pollsid that contains a number which increases by 1 every time a specific form is submitted. I am reading this statement into several functions and for one of these ...
1
vote
1answer
20 views

How to customize a permalink (URL) structure?

i am using $post->guid to get the URL of an attached file to my post. the output is something like this: http://example.com/foo/ [where foo is the file name]. now i want to make a URL like ...
11
votes
3answers
461 views

How to deprecate a function used in a plugin?

One of the functions I'm using in my plugin is polluting the global scope with a name that could collide with another function (used in another plugin). So, I guess I should deprecate it. But how ...
1
vote
1answer
13 views

Is it possible to add a custom page to a free Wordpress site? [closed]

I'm trying to add a custom page to my Wordpress website. I found this link, which says that I need to add the template to the theme folder, but I have a free Wordpress website, so I don't have access ...
-2
votes
1answer
20 views

Show post like this image in my newssite [closed]

I want to know how to query like this photo in my newssite for a category. See this image and help by give the query code. Do I use Offset or if else. How to query for this .
0
votes
0answers
20 views

Return a css class in functions.php snippet (WP Job Manager)

How can I trigger a CSS login lightbox when clicking on the "sign in" button on the following page (Wordpress Demo)?: http://workscout.in/post-a-job/ This is the CSS class that I found: <a ...
3
votes
3answers
59 views

How can I change Wordpress domain from remote to localhost?

I recently had a system crash and had to reinstall WordPress with my backup files. In the JavaScript log I began throwing errors pertaining to the domain and realized I was still using the remote ...
0
votes
1answer
64 views

PHP- Why is my contact form keep showing it is invalid? [closed]

I was working on contactus.php form. I am not testing whether the email will be sent to our account. However, my objective is when the form is invalid, it will reload the page and redirect user back ...