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

learn more… | top users | synonyms (1)

0
votes
0answers
7 views

Organization of different portfolio under a user in WordPress

I would like to be able to organize properties (real estate) in projects. Every property will be assigned to a project. Some properties will be assigned to the same project. This would likely be done ...
0
votes
0answers
42 views

Workaround for PHP Limit for image upload: How to use a local installation to get images online?

I have the common problem while uploading images, that I get the fatal out of memory error. Fatal error: Out of memory (allocated 40632320) (tried to allocate 5120 bytes) in ...
0
votes
1answer
17 views

WordPress styling recent post

Trying to replicate the theme shown here http://i.imgur.com/k60YtiX.png. As you can see on the screenshot the first post is black and the second post is a grey colour. My progress so far is just at ...
0
votes
1answer
16 views

if user is admin display admin link and logout link else display logout only

Like the title suggest I would like to create a conditional with the ability to if user is admin display admin link and logout link else display logout only in wordpress. I have created this ...
0
votes
1answer
21 views

WordPress rating by views [closed]

I am trying to create a system much like the one on this website. http://i.imgur.com/0trw2c3.png What happens is, if the post has over 1,000 views it gives it a nice little icon above the featured ...
0
votes
1answer
32 views

Function returns post URLs rather than retrieving Facebook Graph API data

