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

learn more… | top users | synonyms (1)

-1
votes
0answers
37 views

Form Entries Only Displaying Sometimes

I created a custom lead generation tool for real estate agents using wordpress multisite and a plugin called Formidable. Since there are multiple forms, I had a programmer custom code the entries into ...
0
votes
0answers
16 views

Wp Redirect plug in [on hold]

So I installed a new plug in, in lieu of writing the code to redirect mobile users to my mobile site. The plug in now redirects ALL users to mobile site, including desktop users. All sub domains ...
0
votes
1answer
10 views

Modify arguments for parent theme's `wp_register_style` via child theme

Working on a child theme for site with a good deal of separate stylesheets being registered/enqueued from the theme and plugins. I'd like to change some attributes of the <link> tags in the ...
0
votes
0answers
8 views

How can I set and use a cookie on page load?

So I can set a cookie using the below code, and use the cookie I have created when the page gets refreshed problem is I need to set the cookie and use the cookie when the user first loads the sites. ...
-3
votes
1answer
24 views

PHP if url extension action=discussion condition use [on hold]

I want use some style only for url extension /?action=discussion How can I use it by PHP condition?
0
votes
2answers
22 views

Accessing a protected property of a post

Fatal error: Cannot access protected property Some_Plugin::$_some_property What is the best/least-destructive way of accessing a protected property attached to a post. The property is being ...
0
votes
1answer
26 views

how to enqueque code in a php file from functions.php

Im building a website with wordpress, using a child theme. there is a file in the main theme folders, called entry.php that is where I need to add a bit of php at the bottom of this document. I don't ...
-1
votes
0answers
9 views

How to display Categories as a index page style (wordpress)

Actually this code from archive.php template parament I want to style the category pages can anyone help me regarding this <div id="main" role="main"> <header id="introduction" ...
0
votes
1answer
21 views

Wordpress Rewrite Issue

I created a custom taxonomy, two actually (one tag and one category), for a page that lists a series of community projects. This is the parent URL: website.com/community If you go here you'll see ...
0
votes
1answer
13 views

Cannot access variables within a widget

I'm currently learning PHP and Wordpress development from a Java background at the moment. How do I access variables in public function Example_Widget() from public function widget( $args, $instance ...
0
votes
1answer
28 views

'global' not working in wordpress?

