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

learn more… | top users | synonyms (1)

0
votes
0answers
2 views

Sanitize and send checkbox results using WP Page Template

I have a WordPress website that includes a booking form on a page template. As I am unfamiliar with PHP, I'm not too sure exactly which lines of code are needed in order to come up with a solution, ...
0
votes
0answers
10 views

Shortcode not passing variable to included file

I set up a shortcode which includes a standard php/html form file. In the form I have a hidden field where the value is a variable which is meant to be available in the form via the shortcode ...
0
votes
0answers
17 views

Add classes to individual sidebars

This is my first time posting on here so let me know if I don't follow any rules or best practices. I'm creating several sidebars through our WordPress site and not all of them will be styled the ...
-1
votes
1answer
10 views

Strict Standards: Non-static method in sidebar generator

I used this sidebar generator in my theme functions.php and this plugin work perfectly! No errors. But when I open define('WP_DEBUG', true) I got some error. I know that I have to set wp_debug to ...
0
votes
0answers
16 views

calling a function from a class in your template

ok, so I have created a plugin in Wordpress. I want to be able to use some values I have created in a function within my template but I just don't seem to be able to get it to work. I have created my ...
0
votes
0answers
3 views

calculating sums for dynamically added form elements [migrated]

I have below form, where each .form-row is dynamically added using jQuery when user clicks on Add New button. My html form (simplified) <div id="total_sum"> <!-- here will show up total ...
-1
votes
0answers
22 views

query post_per_page for current archives

I'm trying to define the number of post to display in my slider for my archive templates. here is the code: <div class="flexslider"> <ul class="slides"> <?php ...
-1
votes
0answers
38 views

display post of the year/month/week in slider for archive template

I'm building a archive template, which show the post by year; month; and week. However, this archive template has a slider, which as the moment display the last post created - so it doesnt match the ...
0
votes
1answer
26 views

Insert double entry in DB

I created plugin and my plugin create new Table in DB. My problem is when user type something in field firstname, lastname... and click on button Submit, that go to my table and that is ok.. but then ...
-1
votes
1answer
42 views

limit number of post for achive page

Im trying to limit the number of post for my archive page, in a specific category. I've manage to display post from just the category I desire, However, if i setup a loop to limit the number of ...
0
votes
0answers
16 views

Single page of CPT

I'm trying to create a single page of a CPT. My cpt: <?php // CONVENZIONI CPT + TAXONOMY function cpt_convenzioni() { $labels = array( 'name' => _x( 'Convenzioni', ...
-1
votes
0answers
18 views

Create multi level Archives by Year - Month - Week

Im trying to realise a multi level menu ( by hover) of the archives post. I'd like it work like a multilevel dropdown list menu, First level should be the Year; second level the month; last level ...
-1
votes
0answers
20 views

get_page_by_path(), get_the_title() is creating Auto Draft status for site [on hold]

