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

learn more… | top users | synonyms (1)

1
vote
2answers
347 views

Selectbox in admin panel function linking to CSS

I want to link the selectbox to my CSS. Like if I click an item on the list, the background of my header will change - the header's color is in the CSS. The selectbox isn't in the html but it's in ...
1
vote
1answer
1k views

Compare post-IDs within WP_Query? (Less than / Greater than)

Can I use WP_Query to only query posts less than (or greater than) a given post ID? $filtered_query_args = array( 'post_type' => 'projects', 'order' => $prev_next=='next' ? 'DESC' : ...
0
votes
1answer
72 views

retain querystring values when savincustom options in admin

Quick question, I have a custom options page which posts to options.php, however I have a few sections to my options page where i change the post url like so: <form ...
1
vote
1answer
138 views

which action to hook to in order to perform post-publish action

I have some functionality I've written in order to post the title and link for the post to twitter whenever a post is published. I'm wondering which wp function to hook this to? save_post has no real ...
2
votes
1answer
2k views

Bulk Image upload and one image for each post?

I have around 3000 photos, want to upload on WordPress. Is there any way to bulk upload all the photos as one image for each post ?
0
votes
1answer
201 views

Issue with custom plugin

I created an audio player in HTML5/Flash with the help of the SoundManager2 API. Now I want to add it to Wordpress as a plugin, so that you don't need programming skills to customize the player. The ...
1
vote
1answer
41 views

Getting trackpacks/pingbacks for a post via wordpress?

Is there a way for someone to query the wordpress API of a blog in order to get the pingbacks/trackbacks for a post? E.g a blog is hosted on example.com. I want to query example.com's wordpress API ...
0
votes
1answer
340 views

Setup page template array in a custom post type

Hi below is a 'case' (in a custom post type) for pulling all categories and displaying them as a drop-down menu. How can I do the same but turn it into a list of checkboxes? //tax_select - this ...
0
votes
2answers
229 views

How do I add my PHP app to a Wordpress page whilst keeping semantic URLs?

I am rebuilding a static website for a client using Wordpress on the main domain- eg domain.com. There is also a directory of members website at directory.domain.com which I was hoping to migrate over ...
-2
votes
2answers
477 views

Upgrade wordpress core programmatically with PHP [closed]

What I want to do I want to upgrade Wordpress programmatically to a later version. That I want to do with PHP, lets say from http://www.example.com/?upgrade_wp=true I already know how to get the URL ...
0
votes
2answers
600 views

Saving fields in a drop-down in Wordpress

Below is code that successfully displays a drop-down menu of page templates in my Wordpress theme. I'm using this menu in a custom post type, and don't quite understand how to label it in order to ...
2
votes
5answers
136 views

Get list of WP Updates Across Sites

Is there a way to query a WP site to see the number of updates currently available? I'm not really looking for a list of the actual updates, just the number. This would be the total number of ...
15
votes
1answer
4k views

How can I use WordPress functions in my stylesheet?

I have my style.php file looking like this. <?php header('Content-Type: text/css');?> #div{ background:<?php echo get_option('bgcolor');?>; } This does not work, but when I do ...
1
vote
2answers
2k views

How to put JQuery/Ajax inside shortcode?

The purpose of this plugin is to create a list that users can modify with up or down votes. The shortcode is supposed to display the list on a page and use JQuery to fadeIn and fadeOut while updating ...
0
votes
1answer
198 views

PHP if statement works in template files, but not header

This is driving me nuts, and I'm sure that as soon as someone points out the answer, I'm going to feel dumb. I have a website where most pages require login to view. So I am using an if statement to ...
2
votes
1answer
2k views

How to edit/delete single row items in a table on my own menu page

I have successfully created a wp-LINKS-list-table that displays the output of WP's core "Links" table in the WP Dashboard, and I have it displaying on a menu page I created. Step 1 accomplished! ...
0
votes
2answers
1k views

Meta-Boxes for CustomPostType cause PHP Errors and Notices in “Add New” view

I have a custom-post-type named wr_events. I have quite a lot of meta-boxes in this post-type. The post-type and the meta-boxes itself work just fine. Only thing: No matter at what post-type I ...
0
votes
1answer
151 views

How Can I Edit the Registration Code?

I would like to add a group of two radio buttons to Wordpress's registration page (yes and no), where if yes is selected the value in the email field will be added to an aweber mailing list. Would ...
0
votes
1answer
140 views

Error while setting role

I already got code which can change role basis on post count. <?php add_action( 'save_post', 'update_roles' ); function update_roles( $post_id ) { if ( defined( 'DOING_AUTOSAVE' ) ...
0
votes
1answer
129 views

Change page title from page using php via php executed from page/post itself

I am running a plugin from a WP page to execute PHP and it works great. I'd like to edit the page title and description based on POST data. I am already using POST data in the PHP code to alter the ...
0
votes
1answer
202 views

Custom post type causes php-error in php version 5.2.17

I'm getting an php-error on an server that runs php version 5.2.17 which doesn't support anonymous functions. I've never heard of that before (really new to php) but found out that only php 5.3.x ...
0
votes
2answers
402 views

How can I remove the first two words and shorten get_the_title()

Some of my posts' titles have leading words, followed by a colon. I am removing the leading words and the column of every post title in the loop with the following: <?php $title = ...
0
votes
1answer
73 views

Trying to display terms from custom taxonomy within function

I have a function that is giving me this error - Catchable fatal error: Object of class stdClass could not be converted to string in.... blah blah Below is some of the code from the function. It is ...
0
votes
1answer
777 views

Query the links Database

Hi I'm trying to convert from a "example" wp_list_table that displays an array of data on the same page, to a "real life" table the pulls data from the database. I have the code setup to where I just ...
5
votes
1answer
4k views

How do I get the $handle for all enqueued scripts?

Is there some way to get the $handle for each script that has been enqueued? Is there some array that holds all the handles so that I can loop through it and do something using each $handle?
0
votes
1answer
484 views

Alter secondary loop to exclude posts from current page category

The below code is taken from sidebar.php where it outputs random posts from multiple categories and excludes the current post from showing up. This works great but how do I alter this loop to exclude ...
6
votes
1answer
4k views

Add a class to links in the visual editor (how to get old dialog back)

New: Old: In short, i want a list of some classes inside the add link dialog. Because this was default there might be a easy way to get it back like this? Long: I like to have the ability to ...
0
votes
2answers
114 views

Editing a PHP file to include a small text piece on every page

I'm building site (dummy site is up at www.teamcoding.ca/corporate) and would like to include in the upper-right hand part of the screen, "Switch to Lifestyle Site" with a link to a different site. ...
0
votes
2answers
653 views

Get current Wordpress page then add #post ID to the end

I'm trying to find out the PHP code that will get the current URL and add a hash ID onto the end of it so a link can be generated and linked to. The end goal is to create a link that returns: ...
2
votes
2answers
268 views

How to execute a simple php script in WP (I don't think wp_enque_script applies here)

I have a wordpress page where I want to include a budget calculation tool. This budget calculation tool is of course tied to a php script that executes the fields in the budget calculation tool. This ...
0
votes
3answers
137 views

Wordpress redirect on login

I have downloaded my site to a production environment. I have set up both the live site and the production site to use the same DB. When i login to the admin panel i get redirected to the live site. I ...
2
votes
2answers
363 views

Create new category upon save based on post information

After finding a couple of leads on how to do this, I'm coming up blank. What I am trying to accomplish is to add the post to a new category based on camera name. If the category doesn't exist, then to ...
0
votes
1answer
77 views

Wordpress Plugin Receive a Link

I'm writing a Wordpress plugin. The plugin should allow every user to rate posts (1 to 5 stars). What actually works is to read the rating from storage and show the stars. So there are five <a> ...
0
votes
1answer
1k views

Get categories names as an array to use it in theme settings

I am building a theme and for the Theme Settings Page I followed this tutorial: http://wp.tutsplus.com/tutorials/using-the-settings-api-part-1-create-a-theme-options-page/ What I want now is to have ...
0
votes
2answers
613 views

Manually Remove and Change WordPress Page/Post Title

I have added custom metaboxes into the wp-admin page and post editors. There is a metabox with the ability to enter in a person's first name (ex. "John") and last name (ex. "Doe"). I want to set ...
1
vote
2answers
277 views

On this day PHP code

I'm working with this code snippet for an "on this day" type post. However it is only showing 1 year in the past. I'm looking to automate this so it shows on this day in 2009, 2010, 2011... and as the ...
1
vote
1answer
685 views

Mass update excerpt

I'm using a photoblog theme which upon creating a new post it takes the post attachment and saves a modified "img src" string into the excerpt field. It then uses <?php the_excerpt(); ?> to ...
0
votes
1answer
446 views

How to display results from a data table with an encrypted user id?

I'm trying to display a table of results for particular users who have submitted answers to quizzes. The problem is that the mysql database I am working with has a funky value for the user's ID. I'm ...
0
votes
1answer
488 views

Good RSS Feed Parser to use on php file?

Was trying to use EmbedRSS Plugin but the php code that I used to put it into my index.php file doesn't work. [cetsEmbedRSS id='http://deannaschneider.wordpress.com' itemcount='2' itemauthor='1' ...
2
votes
1answer
68 views

automated tests as a user?

I checked out (with svn) the code for Automated Testing. However, I want to run unit tests as a specific user. Is there a way to do that? That is, is there a way to loggin with php code alone?
0
votes
2answers
461 views

Should i use the wordpress Options table or to create database table..?

I have an application built in asp.net but i'd like to port it over to wordpress as a plugin. Is it practical to develop the php version of this app using the Wordpress options table or should i ...
0
votes
1answer
1k views

Adding a unique class to wp_nav_menu

How would I go about adding a unique class to the direct child li elements of the main parent ul element generated with wp_nav_menu? <nav id="access" role="navigation"> <div ...
1
vote
2answers
1k views

wordpress JSONAPI introspector always limits number at 10?

I'm a little new to Wordpress and the JSON API so forgive me if this is a newbie question but i'm trying to get all of the posts of a few different custom post types and return them as JSON via my own ...
0
votes
1answer
108 views

Getting a WordPress Debug Strategy

I have been reading up on debugging. I watched Chip Bennett's video on wordpress.tv and was inspired to take debugging seriously. What I have found in my reading up though has confused me a bit. I ...
0
votes
1answer
78 views

How can I add more code to this?

<?php $my_query = new WP_Query( "cat=11&posts_per_page=1" ); if ( $my_query->have_posts() ) { while ( $my_query->have_posts() ) { $my_query->the_post(); ...
0
votes
1answer
662 views

Why can't I call a (member) function from within a foreach?

I'm working with a plugin called media tags... The foreach looks as following (simplied as much as possible) foreach($mediatags as $mediatag){ $args = ...
0
votes
2answers
160 views

variable value disappears in a second loop

i can't manage to "see" the value of $originalArticle in echo '/'.$originalArticle.'== &'.$sameArticle; : i tried with "global" before, but it does not work... The output is for example : /== ...
0
votes
1answer
68 views

Client cant see the Updated dynamic content

I have came across an issue... whenever I upload new content to the site.. and i send the link to the client.. He can not view the changes instead what he see is the previously updated content. Looks ...
0
votes
2answers
1k views

I want to remove the links from the term list returned by get_the_term_list

I want to keep this category title on my pages, but I don't want it to be a link. <?php echo get_the_term_list( get_the_ID(), 'portfolio_cats', ' ', ' , ', ' '); ?> Can anyone help? Thanks
1
vote
1answer
6k views

How do I get the author's page url from their ID?

What is the best way to get the author's page url, so http://example.com/author/user73, from their ID number?