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

learn more… | top users | synonyms (1)

4
votes
3answers
1k views

Has anyone managed to integrate the wp_editor inside a widget?

Adding this in the widget form method: wp_editor($text, $this->get_field_id('text')); seems to work. But after you press the "Save" button the widget goes funky... Adding ...
0
votes
1answer
139 views

When I use rewind_post() it shows menu items in my loop

I have code like below (I removed all the uneeded HTML and stuff for this post). The code is for my author.php page. So it shows some author data at the top of the page then runs rewind_post() so ...
1
vote
2answers
174 views

How to return multiples lines in a shortcode?

I found this example of a shortcode on the Internet: function project_shortcode( $atts, $content = null ) { extract( shortcode_atts( array( 'class' => '', 'id' => '', ...
0
votes
1answer
113 views

Somehow adding to “Insert Into URL” posts are contradicting each other

I added a second upload image ( doc_thumb_box ). They both work perfectly independent of each other. But when the second one is added, the first one (doc_uri_box ) no longer pastes the value of the ...
1
vote
1answer
1k views

Sort query_posts for Parent Pages to menue order or the count?

thanks to a member here i display my Parent Pages in a 2 column grid with title and excerpt. But for some reason i can't figure out how to sort all 5 Pages by the menu order for example or the order ...
1
vote
1answer
551 views

How to hide all child pages with post_query?

i have a page template as start page(home.php). i use a 2 columns grid to display all pages on that home.php with title and excerpt. unfortunately also my child pages are shown and i can't figure out ...
6
votes
2answers
817 views

Can I use the same nonce for multiple requests on the same page?

Or does this break the purpose of the nonce, which I admint I don't quite understand it? :) For example on two ajax requests that run on page load, or when something is clicked: $.ajax({ type: ...
3
votes
2answers
288 views

How do i hide the <h2> if the <h1> appears

I'm working on a WordPress site that automatically displays an h2 on the page as what the page/post is titled. I want to manually create h1 for some pages and have the h2 to be hidden if the h1 ...
-2
votes
1answer
504 views

Too many if's and else if's ?? - Must be better way [closed]

Everyone on this forum has helped me tremendously. Thank you. I now have a page that functions the way I want it but my code seems to be cumbersome. To figure out a string to echo I have a long ...
3
votes
1answer
623 views

Variables declared in header not available in other includes

I have a var set in my header.php file: $myBool = false; and in page.php, I try to echo it: echo $myBool; But the variable is never set. This doesn't help either: global $myBool; echo $myBool; ...
1
vote
1answer
388 views

If has $title in widgets

I'm writing a widget to display 125 x 125 pixel ads. There are 6 spaces for the ads and currently all works. However, I would to add some conditional logic so that if nothing is entered in the ...
0
votes
1answer
182 views

Adding a navigation page state to individual blog and portfolio pages

I'm using a Woo Themes template (Simplicity) for a client's web site. I'm using the portfolio page as the profile pages (Our Trainers). Also have a blog category in the main nav. How do I get the ...
1
vote
3answers
129 views

How to configure self hosted wordpress so that everything can be upgraded/installed from dashboard

I have a blog on shiplu.mokadd.im. After installing wordpress I see upgrade notice time to time. Sometimes its core upgrade and sometimes its plugin or theme upgrade. Each time I try to upgade any of ...
0
votes
1answer
349 views

How to change theme programmatically from a external application?

I have a one-click Wordpress install as part of my services. After install I want to show my clients a set of themes so they can choose one and their pages will start working without any configuration ...
0
votes
1answer
347 views

Why doesn't update_post_meta work for certain strings?

I am trying to store the local path to an uploaded file as a meta for a custom post type, using the following code: $upload = wp_handle_upload ( $_FILES [WPSM_MAIL_META_ATTACHMENT], array ...
2
votes
1answer
506 views

Advanced Custom Fields - Storing array value for further usage

This might might be more of a PHP question - but does deal with a WordPress plugin, Advanced Custom Fields I am using a global select option to store a specific Location (custom post type) as the ...
0
votes
2answers
259 views

Strip Paragraph Tag

In my image.php I am using this code to grab the image caption of each image. The problem is a paragraph tag ( <p> ) is being added around it and I don't want one to be. Could somebody tell me ...
0
votes
1answer
465 views

PHP variables in a post?

I'm very new to PHP. On a Wordpress site, I want to use custom Google Maps with the Javascript API V3. Some posts will have maps in them, and I want to use PHP variables to determine the unique ...
0
votes
1answer
3k views

Creating login session via CURL

Using the following code I experienced some problems: Login works but every link in the dashboard I will click will follow into the 404 not found page. It seems that there won't be a working session ...
0
votes
1answer
133 views

Update some database fields when post is saved

I have a class that will count the Lines of Code, Source Lines of Code, and the Code disk space used. I would like to save these values into the database so that these values can be calculated only ...
1
vote
2answers
1k views

Very Slow Page - How to Optimize # of Queries?

EDIT 12/19/2011 Thank you again Ijaas. Everything is working except for the order of the days. It is ordering the groups of days by the publish order. If an older post has a newer date in its ...
0
votes
2answers
193 views

Unable to process php via shortcode

I've been searching around for a fix to this and while I definitely have a much better understanding of my issue (thanks to similar queries posted by others) I am still not sure of the solution. I am ...
0
votes
1answer
608 views

working with term_relationships table

I have this little code to insert posts via custom form: $post = array( 'post_author' => 1, 'post_title' => 'my title, 'post_content' => 'my content', 'post_category' ...
1
vote
3answers
512 views

How to make Tag Aliases

How would I build something like this with wordpress. Where multiple tags texts all go to the same page. If you click on the tag "scifi" it takes you to tag "science fiction". I am not looking for ...
0
votes
2answers
252 views

WP_Query and help with the loop for magazine front page

I'm having a difficult time writing out the PHP for this magazine layout I'm making. Here's the prototype: http://socalnpo.org Here's what I currently have: http://socalnpo.org/wp The first 3 are ...
1
vote
1answer
85 views

How does Wordpress insert Paragraphs in posts

So when looking at the html-view in the editor there is no <p> tags, when a view the post every line break is surrounded with a <p>. How?
0
votes
1answer
724 views

Function to return true if current page has child pages

I'm trying to create a simple function to do a "status test". Goal is to test and see if the current page being viewed has any child pages or not. Using this to alter layout to accomodate child ...
0
votes
1answer
538 views

$wpdb->flush(); breaks the loop

I am using $wpdb->flush(); at the base of my page in an attempt to prevent the query executing multiple times due to caching however it seems that it isn't flushing the most recent query but the ...
0
votes
1answer
341 views

MySQL query performed 4 times inside loop

I have enabled custom php in my pages through the use of the exec-php plugin so I can run more complex pages than the standard WordPress page. I have had no problems with this plugin so far. I have ...
0
votes
1answer
2k views

How to display recent posts on home page with custom HTML

I am looking to display x (undecided) number of recent posts (no more than 10) on my home page. For each post, I would like to display the title and a snippet of the content. I can whip up a SQL query ...
-1
votes
1answer
171 views

which table updated after logout?

I am working on wordpress in which on clicking logout button user will be logout using <?php wp_logout(); ?> function when I followed some guidelines on wordpress site I came to know that it ...
2
votes
1answer
750 views

How can I make the “Preview Post” button save and preview in the same window?

When you choose "Preview", which is actually a link, <a class="preview button" href="?p=52&amp;preview=true" id="post-preview" tabindex="4">Preview</a> the post is saved and the ...
1
vote
1answer
77 views

Wordpress Access allowed to fewer pages till user logs in

Is it possible in wordpress,by editing theme functions.php, to stop user access for all pages except Home, about-us, contact-us until a user is logged in to the system? All buddypress and wordpress ...
0
votes
2answers
925 views

Why is home page content not displaying with this rewrite rule?

I am trying to pass a variable from a URL to PHP using mod_rewrite while maintaining standard WordPress functionality. Here's my mod_rewrite rules: RewriteEngine On RewriteBase / RewriteRule ...
0
votes
1answer
203 views

Modifying WP URL handing code?

I am trying to use mod_rewrite and modify WordPress' URL handling to allow for passing variables to PHP from the URL while maintaining "pretty permalink" functionality. (on WP 3.2.1) Something like ...
0
votes
1answer
678 views

Uses for function: wp_update_user

my theme currently uses the wp_update_user function to update a set of user metas. I created to some new user meta fields that I would like to include in the existing wp_update_user. The function ...
0
votes
1answer
228 views

Problem using explode inside add_shortcode() callback funciton [closed]

Explode not working as i expect inside add_shortcode() callback funciton. Here is the scenario: My implemented sortcode is like this: [table] name1 = value1; name2 = value2; name3 = ...
1
vote
1answer
2k views

Using require_once in a Plugin?

Whats the difference between these two code snippets, and which one should I use for a WordPress plugin? require_once(dirname(__FILE__).'/inc/canagan_admin_functions.php'); require_once( ...
2
votes
1answer
2k views

How can I see all the actions attached to an “add_action” hook?

I'm working with the admin bar and trying to debug some of the menus and their priorities. I know several callbacks get bound to actions, such as this one: add_action( 'admin_bar_menu', ...
3
votes
2answers
88 views

Wordpress will not operate correctly

My website is ImASpy.com. If you click on the link, Findings, this takes you to my first Wordpress page. It appears to work fine until you click on comments, or you try to go to the about page, which ...
1
vote
2answers
763 views

Theme Options: If There is No Input, Don't Display?

I have built a custom options panel which allows site owners to enter their social profiles. I then use the second code to make the links appear in the theme. When no link is entered in the options ...
1
vote
2answers
173 views

How do I implement a .diff changeset from core.trac.wordpress.org locally?

I have a local copy of the latest version of wordpress that I set up using svn co http://core.svn.wordpress.org/trunk/ There is a diff that I want to pull into my local fileset: ...
0
votes
2answers
202 views

WordPress Stripping Colons?

I'm souping up a WP theme with the BuddyPress plugin to make a cool hybrid of sorts between the two. Anyway... I'm using the following to grab author RSS urls. The problem being the colon ":" is ...
0
votes
2answers
2k views

I am extending Walker_Nav_Menu: How can I get the number of children elements of the current item?

I am trying to extend the Walker_Nav_Menu walker to make some changes to the way WP outputs menus. The method I have to override is start_el, so I created my Walker and copied the base method: ...
0
votes
1answer
327 views

Defining 'last' class on foreach blog posts

I'm using the following code to display the latest 3 blog posts on my front page but I need to add a last class to the 3rd post on the ID blog. <?php $args = array( 'numberposts' => 3 ); ...
0
votes
4answers
112 views

Create a slug for a page in WordPress

How can I create a slug for a page in WordPress? I see that there are custom formats available, but I would like to be able to specify things like: mydomain.com/about mydomain.com/home ...
1
vote
1answer
716 views

Preferred Method of debugging a wordpress SQL calls?

What is your preferred method of debugging Wordpress Applications when writing custom behind-the-scenes SQL calls, etc. ? Coming from a Rails background, I usually tail a log file that displays not ...
0
votes
2answers
208 views

How to make modifications only to certain elements of an HTML string on the server-side?

Is there a similar way to select / perform DOM manipulation on the server-side (PHP) like the way jQuery works? For example, if I wanted to modify content of each <pre ...
1
vote
1answer
323 views

How do I alter the comment form 'allowed tags' text in a plugin?

I'm using the PHP Markdown plugin, and I'd like to modify it so that it adds some text to the bottom of the comment form indicating that Markdown is supported in comments. I've been modifying my ...
1
vote
3answers
1k views

Import 10,000 Users into Wordpress WITH a specific ID for each user

I have a website which has about 10,000 users. I am converting this site over to Wordpress. The new site is ready to roll, but I have to bring over all the users. There are a number of plugins ...