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

learn more… | top users | synonyms (1)

0
votes
2answers
42 views

Closed html class after counter = multiple of 3

How to closed my class in multiple of 3. i don't want to use this if ( $counter == 3 || $counter == 6 || $counter == 9 || $counter == 12) { $output.=' </div>'; } but i ...
0
votes
0answers
35 views

Ajax doesn't work on second call

I'm using Ajax to load posts into a sidebar that are filtered by a chosen category. It works perfectly fine the first time, but for some reason the second time it loads a mixture of results from the ...
0
votes
1answer
30 views

Parse error syntax error unexpected t_string [closed]

I'm getting the following error: PHP Syntax Check: Parse error: syntax error, unexpected 'qtip' (T_STRING), expecting ')' in your code on line 14 in this code: <?php // Always use ...
2
votes
1answer
57 views

How to get the post count for the last x days filtering by categories

How can I get the posts count for eg the last 4 days, but only for specific categories eg. (1,2,3)? Thanks in advance.
0
votes
0answers
38 views

Append argument not working in the wp_get_recent_posts function

I want to append some WP posts to the normal search function but when I run the wp_get_recent_posts function (with the append and the posts IDs in an array) I dont get the posts I wanted to append in ...
0
votes
0answers
35 views

How to link PHP pages not included in menu?

I'm developing a plugin which has basically four pages in menu, each page contains a form that the action value should link to another page (not included in menu). My questions are: how do I link the ...
0
votes
0answers
24 views

What is the right way to include my Ajax script in wordpress [duplicate]

I've searched around for a solution to my issue to no avail. So here it is: I have created custom meta fields in the user section within the admin area. There are two fields in total, both select ...
0
votes
1answer
60 views

Ajax - Call to undefined function get_option()

So I've been working in Wordpress lately with Ajax and I managed to get some stock data into my site from my database. However, I am now trying to use Ajax to load Wordpress posts into my left ...
0
votes
1answer
52 views

List sibling pages widget, exclude current page

I successfully created a widget that displays sibling pages to the current page I'm on in the sidebar. Only thing is, I'm not capable of excluding the current page - can someone please assist here? ...
0
votes
2answers
55 views

Taxonomy term count

I have a custom post type called "RESOURCES" which I used to create a directory of resources on my website. This CPT has the taxonomy called "PRICES". There are three terms free free trial premium ...
0
votes
0answers
31 views

Ninja Forms - pull in some post related information

I am building a real estate website. There is a custom post type, called "Agents", that holds all the contact info, like the email address. I also have a custom post type called "Properties" where you ...
0
votes
0answers
34 views

Change taxonomy for categories

I am using a plugin called "Recent posts widget extended" with a directory theme where i have directory listings showing as adverts in a sidebar on specific pages. The plugin allows me to show posts ...
0
votes
1answer
41 views

How do I convince this button to do something when it is clicked?

I'm trying to use ajax to give me an alert when I click a button. Eventually I want it to do some form validation, but for now I would be happy just to see the alert. I've read the docs and about a ...
0
votes
0answers
30 views

Question about file path for include/require methods

So I am currently rather new to Wordpress development and I had a question about the file path for the include() and require() methods. I have a php script within my Wordpress installation that I ...
0
votes
0answers
32 views

Query category-specific, paginated posts and allow viewer to change sort order

Maybe this has already been asked here, but I can't seem to find a solution, so forgive me if this is a duplicate. I have coded a custom template to display all posts from a category with the ID 36. ...
0
votes
1answer
50 views

Accessing Variables Used In a Plugin Using PHPStorm + XDebug

I'm currently attempting to use XDebug 2.2.1 and PHPStorm 7.1 to debug my WordPress plugin. So far, I've successfully installed XDebug and breakpoints are working fine. However, I'm unable to access ...
0
votes
1answer
25 views

Showpost and last

