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

learn more… | top users | synonyms (1)

0
votes
1answer
20 views

Add code only for blog posts

I am trying to run a code only in blog posts, and another code only in single pages. But I can't even make a single working php if statement, that contains a wordpress conditional tag. In footer.php, ...
0
votes
1answer
35 views

Get all user meta by meta key instead of ID

I'm trying to compare user meta values to find highest and lowest values. I have a user meta value set up called "hourly_rate". I want to get the hourly rate for all users and then run PHP's min() and ...
0
votes
1answer
23 views

How to use `wp_insert_post()` and `get_permalink()` functions?

I'd like my script to post an article to Wordpress site automatically. Looks like Wordpress's wp_insert_post() function is what I need. But if I would include wp-includes/post.php file into my script ...
0
votes
1answer
27 views

“Maximum function nesting level of '100' reached” after adding a new filter

I am trying to filter my post title for a specific page and when a form is submitted on that page , for this I am trying to filter my title . Here is the code function filter_title_after() { ...
0
votes
0answers
11 views

Extra profile fields issue on Chrome

I'm using a custom function to create extra fields on WordPress profile editor, such as birthday, custom messages, etc. Two of them are image fields, so the user can upload custom cover and avatar. ...
0
votes
1answer
12 views

Why won't this wpdb get_results query return results?

Having trouble with this query. It returns an empty array even though I know the variables are correct and that multiple rows exist in the database that match. $results_a = $wpdb->get_results( ...
0
votes
0answers
6 views

Using Customizer value outside WordPress

I'm working on a theme which uses a custom PHP script for contact form. The jQuery sends the form data to the script and the script sends the email. There are some parts of the scripts that should be ...
0
votes
1answer
14 views

Must filter functions receive all arguments passed to them?

I'm writing a filter function to redirect logins: function my_filter_func( $redirect_to, $requested_redirect_to, $user) { // My code. } add_filter( 'login_redirect', 'my_filter_func', 10, 3 ); ...
0
votes
0answers
24 views

redirect after password reset by user roles

I'm not finding the answer to this one. We have a PHP script in place that works fine to redirect after password reset to a permalink ID. This is the code: // Redirect after password reset ...
0
votes
1answer
24 views

Editing Global Variables from Inside Functions

I'm working on my first plugin and I have two separate functions inside to accomplish two different task. Each function is added to a different hook, one using actions and the other using filters. ...
0
votes
0answers
22 views

Using $wpdb (WPDB class) 'replace' with multiple WHERE criteria problem

I have two fields that are used to identify a particular row (acting as a composite key). If it does not exist, I wish to insert a new row. The REPLACE function ...
0
votes
1answer
23 views

Blank <title> on static home page?

The <title> of each page on my site shows correctly with the following code: <title><?php wp_title(''); ?></title> But on my home page, which is set to a static page called ...
0
votes
1answer
25 views

Removing backstretch image from pages/posts

Homepage has a backstretch image which is also active throughout the site on posts and pages. How can I keep the backstretch on the homepage but hide it on posts or pages? pulled this from the ...
1
vote
1answer
137 views

Blank space at beginning of <title> tag?

The HTML output of all my WordPress pages has a blank space at the beginning of my <title> tag. You can see the effect here. My header template contains this: <title><?php ...
0
votes
0answers
63 views

500 (Internal Server Error) of external php file

I am currently using WP Web Scraper version 3.2. Once I insert the shortcode or template tag (php code) directly into my page, the plugin works perfectly fine and the values appear. I decided to place ...
0
votes
1answer
23 views

MySQL queries in Wordpress

I have a MySQL database table called stock which holds a stock record on items for sale. When querying the database using PHP I have no issue, but when I try to do it through WordPress it doesn't ...
0
votes
1answer
20 views

Styling admin page rows in order of importance (checkboxes)

I am altering a plugin's admin area and adding a checkbox for a "Coming Soon" option. As of now, when the user checks the "Coming Soon" checkbox, the entire row will turn green, but there is also the ...
0
votes
1answer
67 views

WP_Widget dynamic field array with external AJAX

Im creating Wordpress widget, where I have to add parts of code dynamically by JQUERY.ajax() a JQUERY.append() to the widget form. I need it, to be able to save it by function update(). I have PHP ...
0
votes
1answer
42 views

Custom Taxonomy Select Menu: Setting default option value?

I'm creating a series of select drop down menus that pull data from various taxonomies. I got this PHP script working for a WooCommerce attribute of color: function get_color_dropdown($taxonomies, ...
1
vote
0answers
25 views

Styling my own password protected page, how to deal with wrong password?

Per these instructions I've cooked up a custom password protected page for some of the pages on my site: <?php if ( post_password_required() ) { add_filter( 'the_password_form', ...
0
votes
0answers
28 views

Move next post link in PHP

I'm in a bit of a bother, given that my understanding of PHP is at a beginner's level, so could you help me? The problem is that my WP theme prints the previous/next post links at the top of the ...
0
votes
2answers
52 views

Place page title in header?

Normally, in WordPress, the page title appears in the content area. I'd like to have the page title appear in the header area. It looks like to do that, I'd have to remove it from its current location ...
2
votes
0answers
24 views

How can I use a $wp_customize to edit my homepage image slider?

This is my first post here, but I've been doing a bit of searching. I want to use the Custom Theme API to create add a customized theme control to add a new Image to a slider. Here is some of the ...
0
votes
0answers
14 views

Unable to make tabs active in HTML [migrated]

I have been working hours to make it work but finally I've to ask , so starting from beginning I want something like : I have come upto this : I just want to activate tabs like if I switch to other ...
0
votes
1answer
28 views

WordPress HTML Helper

I've played recently with WordPress Hooks and I've noticed that in order to create layouts based on the hooks the main practice is to use html in functions and combine them with logic. I've searched ...
0
votes
3answers
47 views

Unique PHP on each Page

I'm currently deciding whether or not to use WordPress or write my own code for a future website but I need to know one thing before I can make my final decision. Is it possible, with WordPress, to ...
0
votes
0answers
42 views

Wordpress pagination broken on blog page, working for search results page

My main blog page, and search keyword and category filter pages all pull in the same loop-blog-grid.php template, therefore all pull in <?php themeple_pagination(); ?>. The issue I'm having is ...
0
votes
1answer
19 views

Image Attachments of an Array into Flexslider

I'm using a third party wordpress plugin to incorporate realty listings into a website I'm making and I've set off trying to style the site to my needs. One of the problems I'm trying to solve is ...
0
votes
0answers
32 views

wpdb query using duplicate key to check update/insert

I am trying to use the query below to insert a row into my wp_postmeta table. If this row exists already e.g the meta_id key is not unique I need it to update this row with the meta_value at the end ...
0
votes
0answers
95 views

Frontend in WP , backend in Laravel. Some level of integration needed

I plan to use WP for my platform's frontend and Laravel 5 for my backend work. I will not use WP functionality for my core business. But i will need to have a forum in WP and some other lightweight ...
0
votes
1answer
26 views

How to Display a Single Post Excerpt

Is it possible to show the excerpt for a known and single post (on the Home Page) while in the loop? I tried each of these and none of them work: <?php echo the_excerpt('10'); ?> <?php echo ...
1
vote
0answers
21 views

Customize default settings on new sites on multisite

As the title states i need an approach to change default settings when a new site is created on my wordpress multi site. I guess its easiest to keep the code in a mu-plugin but can a go about having ...
0
votes
1answer
36 views

Adding unique marketing messages between certain products whilst using isotope/Infinite Scroll

I am currently using WooCommerce to display a list of products using the following loop to enable the post-type "product" be displayed and allow for pagination so I can use Infinite Scroll to smoothly ...
0
votes
1answer
23 views

Why doesn't global $wp_query not get hooked?

I have a plugin that helps me to make lazy loading on posts of a custom post type. The idea is to add an action to the template_redirect/init and get data from the global $wp_query to make jquery ...
0
votes
1answer
22 views

Get title attribute from galleries

I managed to get all the images of a gallery from another page using get_post_gallery() and I entered a description for each of them in the edit gallery window. I tried using get_image_tag() to get ...
0
votes
1answer
29 views

Create image with imagepng() (fails at header)

I've been struggling with some code for a custom theme. The result: Create an image with text. The problem: Fails at header: code on production. The funny this is that the function works perfectly ...
0
votes
1answer
54 views

Notice: Undefined index: fix with isset [closed]

I have a variable storing data like this. $eddreldlc_auto_play = array( 'loop_true' => array( 'value' => 'true', 'label' => 'True' ), 'loop_false' => array( ...
0
votes
1answer
22 views

Deregister and Dequeue Stylesheets From a Plugin and Enqueue a Child's Stylesheet/s

I'm trying to Deregister and Dequeue 3 Stylesheets from a Plugin (WP Listings) and Enqueue 3 Stylesheets within my Child Theme's directory. I have tried using the following code, but all 3 of the ...
0
votes
0answers
26 views

PHP call div with function

I might be showing my green-ness with PHP code here, but I need help. I've got divs that are all styled the same but have differing content, as they are related product snippets to be displayed on a ...
0
votes
0answers
27 views

Dynamic $pageTitle tag variable

Here is the header.php: <head> <meta charset="utf-8"> <title><?php echo $pageTitle;?></title> <meta name="Description" content="<?php ...
0
votes
1answer
36 views

How to add author's posts link (HTML + PHP) inside a function to output it

I have this function on a theme which is a bit of code for a slider: function get_article_slide( $title, $excerpt, $link_article, $url_image, $title_length, $alt_image = 'Alternative text' ) { ...
0
votes
0answers
35 views

2 loops with pagination on a single loop

On a page I want to always show the most recent post on top with a different layout, and have the rest of the posts listed below. So I created a template page with these 2 loops. But I cannot figure ...
0
votes
1answer
51 views

Php warning /wp-includes/capabilities.php on line 672 [WP 4.1] [closed]

I have trouble finding the cause of a PHP warning on a website I maintain: [08-Feb-2015 10:16:46 UTC] PHP Warning: Creating default object from empty value in [...]/wp-includes/capabilities.php on ...
0
votes
1answer
41 views

“Notice: Undefined variable: content” is showing [closed]

I am using this code if for showing related content form custom taxonomy. But it is showing "Notice: Undefined variable: content" Here is my code: <?php /* Plugin Name: Related Post */ ...
-2
votes
0answers
27 views

dynamically create fields for plugin

I'm trying to create one Plugin. I'm very new for this. For that I want to create N number of fields. So If I click Add button, text field should create dynamically with random id (without duplicate). ...
0
votes
1answer
28 views

Custom meta box save values issues - Deprecated: Function ereg() and more

I'm a WP theme dev nobie and I have problems with saving custom meta boxes values. I found some tutorial where its explained how to do this. I have included a file called custom-meta-boxes-save.php ...
0
votes
1answer
26 views

Syntax error in a shortcode function

I'm trying to implement a taboola ad unit in a shortcode function, but I'm getting a syntax error. Below is the function that creates the shortcode. The code is in my functions.php file. Can someone ...
0
votes
1answer
25 views

Include administrator in author list

I have this code that is displaying my last active authors. I also would like it to display WP administrators in this list. The code is: $authors = array(); $count = 0; $args=array( 'post_type' ...
0
votes
2answers
29 views

Accidentally deleted php code in Wordpress website [closed]

I have a website: www.convert2latex.com . While trying to remove the "continue reading", I accidentally deleted some code and updated it in the theme editor's functions.php. Now the website does not ...
0
votes
1answer
14 views

List of child pages fetch next results at link click

I have a list of child pages which are getting displayed as links to those pages. Im displaying it in a certain div with a maximum of 6 results. What I want is I have a "a href" which is called ...