My wordpress theme consists of the file loop.php which just does this: <?php include("AAAA.php"); ?>. Now AAAA.php looks like this: <?php $test = 1; function f() { global $test; ...
0
votes
1answer
18 views

Adding theme strings to .PO file

I'm trying to translate some strings in a WP theme I'm using, but apparently there are some differences in the PHP code. Here's an example: <?php echo apply_filters( 'jobboard_job_posted_text', ...
0
votes
2answers
27 views

Creating Wordpress Shortcode with Variable

please forgive me I'm relatively new to PHP... I would like to create a shortcode called [city-name] and have tried placing the following code in my functions.php file: function get_city_name() { ...
0
votes
0answers
15 views

Call to undefined function problem [closed]

I'm really blind about this one ... problem is that it seems my Wordpress website which has one of real estate themes installed can't load properly (it loads partially with this error shown): Call to ...
0
votes
1answer
46 views

Replace content in Wordpress Page after GET from php page

I have a wordpress Page with an html form where i get username and password from my customers. Then i send to an external php page located in another my server and get the result from inserted ...
0
votes
1answer
41 views

Plugin not working locally, but works on server

This is a hail Mary throw, but I appreciate any ideas that could point me in the right direction. I had a "plugin" created for my wordpress site. I have a live site that is on a server and one that ...
0
votes
0answers
30 views

Dynamic data from external database - display in several WP sites

I have looked at similar questions, they don't seem to answer my specific question. I have an external database (not using tables in the WP database). I have several sites that need to pull dynamic ...
0
votes
2answers
57 views

Inserting custom PHP script on homepage

I have a simple PHP script that I want to load whenever someone lands on a homepage. It is fetching data from another service and then I have to display it in a container on the homepage. I was ...
0
votes
0answers
11 views

Query from metadata where meta_value is array [closed]

I want to create a MySQL select function where I need to check if a value is in an array. I Googled and found that I should use the IN function but I don't know how to construct it. So here is the ...
0
votes
0answers
19 views

How to make post title determine category in wordpress

Is there any way to assign a post automatically to a category depending on the title of the post ! Suppose : Post title - This is a test post I want the post to automitically assign to category ...
0
votes
1answer
24 views

WordPress vs. Custom PHP [closed]

My client has NGO website built in custom PHP, he approached me for its revamp. I told him to build it in WordPress. But he has following concerns; and asked me WordPress vs. Custom PHP comparison. ...
0
votes
0answers
11 views

Plugin “Relocate Upload” errors [closed]

I am using the plugin, Relocate Upload so that I can move some uploaded files to a specified folder. I get the following error when I move a file... Warning: Illegal string offset 'sizes' in ...
0
votes
0answers
11 views

Merge PHp script into Wordpress MU for multi-tenancy

I have a PHP script with 2 database tables, one of which is named "options". I have installed a fresh Wordpress install, and I noticed the database table "options". I would like to create a ...
-1
votes
0answers
36 views

add upload image on custom post type wordpress [closed]

I have created a custom type post on wordpress, when i have added file upload I couldn't save and get the image, so if there is anyway to solve this problem show me how. an other thing how can i show ...
0
votes
0answers
29 views

Use This Code in Frontend

I am using this code, adapted to my needs: <?php /** * Plugin Name: YLDist Profile Checkboxes * Plugin URI: * Description: Profiles * Author: JPowersFreelancing * Author URI: * Version: 1.0 ...
1
vote
1answer
30 views

WSoD being caused by this piece of code

This is a function I'm writing which is supposed to post an input along with some other information, to a database. As of right now, activating the plugin produces a WSoD, when the function is removed ...
0
votes
1answer
9 views

How to make in WordPress admin panel sortable column for the custom field, that count the number of page impressions?

Good day! I try to make display post counter for WordPress. Output count of views function getPostViews($postID){ $count_key = 'post_views_count'; $count = get_post_meta($postID, $count_key, true); ...
0
votes
2answers
32 views

Adding php directly into widget shortcode

So here is my button shortcode in my widget. [button title="EDIT" href="<?php ech edit_product_url( $post->ID ); ?>"] As you can guess the href url does not work. What would be the best ...
0
votes
0answers
13 views

Empty result when trying to fetc post in the future

I am trying to fetch a single post that is either scheduled or published using a custom WP Query. The query is running asynchronously. However I get no results. Here is my code: ... $args = array( ...
0
votes
0answers
15 views

How to change html generated by wordpress media uploader

I have managed to change the output of wordpress media uploader using image_send_to_editor exampled below (where the output is image:($url)) However I want to do the same with other files like ...
0
votes
0answers
38 views

How to add pagination into post showing

I have created a plugin to display all posts on any page by short code. But how do I add pagination? global $wpdb; query_posts('cat='.$cat); $table_name = $wpdb->prefix . "advertisement"; ...
0
votes
0answers
30 views

Auto remove empty values in array

I have a custom meta box that let's users add new fields. If the fields are saved the values are stored in an array. If a user wants to delete a certain value he empties the field and saves the page ...
0
votes
0answers
3 views

PHP API With JSON [migrated]

I have been trying to call a JSON feed using PHP the code I have used so far is $json = file_get_contents( 'http://football-api.com/api/?Action=standings&APIKey=********' ); $team_data = ...
0
votes
0answers
20 views

Why is the_permalink only echoing the base category?

0 down vote favorite I am running the following code on Wordpress: <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <li><?php the_permalink() ?>,<?php the_ID() ...
0
votes
1answer
22 views

Add a wp editor to custom plugin and save data

I'm creating a custom plugin. One of the fields in the plugin let's the user add data. If I add a textarea the user has no control over the text. So I would like to add a editor. I know WordPress ...
0
votes
0answers
17 views

Flickr Widget not working [closed]

I am currently trying to build a flickr widget with the help of this tutorial. I don't know what is the use of API Key and phpFlickr as mentioned in this tutorial. I did everything correct but some ...
0
votes
0answers
14 views

Creating a text file in plugin directory not working

I am creating a plugin that in admin end will create a text.file but when I tried it, no text file were created. this is my code.. if($_POST['pluginvalue_hidden'] == 'Y') { ...
-1
votes
0answers
12 views

PHP error with Wordpress Grid/List Toggle plugin

Having an issue after I installed the WooCommerce Grid/List Toggle plug-in. After installing, I'm getting errors above my header like this: Warning: preg_match() [function.preg-match]: Compilation ...
1
vote
1answer
30 views

Get data from database using $WPDB

I'm missing something here. I simply want to get data from my database. So I tried this but keeps giving me an error. global $wpdb; $sql = "SELECT * FROM $wpdb->postmeta WHERE group='$group'"; ...
0
votes
1answer
17 views

How to Generate a list of Most Commented post?

I'm trying to call a list of most commented post. But the call to the DB returns always the same post (the first one in the loop) This is my code in functions.php function ...
0
votes
1answer
27 views

Would it be possible to route Wordpress Through an MVC Application

I have a slim framework application in the root directory /. I have a wordpress install in the '/blog/' child directory. This is all fine and well as i can easily access the /blog/ folder and any ...
0
votes
1answer
70 views

Jquery ajax to custom php file: returning blank data

I created a custom php file, put it in my folder. The files does insert some data to the database to a custom table i created. require wp_path() . "/wp-load.php"; global $wpdb; $favorite_table = ...
0
votes
1answer
21 views

Using wp_send_json to return HTML

I don't understand how to return HTML correctly via AJAX. I have this routine function DisplayEventInfoBox() { ?> <div id="eventInfo"> <div class="avail-from cart-right"> ...
0
votes
1answer
17 views

unable to set uploaded file via frontend form as featured image

i have a form that allows input of name ,email & photo...when i click on submit i want it to insert a row into the posttype called'contact' with the info submitted by the form and the image as the ...
0
votes
1answer
17 views

Result from wp_send_json adds line feed

I've got a local Windows stack running AMPPS at 5.4.35 and my code runs fine but when I deploy to my Bluehost server running PHP 5.4.28 the execution of wp_send_json is different. wp_send_json( ...
0
votes
0answers
14 views

PHP Wordpress Monthly Top Author in Sidebar

Im trying to show List of Top Author by Property Update Count (Monthly) in my sidebar. How to adjust this php code. This php only show AUTHOR list in my sidebar, not sort it by Monthly Property Update ...
-1
votes
1answer
21 views

unable to insert post into database [closed]

i have a form that allows input of name ,email & photo...when i click on submit i want it to insert a row into the posttype called'contact' with the info submitted by the form and the image as the ...
0
votes
1answer
23 views

custom plugin with upload files does not work

I an creating a custom plugin that used shortcodes.. then it will have a feature that will upload files and stores it in wp-content/uploads/ directory.. but it seems I got an error.. Warning: ...
0
votes
0answers
32 views

How to run ajax in Wordpress Post?

I am trying to use ajax in wordpress I have two comboboxes in single-meetings.php the second combobox values are based on selection from the first one here is my single-meetings.php <form ...
0
votes
1answer
11 views

Rewriting to a different page based on existence of query string?

I have a home page (id = 4) and a form page (id = 5). I want to send them back to the home page if they don't have a query string. But if they do have the query string we are looking for, then I want ...