require('../wp-blog-header.php'); query_posts('&showposts=-1&order=ASC'); while (have_posts()) : the_post(); $url = the_permalink(); $json = file_get_contents( ...
0
votes
0answers
15 views

How to move posts in featured category on top and keep pagination

I want to move every post from category_id = 11 and 10 on top of the list and then query every other post which is only in 10th. I thought that making two loops will do the trick but there is a ...
0
votes
1answer
24 views

Registration form not registering First and Last name

I'm creating a custom registration form which works using username and email inputs, but when I include First and Last name fields it won't let me register. Here is the form: <form ...
1
vote
1answer
24 views

Add before_content and after_content to register_sidebar

Is there any way to add two new functions, before_content and after_content to the register_sidebar function? These would work like before_title and after_title, except it would wrap everything that ...
0
votes
1answer
30 views

403 (Forbidden) delete file image in themer folder

I'm having trouble with permission to delete files that are within the theme folder. All folders and files are with permission 775 and there is no error in the code , because when I use the code in a ...
0
votes
1answer
28 views

Genesis / custom template page / setting the page title and meta desc

My WP site is running Genesis. I've just implemented my first custom page template in a child theme. The template runs some PHP and makes some data available to any page based on the template using ...
0
votes
0answers
32 views

Ajax is running my insert query twice

I am working in WordPress and I run a function to insert a row in database with ajax. Ajax runs but for some reason insert operation is performed twice. Below is my code Ajax jQuery(function ($) { ...
0
votes
2answers
24 views

Add categorys to custom post type not working

register_post_type("butik", [ "labels" => [ "name" => "Butik", "singular_name" => "Butik" ], "show_ui" => true, 'public' => true, 'rewrite' => [ ...
0
votes
1answer
19 views

Adding “redirect” to a button

So, I have the following code: <?php if ( I_delete_user($user_id) || $demo_site->request_verification($user_id) || isset( $args["{$template}_button_primary"] ) || isset( ...
0
votes
0answers
25 views

Use result of first ajax call to trigger another

I am working in wordpress. I have below form 1 which is a search form and when I press search I get results with ajax. Now the result rows have button or link which when clicked should trigger another ...
0
votes
0answers
4 views

How can I set a subsection page for a plugin e.g ?page=_&subsection=subsection_page

How can I set a subsection page for a plugin ? I noticed some plugins have 2 settings pages as follows: Main one: options-general.php?page=page Subsection: ...
0
votes
0answers
23 views

Integrate my site with Wordpress login system

Hello I would lite to use the login system from wordpress and use on my other project. I found this code: require('../wp-blog-header.php'); if ( is_user_logged_in() ) { echo 'Welcome, registered ...
0
votes
1answer
17 views

Removing get_template_part in child theme

Parent Theme loads some template files in its functions.php as follows: get_template_part ('lib/login/register.php'); I want to remove this file in child theme and include my custom php templates. ...
0
votes
0answers
19 views

Ordering by custom post meta key

I'm using the plugin WP Job Manager, and have a custom field with the meta_key "rating". I want to be able to order listings by rating, using "orderby". Normally for posts I imagine it would be ...
0
votes
0answers
24 views

site_url() returns with additional backslashes

I am using site_url() function and it returns the address as http:\/\/vip.local\/cc where I can see that WP automatically adds unnecessary backslashes. Is this for some escaping purpose? I tried using ...
0
votes
1answer
28 views

Can not manually create a database ( db, user, pass ) for a plugin

So I was working on a plugin and I needed to cache some third party API access, and I needed to manually create a database upon plugin activation or upgrade. The caching stuff needs a database host ( ...
0
votes
0answers
68 views

Limit the number of successful logins

I would like to retrieve the number of successful logins of a user and act accordingly. If user logged in more than 10 times, then log out user automatically with wp_logout() or similar. I would ...
1
vote
1answer
32 views

How to build an API as a plugin

I want to create a REST API endpoint for a wordpress site where I can get a JSON response for different queries. I have tried the tutorial here, but I cant seem to figure out how it works. Do I need ...
0
votes
0answers
62 views

Genesis custom post type pagination with custom taxonomy query loop

I am trying to create Genesis pagination for a page housing all posts from a particular taxonomy. I would use the many solutions given in this WordPress Stack Exchange but I can't figure out how to ...
0
votes
1answer
31 views

How to trigger WooCommerce order complete email?

I want to be able to trigger the WooCommerce order complete email at a different stage in the WooCommerce checkout process. So I've disabled WooCommerce order complete email from the backend and am ...
0
votes
2answers
53 views

Inserting dynamic content into a page

I see this subject comes up regularly but have not seen an answer to my specific requirement yet. I'm trying to use a WordPress page as a template and insert database-sourced content (about 20 or so ...
0
votes
1answer
20 views

add custom tags for custom post type in wordpress

I have many custom post type and I want two of them to be relate by tags. These tags are only useable to these two custom post type only. like I have two custom post type 1. books 2. writer and I ...
0
votes
1answer
18 views

Trying to run website a php file is blank

I have a local copy of a website I am working on and I just found that the index.php files are almost empty. They contain only an opening php tag followed by a commend that says: "Silience is golden." ...
5
votes
2answers
273 views

Why do you need to wrap a function inside array($this, function)

I'm a newbie at PHP and wordpress so please be gentle! I'm building a plugin - following a few tutorials, getting it all working. My question is why is the function I want to call wrapped up in the ...
0
votes
1answer
40 views

Advanced Custom Fields not displaying

my php skills are pretty limited and I am pretty much stuck with the following issue. Why is my Custom Field (placed at the bottom) not showing up after the posts blocks? Here is what my code looks ...
0
votes
1answer
55 views

Get all taxonomies for all post types

I would like to get all the available taxonomy for each (custom) post type. My aim is to list for each post type, each taxonomy like category, tag and for each of these taxonomy to get all register ...
0
votes
1answer
14 views

get_term_link() returns correct - But illogical error-messages disturb

I've a really strange issue with Wordpress and the get_the_link()-function and a following issue with objects who are objects, but identified as non-object-error, itself they are working. First the ...
1
vote
1answer
28 views

Get posts with at least one category in common with current post?

In single.php : I want to get all posts with at least one category in common with the current post. I tried reading through the wordpress codex documentation but I found it rather confusing (I'm ...
0
votes
1answer
48 views

Ajax button not working

So i'm trying to make a follow button in wp, and for some reason the ajax button isn't working right. Here are the steps of what's supposed to happen user clicks #followbtn Ajax goes to $_POST ...
0
votes
1answer
28 views

How to refresh a template page on Wordpress in 3 seconds - easiest method?

Basically, on my site I have content submitted via a search bar. I'm using a content-none template to detect if the user is signed in - and if so it submits a post programmatically (if the post ...
0
votes
1answer
26 views

How to call a certain object/menubar in a PHP file

I made a template and had some help with adding a CSS file to the template. Now I'm stuck on the question, how do I add a certain menubar to my header. Example: topbar - has menu with "Welcome ...
0
votes
2answers
39 views

How to add new CSS file to new PHP file

I've made a new template file for Wordpress constructing the elements of the page via PHP and Wordpress recognizes the template as such. Then I wanted to include a CSS file for said template (same ...
0
votes
1answer
62 views

How can I pass a variable to wp_ajax action?

I'm writing a plugin that pulls data from an external API and inserts it into a bbPress topic. Here's some sample code: function bbp_ajax() { $topic_id = bbp_get_topic_id(); $the_issue_key = ...
0
votes
1answer
23 views

Are widget arguments always set inside My_Widget::widget()?

Specifically, are the before_widget, after_widget, before_title and before_title array keys always set inside My_Widget::widget()? I'm wondering if statements such as the following are necessary ...
0
votes
1answer
38 views

List users by meta_key and meta_value

The following function will display a list of users based on their meta data: <?php function get_users_by_meta_data( $meta_key, $meta_value ) { $user_query = new WP_User_Query( array( ...
0
votes
0answers
30 views

Headers Already Sent

I know this is a favorite error! I understand the principles but I can't see why this code would create this error. page.php includes a get_template_part. I have a test page that renders and does a ...
0
votes
0answers
44 views

Getting most popular posts based on Facebook comments count

I have modified a widget to display the total number of Facebook comments on a post rather than the total wordpress comments. I can get that part to show correctly, but I would like to get the most ...
0
votes
1answer
41 views

Wordpress get_post_meta issue

I'm new to php and was assigned some code to fix within a Wordpress theme, but I cannot figure it out for anything. The code is for the home page of a custom theme and it is supposed to pull the most ...
0
votes
1answer
62 views

Woocommerce Price Text

I'm trying to show after the price of my product, whether the price is 'per person' or 'per group'. I've created a custom field for both, so for example, if custom field 'price_per_person' is ticked, ...
0
votes
2answers
64 views

Wordpress SQL injection

How to make below code safe from sql injection ... I am working in wordpress. global $wpdb; if($wpdb->insert( 'votes', array( 'votes' => ...
0
votes
1answer
65 views

Web scraping using transients

I'm using xPath to scrape tour dates from another website (with permission of course). Since it updates on every page load, I thought about using transients to store the data. Unfortunately I have no ...
0
votes
1answer
33 views

How to fix blank pagination links?

I am working on a Wordpress blog that has what appears to be custom pagination for the posts. As you can see here the correct amount of links are being rendered at the bottom of the page, however ...
0
votes
1answer
29 views

PHP Parse error on WP-CLI, not on web server

I have a network of over a hundred sites and I try to use wp-cli to make bulk changes to many of these. Particularly to their wp_x_options table via wp --url=site.url option update However, wp ...
0
votes
0answers
14 views

Notice: Trying to get property of non-object in WordPress if Debug is TRUE

I am writing a plugin for WordPress. I have created a Class as singleton pattern Class code /* * This I have refered from BuddyPress and trying to learn from it :) */ class AssessmentTest { ...
0
votes
0answers
42 views

Define category ID using get_post_meta

I need to define the Category ID in my singles page through custom fields so that i can load a different category depending on the page. This is what i have so far and its not working. Any help would ...