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

learn more… | top users | synonyms (1)

5
votes
1answer
5k views

How do I use WP_query with multiple post IDs?

I want to query multiple posts with an array of IDs (note: I am querying a custom post type). Here's what I have, which isn't working: $myarray = array('144', '246'); $args = array( 'post_type' ...
1
vote
1answer
590 views

Enqueue Javascript Correctly for 3.5

I am trying to create tabs for admin settings page in wp, but I think I'm doing it wrong. The example below shows how I did it but I don't know how to change this to use it correctly with no conflict ...
0
votes
1answer
732 views

Ajax URLs without #!, how to prevent falling into single.php on load or reload?

I'm trying to make things properly with a single page ajax powered portfolio. I've read that there is no need of #! to make it crawlable by google. So I have clean URLs that updates with .pushState ...
11
votes
2answers
904 views

How to make a image-size selected by default in Media upload - WP v3.5

Bare with me. I want to have a custom image size selected by default in the Media upload popup page. In Wordpress v3.4.2 and prior, this elegant code worked fine: function ...
6
votes
1answer
1k views

Set media upload attachment link to none and hide it in WP v3.5

In the Media upload popup page, how do I set the attachment link to none and hide it in Wordpress version 3.5? The following filter worked fine in earlier versions of WP: function ...
7
votes
2answers
2k views

Remove “Insert from URL” link in Media upload - WP 3.5

How do I remove the Insert from URL link in the new Wordpress 3.5 Add Media popup page? In earlier versions of Wordpress, this worked fine: // removes URL tab in image upload for post function ...
0
votes
1answer
123 views

WP-DBManager Plugin Can't Find Mysql Path

I support a WordPress 3.4.2 site, lifering.org, running on a GoDaddy Virtual Server. Recently I chose to upgrade the underlying O/S from CentOS 5 to CentOS 6. The rebuild was entirely automated and ...
1
vote
1answer
2k views

How to scale image with equal width and height without distortion?

I have a section on my frontpage that querys through recent posts and grabs the title and thumbnail of each. In my functions.php, I've specified a width and height for the thumbnail using: ...
3
votes
1answer
268 views

What is <# code #> in media-template.php, and how does it work?

I'm checking /wp-includes/media-template.php and just found this: <# if ( data.compat && data.compat.meta ) { #> {{{ data.compat.meta }}} <# } #> Never seen <# #> or ...
0
votes
1answer
119 views

Custom PHP App with a wordpress site

I have created a new 'page template' and (this is probably not the right way to do this, but this is the way I have got it working), and created a new page using that template. Within the page ...
0
votes
1answer
476 views

Dynamic Sidebars & Echo

I can sucesfully get my dynamic sidebar to work like so: <div class="sidebar sidebar-first"> <ul class="widget-area first"> <?php dynamic_sidebar( 'pop-photos-sidebar' ); ...
1
vote
0answers
564 views

Security - Ajax and Nonce use [closed]

I'm developing a site which posts a number of ajax calls from jquery to PHP and returns data from PhP to jquery. Everything is working, but i'd to know if my approach to handling the calls is ok, in ...
0
votes
1answer
56 views

why php notice is not getting ignored?

I have been adding at the top of my wp-config.php the following to switch off php logger but won't take any effect on it. Is there something else what I should do? error_reporting(0); ...
0
votes
1answer
38 views

Why does abstracting html from plugin code result in loss of access to wordpress functions?

When defining the callback that produces the HTML content for an admin settings page, I'd like to abstract the HTML into a separate file, but the HTML uses some wordpress functions, specifically ...
0
votes
1answer
67 views

how can I do something on new user registration?

When I register a new user to my blog, I always receive an email. The code in simple terms should look like this. on_new_user_registration(){ //send email to admin //I want to do ...
1
vote
1answer
843 views

Archive listing of posts by publish year (multiple years)

I have an archive page showing all blog posts (in a specific category). With a growing number of posts, I want to separate these by publish year. For example (simplified), I'd like the following: ...
0
votes
2answers
249 views

Getting Post Permalink Outside of Loop Not Working

I'm trying to get post's permalinks outside of the loop via a wordress plugin. Nothing seems to be working. Here is the original code that does not link to any permalink. public function ...
0
votes
2answers
232 views

PHP displaying wrong custom taxonomy images

I'm using the Taxonomy Images plugin to try to pull in the category images for custom categories on a page that displays all the categories my site has. For some reason, this code outputs the correct ...
0
votes
1answer
151 views

Royalty-Free Sliders used in theme development

I am wanting to develop a premium Wordpress theme, and would like to know what is the best way to go on choosing a slider. I'm not skilled enough yet to write one from scratch. The ideal situation ...
0
votes
1answer
400 views

Using multiple variables to assign categories to an array

I have php set up in a template file to check a form and see if 1 or more of 5 categories is selected. Based on which one is selected, I want the custom query I'm using to change in that the array for ...
0
votes
1answer
48 views

Calling a plugin from a page template in TwentyEleven

I'm desperately trying to call a pretty simple-looking plugin (this one: http://wordpress.org/extend/plugins/wp-random-posts/ ) from a TwentyEleven page template. The goal being to get the thing to ...
-4
votes
2answers
953 views

Adding jquery using php function

I was turned down with this question because I get a php error and my question revolves around jquery, but when I take out the JQUERY everything works fine. * Again I'm creating a wordpress plugin. I ...
0
votes
1answer
196 views

Pagination not working on homepage

I tried multiple solutions but its not working. When I go to /page/2, it doesn't work. I'm executing custom query in index.php of my theme. if ( get_query_var('paged') ) { $paged = ...
-1
votes
1answer
188 views

Convert all uploaded PNG files to PNG-8 format

Running a high trafficed platform. In my quest to minimise bandwidth costs, I added a high JPEG compression on all JPEG uploads (check solution in my previous question). However, Wordpress does not ...
0
votes
1answer
327 views

Custom Loop for custom post type. Compare by meta_value?

I'm a bit confused. I have a custom-post-type named wr_event. I'm using the code underneath to loop through all "upcoming" events (defined by the meta_key `event_date). The problem I have now is that ...
-1
votes
1answer
277 views

Award points if a specific custom taxonomy is selected - Cubepoints

I run a multiple author platform where Cubepoints is a major part of its point and ranking system. I have added a custom category taxonomy called highlight and it contains two items: featured and ...
1
vote
2answers
936 views

Prevent Data Resubmission On Page refresh

UPDATED FOR CLARIFICATION I've got this rating plugin that keeps submitting & duplicating the rating data on page refresh. When a user wants to add a rating, they have to click a button that ...
1
vote
1answer
54 views

Storing Options in a Shortcode

I am creating a Wordpress plugin. I want to create 1 single shortcode that changes output based on the settings changed by the user on the admin settings page. So for starters, I have something like ...
1
vote
1answer
560 views

How to Sort posts by Vote Count?

Does anyone know how to automatically sort posts by Vote Count? I am using a plugin called WP Voting where a visitor can vote on a post. The plugin keeps track of how many votes each post has. The ...
0
votes
1answer
345 views

Need to remove 'Featured', 'Date' and 'Comments' from WordPress Sticky Post?

I need to remove the 'Featured', 'Date' and 'Comments' from my Twenty Eleven child theme sticky post that I have on my landing page. I am finding it hard to find any information that show what ...
1
vote
1answer
106 views

Generate sidebar depending on height of post

I'm building a site which features sidebars next to each post/article displaying random thumbnails linking to other posts. Each sidebar should never be longer/bigger than the post it's sitting next ...
1
vote
1answer
96 views

Wordpress Theme Options Values

I am designing a wordpress website with theme options: In my theme options I have code that looks like this: $class = (isset($this->field['class']))?$this->field['class']:'regular-text'; ...
0
votes
3answers
2k views

First Byte Time (back-end processing)

Do you have any tips for reducing First Byte Time back end processing... I disabled most of the plugins I could, I am using CDN, W3 Total Cache.. but still the back-end processing time is around 3 ...
1
vote
1answer
207 views

How to display posts by current user in a drop down

I am trying to write a shortcode that works in conjunction with Contact Form 7 to display the current user that is logged in posts. I have been able to get it to work with regular posts using this ...
0
votes
1answer
149 views

Adding a Tag Parameter / Filter to My Shortcode

I have this plugin that displays category featured image thumbnails for each post via shortcodes.. like so, [categorythumbnaillist 3] (3 being the category of course) I would like it to only show ...
1
vote
1answer
122 views

PHP Wordpress optimization my loop code

I'm just learning PHP, and I'm using get_terms to get some text descriptions from the CMS, but i want to assign 3 variables to only 3 of my woocommerce tags. My code works well, but I just want to ...
0
votes
1answer
550 views

Slow site initial load time

for some reason my website www.gcprive.com takes a very long time to respond initially but then loads all of a sudden. Any ideas why this happens? I am trying to optimize speed in general but this is ...
1
vote
1answer
353 views

Add custom image sizes to media uploader

I want to add custom image sizes to the media uploader: In order to do this, I use the following code (comments are there for convenience): // this function adds the custom image sizes to the ...
2
votes
1answer
143 views

New Plugin: Post update pushes a copy as a revision

I've been working alot with editing of posts after they've been published. I know I can hit update on the post to just update it, but I want to have the journey of revisions available for users to ...
0
votes
2answers
121 views

Check IF single OR multiple custom data has been entered

I'm building a single template right now for a custom post type. I'm wondering if there is a way to check if either at least one or multiple of the custom values has been entered so I can display the ...
1
vote
1answer
77 views

How does WordPress determine which multisite the user is on from the URL?

What is the file and line where WordPress determines which multi-site the user is on from the URL? I've been looking through the code all afternoon and can't figure out where it turns ...
3
votes
2answers
677 views

wp_mail function timing out

I have the following function. This is part of a membership-based site. When a post of the type "message" is moved to Publish status, it should send an email to all users who belong (custom user meta) ...
0
votes
1answer
443 views

Understanding Post Formats/Custom Post types Etc

I don't understand what "Adding Post Type Support" is for when we have "Adding Theme Support"? For different post-formats this is the way I was shown before. This is then how I did it for the project ...
0
votes
1answer
730 views

Link a lightbox thumbnail to a post instead of opening the lightbox

On my website portfolio I use a heavily modified version of the Swatch theme from Woo Themes. The theme makes the thumbnails for my portfolio pieces link to the lightbox. I want the thumbnails to ...
-1
votes
1answer
418 views

Class for Selected Menu using wp_nav_menu

I create Widget for Vertical menu Now I am trying to get selected or current menu using wp_nav_menu Any one know how to Add current class when selected in wp_nav_menu
0
votes
3answers
558 views

Get Admin Email Address From External PHP page

I am setting up a "built in" contact form that I need to pull the administrators email address from an external php page. For instance, my form action="path/to/process_form.php" Within that ...
8
votes
2answers
5k views

Getting only direct child pages in WordPress with get_pages

I am trying to fetch all direct children of a page. But I am getting all children and grand children as well. Any ideas? PHP Source: $args = array( 'child_of' => $post->ID, ...
0
votes
1answer
90 views

Set active class in a Php foeach

I have the following code to display a list of taxonomies in Wordpress. It works and my only concern is the active class (li class="active"). Err, how do I go about making it dynamic? <ul ...
0
votes
3answers
991 views

How to Create a Directory in a Plugin Folder?

I am creating a plugin in WordPress Version 3.4.2. When the administrator submits a form, a new folder is created inside my plugin directory and a file saved in this new folder. But it gives me the ...
2
votes
2answers
276 views

queries inside of a class

I'm building a plugin and I'm quite new to wordpress I have a class what has couple of methods what should execute database queries. The class look as it follows class MyClass{ private ...