I need your help. I would like to bring up the last (number) from my template classified ads. Here's the code: <?php $the_query = new WP_Query( array( 'showposts' => 10, ...
0
votes
0answers
16 views

Make first child link default instead of its parent

I want to do something like this: if a parent have kids get page link of the first child else get page link of itself. For example: Page 1 Sub-page 1 (get this link) Sub-page 2 Sub-page 3 Page 2 ...
0
votes
0answers
35 views

How to show grand total of echoed values?

Using Advanced Custom Fields, I have a WP page setup as an Asset Register with repeaters which shows: Example: Asset Acquisition Value - $100.00 and Depreciation - 10% Fields are repeated for ...
1
vote
0answers
70 views

Using color picker in plugin, does input attribute order matter?

I'm trying to use the WP color picker in a plugin admin menu and it doesn't seem to be doing anything at all. I'm following the directions here: ...
1
vote
1answer
254 views

WordPress (3.9.1) MultiSite Permissions. Is chown the answer?

The situation: I'm working on a WordPress MultiSite for a charity. They have a Dedicated Apache Server running multiple Domain Names (Accounts). I preparation for Development & Production, which ...
0
votes
0answers
27 views

Nested wp_query loop doesn't show connected posts

I have have a wp_query loop nested in another wp_query loop. The first loop queries the latest movies. The second loop queries the persons connected to each movie from the first loop (movies and ...
0
votes
2answers
61 views

Display custom meta box in my template file

Need help displaying my custom meta boxes on a template file. Following a tutorial Here's the code from my functions.php: function get_custom_field( $value ) { global $post; $custom_field = ...
2
votes
1answer
137 views

Wordpress Visual Editor Stripping HTML Changes

When I use the WordPress HTML editor to add icomoon icons like this: <span class="icon-shield"></span> and then switch to the visual editor and then back to the HTML editor, the icons ...
0
votes
2answers
59 views

How can I call specific function if requested URL is not found?

My website is fully API based and builds pages/posts from API data. I was thinking to create something like PHP magic function __call to call specific function when requested URL would return 404, but ...
0
votes
1answer
27 views

Custom posts in different columns style

I'm trying to output a custom type posts with a sticky/featured work in a col-8 (thumbnail) and col-4 (content) then the rests of the posts should be in col-4. So far I have tried the code below but ...
0
votes
2answers
163 views

Function won't run onclick using Ajax

Ok, so my code is meant to be pulled from the function using the jquery code below, but it isn't pulling the code and I can't see why not. My pages code <script> var click_to_choose_user = ...
1
vote
0answers
48 views

php function to display commenter username or login

I want to display the commenters username or login name in a comment template. I know there is a function comment_author_link(), but this displays the "display name publicly as" name and not ...
1
vote
1answer
44 views

No wp-config.php file on local install of wordpress - site still displays

I've installed Wordpress locally using XAMPP and this step by step guide by Sunny Johal(Fifth post down on that page). The first time I used the step by step and ran all 3 of the SQL codes(UPDATE ...
0
votes
0answers
13 views

External Page Displaying Properties of [If (Home Page)]

I have a slider set to display only on the homepage with <?php if( is_front_page() ) : ?> This works properly for all pages, except my landing pages that have get_header. Does anyone know how ...
0
votes
0answers
15 views

Processing empty search TwentyTen

On my website when you submit an empty search box it takes you to a page that says nothing found however the navigation menu isn't displayed but it does when you enter a search term (whether it finds ...
0
votes
3answers
67 views

Wordpress article with 50 000 words loading slow - 100% cpu

I have a wordpress article with 50 000 words. After a debug I realised that the CPU is 100% when I read the post / open the category page. I have a quad core server with 8gb ram (the ram level is ...
0
votes
0answers
38 views

Complex menu structure with 6 custom post type hierarchy

We chosen to use Wordpress to this client but we have not work with a menu structure like this one on Wordpress. Those content types i what we have created as custom post type. Is listed below: ...
0
votes
0answers
18 views

Count how many articles meet a search after add search field

I create a custom post field named "related_keywords". When i add a post, before save, i fill this field with a list of keywords. After that, I need that it search title posts that meets this search ...
3
votes
1answer
168 views

wp_delete_auto_drafts() deletes links in menus

Since yesterday the wp_scheduled_auto_draft_delete cron job somehow deletes all page entries from our menus. All entries in the table wp_postmeta with meta_key = '_menu_item_object' and meta_value = ...
0
votes
1answer
39 views

Underscores and capitalization in usernames

I created a WordPress / BuddyPress / bbPress site that is used in conjunction with a PC game. When users register for the site, they are asked to enter their account name as it is in-game. The problem ...
0
votes
1answer
35 views

How to save the output of php variables used in inline css code to the main style.css?

I have some PHP variables that each represent some user settings set via a theme options interface such as: theme colors typography etc. All these variables are in a file called dynamic-style.php: ...
0
votes
0answers
81 views

Adding a dropdown list box to the comments page

I'm creating a plugin that will add a dropdown list box as an additional field on the comments page. The data in the dropdown is not being added to the MySQL database. Can someone take a look at my ...
0
votes
2answers
50 views

Get the current page in a call back function

I would like to be able to get the URL of the page that I am crawling when the callback function is called. I tried $_SERVER['HTTP REFERER'] but it gives me the URL of the page that the script is ...
0
votes
1answer
41 views

Echo the featured image of page assigned to blog in index.php

I have my posts page set to a page named Blog. This is set to use the Template: Default template. So index.php is rendering this page. I want to be able to set the Featured image of this page I've ...
0
votes
3answers
37 views

Limit ads appearing more than three times

I am using the following code in content.php to repeat an ad insertion. Ads are inserted in the middle of every 2nd row in a grid of thumbnails. There are 3 thumbnails per row. <?php else : ?> ...
2
votes
2answers
138 views

How to count the length of a post title?

Let's say that I have an entry titled Crime & Punishment I tried to count the number of characters of my entry titles using the following line: echo strlen( get_the_title() ); I expected the ...
2
votes
1answer
59 views

Should I store my Facebook access tokens?

I've built a custom login page for a Wordpress site which uses Facebook for authentication. Is there any reason to store the Facebook access token in my WP database, or does it make more sense to use ...
0
votes
1answer
28 views

Displaying Event within two given time frames

I'm trying to display two different posts from my CPT named Events. One is going to be the next event the other is going to be previous event. I've got a metabox called 'Event date' The client at ...
0
votes
1answer
22 views

append PHP function to the_content

I'm using the Jetpack plugin for related items and social sharing. Both of these options filter the_content and append themselves to the end of it. The problem is that I'm using custom navigation in ...
0
votes
1answer
41 views

Looping through 3 recent posts but separating them into separate divs

I am trying to loop through 3 posts, but separating each one into it's own div as some jQuery will show and hide one at a time. I've created the code to show one, but separating them I am unsure of. ...
0
votes
2answers
40 views

Exclude specific post from displaying

I am trying to exclude a specific post ID from displaying. I've included the post ID as a post__not_in but being given an error I am unsure of, any obvious changes needed here? ...
0
votes
1answer
38 views

Functions are causing errors

I'm declaring a function on a plugin's PHP. The plugin loads code at the top of each post (Post Layout is the plugins name). Cannot redeclare vote_up() (previously declared in ...
0
votes
0answers
21 views

Position taxonomy box below editor in custom post type

How do I move the custom taxonomy below the editor? I have a meta box called property details and I want the taxonomy to appear below it. I am adding it using the following code. I don't want it to ...
0
votes
1answer
32 views

How to set a cookie based on a page Get variable?

I am trying to set a cookie, based on a GET variable from a page. The page URL looks like: mysite.com/?my_var=somevalue I'm trying this, but can't see what I'm doing wrong.. // make 'my_var' ...