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

learn more… | top users | synonyms (1)

1
vote
1answer
18 views

WordPress widget / plugin…fields not appearing in my widget

Trying to create my first plugin. A simple one. It's doing mainly what I want to do except the widget itself in Appearance-->Widgets doesn't display my fields. Wondering if anyone could point me in ...
0
votes
0answers
12 views

How to trim the_title() to X characters? [duplicate]

This is how I'm calling the_title(): <?php the_title( sprintf( '<h1 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h1>' ); ?> ...
0
votes
1answer
32 views

Change Wordpress Upload Folder using wp handle upload

Below code is for uploading file through a form ... I want to change the default upload path for the upload to a folder called abc in the root of my theme. I hope somebody can help me with this Below ...
0
votes
0answers
27 views

Attempting to display User Meta details from form

I have a form on my website that users can fill in when creating posts. One of the fields asks for their location (as below): <?php $locs = get_user_meta($uid, 'user_location', ...
0
votes
1answer
29 views

Trying to display user meta by “name” - not by “ID”

I have a form on my website where users can submit their own posts and one of the fields has a dropdown containing various countries so a user can enter their location. I would like this location to ...
0
votes
1answer
23 views

How I can shorten this title length?

I'm using WordPress as my CMS and one of the components of my site is master slider. It's a plugin to display posts in a slider. It takes the full post titles and puts them in the slider. I want to ...
0
votes
0answers
10 views

Click on link to filter displayed posts like what we can see on products page

**I wanna know if there is a way to filter displaying post on clicking on menu or a link. I know that there is some ways for admin post list, but i want it for front pages. I think we can do that ...
0
votes
3answers
55 views

How can I edit HTML page codes in a theme?

I am using a replete theme for a web using a commercial things. Anyway, I am trying to edit(particularly, remove) some HTML tags on main front page but I cannot find out which php file includes the ...
-1
votes
1answer
30 views

Check if username doesn't exists

I have a script that imports users via an .csv file. The script checks if a user exists and if so updates it's metadata. If the user does exists but the "status" field contains the word 'archived' it ...
0
votes
2answers
48 views

Redirect homepage /page/1/ to /blog/page/1/

After switching from the homepage displaying latest blog posts on urls /page/1/ /page/2/ etc to a static front page with the posts displayed on /blog/page/1/ we would like to redirect the original ...
0
votes
0answers
11 views

Filter displaying posts

I wanna know if there is a way to filter displaying post on clicking on menu or a link. I know that there is some ways for admin post list, but i want it for front pages. I think we can do that by ...
0
votes
1answer
20 views

How to insert data from metabox to custom table

I have created a custom table to save post data from custom meta box And I have a problem in saving data from custom meta box to custom table so this is my function save_meeting_meta_box() ...
0
votes
2answers
75 views

Woocommerce: deleted single-product.php, everything still works. How is it possible?

I'm trying to customize single-product.php to achieve the often requested different categories = different single product templates, but it seems this file it's not affecting anything at all. It's ...
0
votes
0answers
10 views

custom forgotpassword and hook for additional function

I have other app and a wordpress, whenever if there is a lost password request in the wordpress, it will also trigger for lost password request and other function for the app API.. the password ...
0
votes
1answer
31 views

Warning: array_pop() expects parameter 1 to be array, boolean given

Getting the following php error when trying to add a new post: Warning: array_pop() expects parameter 1 to be array, boolean given in ...
0
votes
0answers
20 views

Create a Function to reference a certain file

Ok, so Imagine user N changes the design on settings to flat ui, the file changes to Framework/styles/flat/style.css from Framework/styles/default/style.css. How can I achieve this? This is possibly ...
3
votes
3answers
150 views

The correct method to pass query vars in AJAX using ajaxurl

OK, I had no idea how to title this topic. I'm trying to override the default behavior with ajax. The problem here is not actually a problem, but a wish more. I have this url: <a ...
0
votes
2answers
69 views

Active class not working on custom menu link using add_menu_page

i have created new custom menu that act like link to some page using this code: add_menu_page( __( 'Gallery', '' ), __( 'Gallery', '' ), 'edit_posts', 'post.php?post='. $gallery_page_id ...
0
votes
0answers
17 views

Calling the correct permalink via form action

Okay, I have a bit of an issue with my sites search widget If you go to this category page (for example): http://socialvenues.com.au/melbourne/function-rooms then select a region and then city (for ...
-1
votes
0answers
50 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
1answer
16 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
23 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. ...
0
votes
1answer
22 views

Wordpress Site front End and Back End Loading Slowly

I have my personal portfolio site which takes long time to load. After login to wp-admin, it takes longer time to open all the contents of site. I am surprised why this problem came to my site. Also ...
-3
votes
1answer
41 views

PHP if url extension action=discussion condition use [closed]

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
29 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
12 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
26 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
16 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
32 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
23 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
3answers
45 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
1answer
58 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
47 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
46 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
72 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
21 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
44 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
15 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 ...
0
votes
0answers
33 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
34 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
20 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
42 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
14 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
23 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
43 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
40 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
21 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
47 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 ...