Similar to this solution: how to get page id of a page using page slug I have the following function that works. function show_specific_post($path) { $spec_post = get_page_by_path($path); $ID ...
0
votes
1answer
14 views

Does anyone know all parameters of get_comments()

Here is the link. There is a lot of parameters that didn't explain yet, and I want to know all about it. Thought, I have try to read the code, but can not understand it at all. The more I try to read ...
0
votes
1answer
19 views

mysqli_real_connect() - authentication method unknown to the client Warnings

I keep getting the following warnings in my debug log: PHP Warning: mysqli_real_connect(): The server requested authentication method unknown to the client [mysql_old_password] in ...
0
votes
0answers
23 views

Dynamically load content based on Title and Category

After googling for about 2 days now without finding the proper answer - and I must commit that I'm not that well educated in php programming, I hope the community may provide me with the correct ...
0
votes
2answers
23 views

upload images on front by user using form

I'm using a form on my website using wordpress to allow users to create posts. It works perfectly fine, I'm abble to assign the posts to a custom post type, add Advanced Custom Fields, content, ...
0
votes
1answer
24 views

How can I remove the “Add New” button in my custom post type?

I have many custom post types that need the Add [custom post type] feature but I have a custom post type of "About" and I do not need to "Add New" about to the about custom post type. So I want to ...
-4
votes
0answers
20 views

`php` or `wordpress function` , best way to become a `wordpress` master? [on hold]

I'm relatively newbie in wordpress, and need to become a semi-master wordpresser in about 2 months. I read "Wordpress the missing manual" and somewhere in the book I read that its better to work more ...
0
votes
2answers
40 views

Wordpress most popular post own code, per week

The plugin Most popular posts doesnt support WPML and therefor I have tried creating my own. I have found this tutorial in creating your own code for showing the most popular posts on my site. ...
0
votes
1answer
21 views

Creating customized php files in theme folder

I am developing a e-commerce theme that requires an order page. I created a php file inside my theme folder named order-page.php and hope to access this page from the wordpress root url ...
-1
votes
0answers
15 views

Wordpress crashes with W3 Total Cache [on hold]

I have Wordpress 4.0.1 with Varnish, Nginx, PHP-FPM (FastCgi), MySQL and W3 Total Cache 0.9.4. Everything worked fine, until 2 months ago. Since then, once a week my server stop responding. It looks ...
1
vote
0answers
19 views

Looking for a secure way of storing/accessing user form entry preserving newlines?

I'm allowing users to enter information through a textarea on my site. I'm aware that there is a security risk whenever a user can enter information into a site. I want to be able to preserve ...
1
vote
1answer
44 views

Upload a json file in php

I'm trying to upload a json file through PHP. This is the code that i have yet. if( isset( $_POST['upload'] )) { $target = "/"; $target = $target . basename( $_FILES['upload']['name']) ; ...
0
votes
1answer
14 views

Sort by multiple options in custom field

With use of the Advanced Custom Fields plugin I created a select dropdown which contains 6 membership types. All of my 'listings' using this custom field are assigned one of the 6. I'd like to ...
0
votes
1answer
40 views

Custom meta box with jQuery.sortable custom post type list

What I'm trying to do is have a custom post type ordered differently on different pages. I've searched around for quite a while and can't seem to find anything to help. I have a post type named staff ...
0
votes
1answer
28 views

How do I show my <p> containing my custom field ONLY if there is a set value on that custom field?

I am using the Custom Fields Plugin and have 2 custom fields assigned to my "products" custom post type. Field 1. Price Field 2 Discount Price So this is my code: <div class="wrapper"> ...
0
votes
0answers
18 views

PHP filters on a listing page [closed]

I am asking in the hope someone cal provide a solution to below as I have no knowledge of php and have searched for hours in the hope I can find a solution to below I am creating a website - ...
-1
votes
1answer
23 views

Show div only if he has value insided - advanced custom fields plugin

Recently I installed the advanced custom fields plugin, and I want to display the fields only if there is values inside. So I used if statement and its work fine. Now I have some fields to display and ...
0
votes
1answer
28 views

WordPress Woocommerce - Product Type [closed]

I have recently created a php script to import new products into Woocommerce. Please see how it was done here How to add product in woocommerce with php code. The question I have is related to the ...
0
votes
0answers
37 views

Use jQuery and AJAX to get HTML

I have a jquery function in my theme that should send an array of filters to a PHP file, which should then return a piece of HTML with the filtered posts (it then replaces the contents of a ...
0
votes
1answer
19 views

Display all meta for a post?

I have a custom meta field for my posts and I'm able to display the value. But it only displays one row. Since I have more than one value I need to display all of them. I know I probably have to do ...
0
votes
0answers
27 views

get_post_meta() cannot return values from nested arrays

I apologize if this question was answered on here. I searched and could not find an answer that related to my own issue. I've been turning my wheels on this for three days now and am now seeking ...
1
vote
1answer
18 views

Set the background to a default image if there isn't a specified “featured image”

I am having a little trouble displaying a default image as a background image when a feature image is not present. This is the code I am using <?php if (has_post_thumbnail( $post->ID ) ): ...
0
votes
0answers
14 views

How to center an array of thumbnails? [closed]

I am creating our new page based on wordpress an i am creating an own theme. It should be responsive so i can ot work with a specific width of my site at all. It works quiet good expect one thing. I ...
0
votes
0answers
17 views

how to pull content from subpages only(not the parent page) to the front page

I want to pull content from from subpages of a specific page.But its pulling content from parent page also i don't want to pull content from the parent just from the subpages of that specific page ...
0
votes
0answers
28 views

How to generate custom loop indexes

Besides the regular taxonomies, such as category, tag, author, archive, I also have some special indexes to display, such as list of all sticky posts, simple chronological index of all posts, top ...
1
vote
2answers
29 views

Web Scraping with Cron

I'm currently scraping prices from three websites using xPath, but since it updates on every page load, it makes loading slow. What I would like to do is store that data and only update it weekly. So: ...
0
votes
1answer
30 views

Exclude Post ID from Array Specified in Custom Field

I have a custom field 'exclude' and the value would be a particular post, let's say 2124. Within the array I want to then call this custom field for the exclude => field but is this even possible?
0
votes
0answers
30 views

custom field meta-box with dropdown/autocomplete

Is it possible to have a custom metabox with the ability to either: enter a new meta_value in a certain meta_key OR choose from a list of the existing meta_keys, from a dropdown/select-box, ...
0
votes
0answers
16 views

Execute PHP code of a plugin markup file

I am creating a plugin which imports html markup. I would like to execute some php on those markup files before or after it gets imported. Is there anyway I can do this? Right now if I add PHP to the ...
0
votes
0answers
23 views

Display a post based on its metabox selection

I created a client portal where a client can view their projects. I have two user accounts "Clients" and "Administrator. Both clients and administrator are redirected to the frontend of the site to a ...
0
votes
0answers
8 views

Constantly schedule posts for two weeks in advance

I was wondering if there was a way to automatically and constantly have posts scheduled for two weeks in the future. Example: I have a post that I want published every Tuesday at 1pm, and I want ...
0
votes
0answers
8 views

columns in wordpress submenu

I'm trying to get 3 columns each wrapped with a div in the wordpress submenu. I've yet to find a tutorial on how to accomplish and i've been looking all day. For example, <ul> ...
0
votes
0answers
21 views

Use own function in header.php [closed]

I want to add a function located in functions.php to my theme, that looks like this: function if_wide() { global $post; if (get_post_meta($post->ID, 'cbLayout', true) == 'Wide') { ...
0
votes
1answer
33 views

Hide button based on PHP result

This is what i am trying to achieve but i am not sure how: I would like to check if a specific post is published or not If it' not published, it should hide a specific button and show a different ...
0
votes
2answers
67 views

How to get a list of term names of the custom post type im currently on in single.php

Ok so I have a custom post type of "Products" and a custom taxonomy of "Types". Now in the types taxonomy I have dozens of categories and sub categories assigned to custom post types. Custom Post ...
0
votes
0answers
18 views

How to build shortcode for tabs

i made a tabbed widget to display recent post , comments, and popular posts, but now i want to take out tab function from this and make a shortcode of it, so i can add it to wp posts and use it there. ...
0
votes
0answers
28 views

Passing JavaScript variable to PHP popup

I have a popup that has a list of people. The user is allowed to select up to 3 people that they would like to compare. I then would like to show them a page that's comparing the 3 people that they ...
0
votes
1answer
34 views

Displaying conditional elements based on checkbox [closed]

I'm building a custom template for the plugin WP-Property. The great part about the plugin is that it easily allows you to add custom attributes to their own custom post type of properties. I also ...