How Can I add some js files from a plugin to a specific location with add_action I am Using this widget: http://www.designchemical.com/blog/index.php/wordpress-plugins/wordpress- plugin-jquery-vertical-accordion-menu-widget/ It is adding its file here: After                <script type='text/javascript' src='http://new.dajewelers.com/wp-includes/js/l10n.js?         ver=20101110'></script>       <script type='text/javascript' src='http://new.dajewelers.com/wp- includes/js/jquery/jquery.js?ver=1.4.4'></script>      and before these lines:                  <script type='text/javascript' src='http://new.dajewelers.com/wp-includes/js/jquery/ui.core.js?ver=1.8.9'></script>         <script type='text/javascript' src='http://new.dajewelers.com/wp-includes/js/jquery/ui.widget.js?ver=1.8.9'></script>         <script type='text/javascript' src='http://new.dajewelers.com/wp-includes/js/jquery/ui.tabs.js?ver=1.8.9'></script>          <script type='text/javascript' src='http://new.dajewelers.com/wp-includes/js/jquery/ui.mouse.js?ver=1.8.9'></script>         <script type='text/javascript' src='http://new.dajewelers.com/wp-includes/js/jquery/ui.resizable.js?ver=1.8.9'></script>      Its code is basically for accordion and I think it is not working because it is coming before JQuery.ui files. So I want it to come after UI Files. Please can some one figure out the problem or if same is problem then how to fix that. And this is wp code that is doing so                   if(!is_admin()){             // Header styles             add_action( 'wp_head', array('dc_jqaccordion', 'header') );                  // Scripts             wp_enqueue_script( 'jquery' );             wp_enqueue_script( 'jqueryhoverintent', dc_jqaccordion::get_plugin_directory() . '/js/jquery.hoverIntent.minified.js', array('jquery') );             wp_enqueue_script( 'jquerycookie', dc_jqaccordion::get_plugin_directory() . '/js/jquery.cookie.js', array('jquery') );             wp_enqueue_script( 'dcjqaccordion', dc_jqaccordion::get_plugin_directory() . '/js/jquery.dcjqaccordion.2.8.js', array('jquery') );         }      Here is the link where all this is : http://new.dajewelers.com Please tell if you have any idea. thanks in advance.


Wp-minify doesn't seem to minify my JS code

I've added to the theme (twenty ten) a php template file in which I've written some javascript code.   I then created a new page and set it to use that template.   Then I installed and activated the 'wp-minify' plugin hoping for it to drop the blanks and comments.   But when I look at the page's source code in the browser I see the code regularly.   Your advice will be appreciated.


Can anyone identify this like plugin (not facebook like)?

Almost all divs say **wpl** but can't find which plugin is. For example, `#wpl-likebox`. Here is a page that is using it: http://wpdevel.wordpress.com/2011/05/25/jquery-updates-in-wordpress-3-2/


wp e-commerce sort by stock

I have a site using wp e-commerce plugin and want to sort items by stock. I have been trying for hours without any luck:   * I don't have an option to sort by "SKU" in the administration (as I've read somewhere).   * I have tried using "query_posts" and the result is an infinite loop.    * I have tried accessing wp_query and then setting the query and it doesn't have any effect (maybe it's too late to set the query in the template? Thanks for any help you could provide.


How to create large page

I have page (not a post), which html output is about 150kB, which WP cuts, when pasted into editor. How to set WP for large pages?


Is it possible to host a WordPress site entirely on Cloudfront?

I love the Cloudfront approach described here: http://www.paessler.com/blog/2011/04/12/network-monitoring- basics/hosting_a_website_through_amazon_cloudfront I wonder if this is possible to do with caching plugins that create static html files?


Searching users with WP_List_Table plug-in

I am trying to devlope a plugin that will search and return my users so I can edit some other metatdata that belongs to them. I have been using the plug-in listed on the Codex as my starting point. I have my table appearing with the the users from a WP_User_Query. But I am having issues with filtering the query with the search input. Wildcard search _mysearch_ will return the table correctly, but going to the second page returns back to a blank search. The search variable is not being placed in the url. How do I pass this to the url? (the pagination is passed only) Also is there a way to change it so that I do not have to physically at "*" before and after the search parameters and have it done in the code? Here is my query:               function prepare_items() {         global $wpdb;              $searchcol= array(         'ID',         'user_email',         'user_login',         'user_nicename',         'user_url',         'display_name'         );              $orderby = !empty($_GET["orderby"]) ? mysql_real_escape_string($_GET["orderby"]) : 'email';         $order = !empty($_GET["order"]) ? mysql_real_escape_string($_GET["order"]) : 'ASC';              $args  = array(         'fields' => 'all_with_meta',          'orderby' => $orderby ,          'order' => $order ,          'search' =>$_REQUEST["s"] ,         'search_columns' => $searchcol         );              $my_query = new WP_User_Query( $args );     }      and here is my search field:                   function my_render_list_table_page(){         global $my_list_table_sample_page, $wpdb;              $my_list_table_sample_page->prepare_items();         <form action="" method="post" >     <?php        $my_list_table_sample_page->search_box( __( 'Search Users' ), 'user' );         $my_list_table_sample_page->display();         $my_list_table_sample_page->display();        echo '</form>';      }


Redirect when the site's home is set to a page

Is it possible to have Wordpress display the full URL string when a specific page listed more than one level deep is set up as the home page under Reading settings? If I have example.com/parent/child set up as the home page under WP, I want that full string displayed in the browser, not just example.com. Thank you!


Where is wp() function definition?

In WordPress source code, there is one point I can not understand. In /wp- blog-header.php, there is a call to wp() function. However, I can not find any definition for that function. How this call don't cause error?


What would make the plugin update process to complete but don't report as such?

This is happening in two sites I've restored using BackupBuddy*. One is single, the other Multisite. .* _this may render the question as "too localized", but maybe it could happen with any other backup/restore tool_ Whenever upgrading (single or bulk), the message appears: " _The update process is starting_ ", the spin keeps spinning, but doesn't goes past this point.   If bulk upgrading, only the first upgrade is shown as in progress. I give it a few minutes to be sure. All updates were successful and the site is **not** in maintenance mode.   WP_DEBUG doesn't report nothing. The server error_log don't have any info. The browser console don't throw any errors. I tried to delete the `update_plugins` transients, but now the update gets stuck in the message: "Downloading update from..."   It completes anyway. Looks like all of this is handled inside the file `/wp-admin/includes/class- wp-upgrader.php`, but I can't find any hint inside of it.


Wordpress very high load when click "Publish"

My site is currently having 70000 posts, and generate about 1.4 million views per month. Specs are Quad-core Xeon, 8GB RAM, FCGI Plugins: W3 Total Cache, Jetpack, WP Page Navi, Contact Form 7, Discuz, Events Problem: Whenever my uploaders publish news, the server load will spike. and When 2 or 3 of them upload news at the same time, the server will hang for a few minutes (Internal Server Error) and then back to normal again. Tried: Changing permalinks, changing to wpsupercache, optimised theme queries. I've been having this problem for a year plus but still did not find a way to solve. Anyone have any idea? Thank you. PS: All plugins and wordpress are updated everyday.


Adding profile data to database

I added a custom field to my wordpress user profile page that asks a user what their favorite browser is. I have the field on the profile.php page, but how can I get this field into my sql database? What sql script do I need that will insert the user's answer into the table by their corresponding user meta number? Thanks


Trying to figure out why my child theme is trying to access a file that doesn't exist

This is my attempt at making a child theme, and everything seems to be working well, however when I view the source code I'm seeing this `<link rel='stylesheet' id='bootstrap-css' href='http://wpdallas.com/test/wp- content/themes/Standard/css/lib/bootstrap.css?ver=3.3.1' type='text/css' media='all' />` which gives me a 404 error. I'm not sure what's going on, and how to fix this....and what problems this could cause me. The site seems to be working fine even with that error. I'm just trying to figure out what it is. Thanks


Multiple Loops That Pull Pages (Child/Grandchild) While Styling the First Entry

This is either something really simple that I've orchestrated into a complex problem or it really is a complex problem. I've decided to use pages to display information. If I go to a page called Houston, I want to see the subpages of Houston, but also the children of those subpages. I'd like these styled in a block format similar to a "magazine" website. I think I'm really close, but it's just eluding me. Here's a diagram of what I'm trying to accomplish in case my description is not up to snuff. ![enter image description here](http://i.stack.imgur.com/e987x.gif) The code I'm using...               <?php     $my_query = new WP_Query(         array(             'sort_column'  => 'menu_order, post_title',             'depth' => 2,             'showposts' => 30,             'post_parent' => $post->ID,             'post_type' => 'page'         )     ); ?>     <?php $count = 0; ?>       <?php while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID; ?>     <?php $count++; ?>            <?php if ($count == 1) : ?>

<a href="<?php the_permalink(); ?>" ><?php the_title(); ?>

<?php the_content('read more...'); ?>

     <?php elseif ($count == 4) : ?>

<a href="<?php the_permalink(); ?>" ><?php the_title(); ?>

<?php the_content('read more...'); ?>

     <?php else : ?>

<a href="<?php the_permalink(); ?>" ><?php the_title(); ?>

<?php the_content('read more...'); ?>

     <?php endif; ?>      This is pulling in the children of Houston but not the grandchildren. It is styling the first child but...I just want the title of the child, then the first grandchild to be styled. I guess what I'm looking for is a multiple loop? Am I setting myself up for failure with this path?


show/hide menu item(s) on specific pages (not on user roles)

I wish to keep a menu item hidden on homepage & vice-versa (user roles don't matter here). **Scenario** In my Primary Menu, I have created two menu items **Get Quote** ( _menu- item-1_ ) and **Get Quote** ( _menu-item-2_ ) The first menu item (menu-item-1)) scrolls down to an anchor on the homepage. The second menu item (menu-item-2) links to an internal domainname/get-quote- page/. Now as you can understand, I wish to show the first menu (menu-item-1) on the homepage only since it's linked to an anchor present on the homepage only. The second menu item (menu-item-2) needs to remain invisible on the homepage only. I tried with CSS               /* this is for the menu-item-1*/     .menu-hide {     display:none!important;     }     .page-id-1 .menu-hide {     display:inline-block!important;     }     /* this is for the menu-item-2 */     .page-id-1 .another-menu {     display:none!important;     }      Then I append the classes to the desired menu items. I wish to know, is the only way to do this or is there a better way to accomplish this. Any help will be appreciated. Thanks


Display posts the match taxonomy term linked from wp_list_categoies?

This should be simple, but it escapes me. I have a custom post type and a custom taxonomy. The taxonomy is named "asset_type" and the slug is "type" I am using `wp_list_categories` to provide a sidebar menu where users can click to view posts in the clicked taxonomy. For example:               <div class="category-sidebar"><?php                 $args = array('post_type' => 'design_asset', 'show_count' => 1, 'taxonomy' => 'asset_type');                 wp_list_categories($args);                 ?>     </div>      This displays correctly my tax terms, for example, "element", with the link of `http://site.dev/type/element/` It goes to the page, but I can't figure out how to modify my loop so it only shows posts that match the current term, in this example "element", nor display the title of the page as "Element". My loop to display ALL the posts is:               $args = array( 'post_type' => 'design_asset', 'posts_per_page' => 100, 'orderby' => 'title', 'order' => 'ASC'  );     $loop = new WP_Query( $args );     while ( $loop->have_posts() ) : $loop->the_post();


Create a loop that gets pages with their template

I am trying to make a template that will be an html5/ vertical scrolling base. I have created an amount of page templates that each would represent a `<section>` on index.php which mainly all it does is to retrieve the child pages of a page I named `ROOT` using this:               // Set up the objects needed      $my_wp_query = new WP_Query();      $all_wp_pages = $my_wp_query->query(array('post_type' => 'page'));          // Get the page as an Object      $mainpage =  get_page_by_title('ROOT');          // Filter through all pages and find Portfolio's children      $children = get_page_children( $mainpage->ID, $all_wp_pages );      Is there a way to render the output with the each page template? The page hierarchy is like this:               ROOT     - Page1 (template: foo1)     - Page2 (template: foo2)     - Page3 (template: foo3)     - Page4 (template: foo1)      so what I am trying to achieve is to have an output like this:               <section class='page<?php the_ID(); ?>'>     [content with template foo1]
     <section class='page<?php the_ID(); ?>'>     [content with template foo2]
     <section class='page<?php the_ID(); ?>'>     [content with template foo3]
     <section class='page<?php the_ID(); ?>'>     [content with template foo1]


Showing content from another wordpress installation database in the page template loop?

I am just wondering if it is possible to show just the page content of another wordpress database on wordpress pages with the same pageID within the content loop in my page template. To be more specific, I want to show the content of one separate wordpress database in another wordpress installation without duplicating it. Its just the page content I want to get, so no articles needed. The structure and page ids of the two wordpress installations are identical. I want to adress the database using $wpdb but have no idea how to deal with that problem and if its possible to solve it at all? * * * edit: They are not the same domain. And thank you for commenting, kaiser! I want to have two separate, identical wordpress installations, sharing the page content of one single database, but keeping their individual local settings (local database), themes and styles. As I said, the structure of the sites (navigation, page IDs) is identical. In this case I use Wordpress more like a CMS then a Blog System, and the media library is delivered via CDN, so media- content won't be a problem in shared content. My first idea was to get $wpdb in my page template to get the content of the external database. But this would mean to adress the page content by page ID, wouldn't it? * * * edit2: Here's what I tried today:                   <?php         $wpdbtest = new wpdb('username', 'password', 'dbname', 'host');              $query = "SELECT post_content, guid FROM myprefix_posts             WHERE post_status = 'publish'             AND post_type = 'page'";              $myposts = $wpdbtest->get_results($query, OBJECT);             foreach($myposts as $mypost)             echo "{$mypost->post_content}";         ?>      I put this code into my page template and I even got the post_content output. But as far as I am concerned, this is NOT what I was looking for. Shortcodes won't be parsed and performance may be a problem too. Do you guys know any possible way, to make wordpress parse shortcodes that were received out of an external database? As I said, the two wordpress installations are identical, so al shortcodes are well defined in each functions.php. Thank you!


How would I attach media/images to a post based on a ID stored in a each post's custom field

I have converted a site over to wordpress recently. I was able to import all the posts via a CSV importer, but not the images associated with each post. The post type is " **machinery** ". The custom field with the post's previous ID on the old system of each post is called " **machinery_legacy_idLocation** ". I have an additional table called " **legacy_images** ". " **legacy_images** " has 2 columns " **ListingID** " and " **imageurl** ". " **ListingID** " in the " **legacy_images** " table matches a post with the same " **machinery_legacy_idLocation** ". Now the "imageurl" matches the title of a corresponding image that I have already added to the media library in Wordpress. Basically I just need to figure out a way to reattach all these images to all these posts after the move.


Permalinks only for posts

I would like to use wordpress permalinks but **only** for posts. Is there any way to do that? I don't care about seo, my website is about niche subject so it already has first position in google. Also enabling permalinks makes some conflicts with plugins I have installed. I would be completly fine without permalinks but I don't like appearance of post's links - ?p=some_numbers - instead of that I would like something prettier, like post name and date. How can I achieve that without enabling permalinks? Maybe somehow in .htacces file? But then how do I get post name? Or maybe I should use permalinks but edit rewrite rules (honestly I have no idea how to do that)?


Include root files into header files

I want to files from the root directory of my site inside my WordPress header file. Is there any function for including a file from the root folder?


Getting duplicate rows in database through custom hardcoded signup page using Cimy User Extra Fields for autochimp sync

I have a custom coded sign up page where users fill in additional fields beyond the standard username and email. My end goal is to have these additional fields sync with my mailchimp mailing list. I am achieving this sync with the autochimp plugin. Unfortunately autochimp cannot sync custom fields in the wp-usermeta table. It can however sync fields created by the Cimy User Extra Fields plugin. I want to use the tables created by the Cimy User Extra Fields plugin the same way I would use the wp-usermeta table. Unfortunately when I create a new user from the sign up form, the Cimy User Extra Fields plugin inserts an additional row on top of the one I inserted manually. Does anyone know how to prevent this? Here is the code I am using to insert the custom fields into the Cimy database:               $wpdb->insert(          'wp_cimy_uef_data',           array(          'ID' => $last_id+1,          'USER_ID' => $status,           'FIELD_ID' => 1,          'VALUE' => 'This is a sample value'),                array(                 '%d',                 '%d',                  '%d',                  '%s'             )          );


How to check if page has status published

How to check if page `id(SomeID)` is actually published?


get_posts not finding argument: post_name

I am digging up posts with a specific slug: Where               $postSlug = 'abc'          $args = array(               'post_name' => $postSlug,               'post_type' => 'post',               'post_status' => 'publish'             );         $slugPosts = get_posts($args);      Output of $slugPosts[0]->post_name:               $slugPosts[0]->post_name = 'xyz'      What am I doing wrong here? How can I get a post from a slug?


How can you make sure authors' posts are longer than 250 words?

I'm making a website that authors can sign up to and write articles. However I don't want low quality posts submitted. So, firstly I want the posts to be not empty and to be longer than 250 words. So something like:               if (empty($post) && $post < 250) {      echo 'Error, must be longer than 250 words';     }      Obviously this code will not work but that is a general idea of what I want. However, I'm not really sure how to go about this. Is their a WordPress hook to use?


Run WP inside a other Site without using frames

We have to put a Wordpress-Site inside an other website without doing this using frame/iframe, so the header, navigation e.g. comes from the parent site. A blank parent site fragment with markers for header, content exists. This should be loaded by the theme or a plugin and markers replaced by the wordpress outputs. So what's the best way to do that? Are there any plugins for such a strange requirement?


Wordpress site running on Yoast not being indexed into Google News

I have a site that was migrated a week ago from Movable Type 4 to WordPress and ever since then, the posts are not getting indexed into Google News. We used the same meta key that we used on MT4 and we did not change the domain name in the migration. We did, obviously, change to pointer to our multi-site WP installation on a new server. We are using the Yoast plugin for all of our sites on the new WP server. Another site that was migrated shortly before this one is being successfully scooped up by Google. I removed any static sitemap files that might have been kicking around (I did that today) since the one site that is in Google news has no static sitemaps. Is it possible Google found a conflict between the static sitemap that was brought over on the migration and Yoast plugin. I get an error in Google webmaster tools that it looks like my Yoast sitemap is an html file. But I don't have control over it do I? And it's identical to the one that works. This one works and is indexed by Google News This one doesn't work and isn't indexed, but it used to be when it was in Movable Type. Anyway ideas on what I can try next?


documentation on arguements?

I have seen many different parameters or arguments that can be passed to a query. For example, category_ _in, category_ _and term_id to name a few. Some of these can be found by using print_r to print out the object. ( If I have that right ). Others like the category__in I have been unable to find in codex. Is there a trick to learning about these parameters? How do I find them?


Add Javascript to Wordpress Menu

Is there a way to put javascript in the URL portion of a Wordpress menu item? I have a live chat function on my site, and I am supposed to put this code onto the site to make a link to open the live chat (as suggested here).               <!-- BEGIN OLARK CHAT LINK -->     <a href="javascript:void(0);" onclick="olark('api.box.expand')">         Click here to chat!     </a>     <!-- END OLARK CHAT LINK -->      The client wants the link in the utility nav bar, which was created used a Wordpress menu in the Wordpress dashboard. But when I copy and paste `javascript:void(0);" onclick="olark('api.box.expand')` into the URL box in the Wordpress dashboard, it just disappears and the link remains inactive. Something I read said that maybe I could put a custom class on the link in question and then write a Javascript function that fires when the link with that class is clicked. I tried that, though, and I couldn't get it to work. I'm don't know much Javascript, so it's possible I was writing it entirely wrong. Does anyone know how to do this? I would like to do it without using a plugin.


adding a custom css class to post

essentially I need to be able to add a class to a post when it show in the list (say index.php) so when in the back end you can say oneCol, twoCol, threeCol and it will then output this within the loop post class. This is to enable a tighter control of the layout. using this line of code for the output?               <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>      Thanks in advance!


Display four buddypress activies

Hi I am trying to create a buddypress theme and I kind of figured out how to do it but I need to create an activity loop that displays only 4 activities.Now if I wanted to do this in a normal wordpress loop I would I have done this:               query_posts(array(                   'posts_per_page'=>'3',                   'post-type'=>'post',                   'paged' => get_query_var('paged')                  )                        );      I have tryed this in the activity looop but this does not work.This is the loop I created for the activity stream:               <?php if ( bp_has_activities() ) : ?>
                               <?php while ( bp_activities() ) : bp_the_activity(); ?>                                        <li class="<?php bp_activity_css_class() ?>" id="activity-<?php bp_activity_id() ?>">
                                           <a href="<?php bp_activity_user_link() ?>">                                               <?php bp_activity_avatar( 'type=full&width=40&height=40' ) ?>

                                               <?php bp_activity_action() ?>
                                                <?php if ( bp_get_activity_content_body() ) : ?>
                                                   <?php bp_activity_content_body() ?>
                                           <?php endif; ?>                                                <?php do_action( 'bp_activity_entry_content' ) ?>

                                    <?php endwhile; ?>
                                 <?php else : ?>

<?php _e( 'Sorry, there was no activity found. Please try a different filter.', 'buddypress' ) ?>

                            <?php endif; ?>
      What do I need to modify in order to display only the lates 4 activities?


remove_meta_box for all post types doesn't seem to work

To remove a metabox from all post types at once, using a `foreach` seems like the logical thing to do. However it doesn't always work and I don't understand why. For examlple viewing the "Post" post type the following only removes the `trackbacksdiv` :               function remove_metabox_from_all_post_types() {     $post_types = get_post_types();     foreach ( $post_types as $post_type )                 remove_meta_box('trackbacksdiv', $post_type, 'normal');                 remove_meta_box('postcustom', $post_type, 'normal');                 remove_meta_box('authordiv', $post_type, 'normal');                 remove_meta_box('postexcerpt', $post_type, 'normal');          }     add_action('admin_menu', 'remove_metabox_from_all_post_types', 999);      While this removes all of them when viewing the "Post" post type:               function remove_metabox_from_all_post_types() {     $post_types = get_post_types();     foreach ( $post_types as $post_type )                 remove_meta_box('trackbacksdiv', 'post', 'normal');                 remove_meta_box('postcustom', 'post', 'normal');                 remove_meta_box('authordiv', 'post', 'normal');                 remove_meta_box('postexcerpt', 'post', 'normal');          }     add_action('admin_menu', 'remove_metabox_from_all_post_types', 999);      I would think that `get_post_types` is fired after the metaboxes are registered, but that's the only reason I can guess it's not working the first way, unless it's a careless syntax error that I'm not picking up. I tried using the `do_metaboxes` actions hook as well but it didn't make a difference. Any ideas?


Search functionality with multiple categories

Good day fine wordpress gurus, I'm having a tough time writing a function that handles the search in a couple of user-selected categories. The way I'm presenting the categories is through the old get_categories method and I'm iterating through the array in order to build a category tree with checkboxes (client requirement). So what I need is a hint of how to get the search in such a way that it includes the search term and the cat_ID's that the user selected in order to bring the relevant results. PS: I already checked out Wordpress Multiple Category Search this link, and I didn't find anything useful. so please help.


Display all posts/pages in a multiple selectbox

So I'm looking for a way to show all posts/pages inside a multiple selectbox, which is used to select and store which page/posts has been checked in order to display some text on that page(custom plugin). I'm looking to get the id of the posts/pages so that I can save these and use on the frontend of the templates. I did use get_pages() but these dont output anykind of page id.


How to make scheduled post preview visible to anyone?

When I write a post and schedule it for later publishing, WordPress will allow me to preview the post as if it was already published but I need to be logged in as administrator (or anyone who is authorized to preview the post). Is there a way, possibly a query string parameter, to make the post previewable by anyone, i.e. also by anonymous users? Something like `my- post?previewsecret=645732116468`?


Wordpress Book Exchange Plugin Equivalent?

I have a client which is in need of an entirely new website. One of the features of their existing website that they wish to keep is a student book exchange, where:   * students can sign-up and post any number books that they have to sell   * set a price for their own books   * take their books down from the website once their book as been sold   * other students can search for the book by title, author, or ISBN They do not wish to have an online payment system, so a full-fledged online store isn't an ideal substitution. Here the site with the book exchange that I am mentioning: > http://www2.gcc.edu/orgs/sga/bookx.php Since I do not have the time to develop a content management system, or a plugin for an existing CMS, I am going to install Wordpress for them to use, largely because of its ease-of-use and flexibility. Are there any Wordpress plugins that would serve as a good substitute for the existing book exchange, where students can sign up, but not have access to out control panels, just their books? Thank you for your time!


Trying to output content from page, works locally but not online

I am using the following code, to output the content from a page with the id of two. This is in my custom template file which is selected in the page. It works fine locally but online it does not work, it outputs nothing, the id is based of this url `http://www.goodmorningmoon.ca/wp- admin/post.php?post=2&action=edit` What might I do to diagnose this problem.               <?php $my_query = new WP_Query('page_id=2'); ?>     <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>     <?php the_content(); ?>     <?php endwhile; ?>


Auto generate rewrite rules for multiple taxonomies

so i'm back with rewrites... i am looking for a more automated solution. i stumbled across this on the interwebs:               /**      * Generates all the rewrite rules for a given post type.      *      * The rewrite rules allow a post type to be filtered by all possible combinations & permutations      * of taxonomies that apply to the specified post type and additional query_vars specified with      * the $query_vars parameter.      *      * Must be called from a function hooked to the 'generate_rewrite_rules' action so that the global      * $wp_rewrite->preg_index function returns the correct value.      *      * @param string|object $post_type The post type for which you wish to create the rewrite rules      * @param array $query_vars optional Non-taxonomy query vars you wish to create rewrite rules for. Rules will be created to capture any single string for the query_var, that is, a rule of the form '/query_var/(.+)/'      *      * @author Brent Shepherd <me@brentshepherd.com>      * @since 1.0      */          function eg_generate_rewrite_rules( $post_type, $query_vars = array() ) {         global $wp_rewrite;              if( ! is_object( $post_type ) )             $post_type = get_post_type_object( $post_type );              $new_rewrite_rules = array();              $taxonomies = get_object_taxonomies( $post_type->name, 'objects' );                 // Add taxonomy filters to the query vars array         foreach( $taxonomies as $taxonomy ){             //$query_vars[$taxonomy->rewrite['slug']] = $taxonomy->query_var;             $query_vars[] = $taxonomy->rewrite['slug'] ;             add_rewrite_tag('%'.$taxonomy->rewrite['slug'].'%','([^&]+)');         }              // Loop over all the possible combinations of the query vars         for( $i = 1; $i <= count( $query_vars );  $i++ ) {                  $new_rewrite_rule =  $post_type->rewrite['slug'] . '/';             $new_query_string = 'index.php?post_type=' . $post_type->name;                  // Prepend the rewrites & queries             for( $n = 1; $n <= $i; $n++ ) {                 $new_rewrite_rule .= '(' . implode( '|', $query_vars ) . ')/(.+?)/';                 $new_query_string .= '&' . $wp_rewrite->preg_index( $n * 2 - 1 ) . '=' . $wp_rewrite->preg_index( $n * 2 );             }                  // Allow paging of filtered post type - WordPress expects 'page' in the URL but uses 'paged' in the query string so paging doesn't fit into our regex             $new_paged_rewrite_rule = $new_rewrite_rule . 'page/([0-9]{1,})/';             $new_paged_query_string = $new_query_string . '&paged=' . $wp_rewrite->preg_index( $i * 2 + 1 );                  // Make the trailing backslash optional             $new_paged_rewrite_rule = $new_paged_rewrite_rule . '?$';             $new_rewrite_rule = $new_rewrite_rule . '?$';                  // Add the new rewrites             $new_rewrite_rules = array( $new_paged_rewrite_rule => $new_paged_query_string,                                         $new_rewrite_rule       => $new_query_string )                                  + $new_rewrite_rules;         }              return $new_rewrite_rules;     }                    // add the rules     function mv_add_rewrite_rule($wp_rewrite){         $new_rules = eg_generate_rewrite_rules('product');         $wp_rewrite->rules = $new_rules + $wp_rewrite->rules;     }     add_action('generate_rewrite_rules','mv_add_rewrite_rule',99);      http://thereforei.am/2011/10/28/advanced-taxonomy-queries-with-pretty-urls/ but while this works great if you don't have rewrite slugs set for each custom taxonomy, it fails if your rewrite slug is something different from your query var. (since it is auto-adding the query_var grabbed in the $match as the query string. how can i amend this function so that it will match the rewrite['slug'] but add the associated query_var to the query string. phew... i hope that made sense. OR, does this sound possible at all? would it be advisable to hard-code the re-write rules instead? product-categories/fabrics/color/red product-tags/new/style/jacquard ( product-category OR product-tag ) / ( color OR style OR material trim-style)


Adding extra authentication field in login page using all in one wp security plugin in wordpress

I am going to enhance my WordPress authentication page. My idea is that simply adding an extra field into the login page. The extra field will require user to enter personal identification code (4 to 8 digit). i use the plugin all in one wp security plugin in wordpress


Same taxonomy for different object types

Starting with WP 2.3 we can do this:               register_taxonomy('custom_taxonomy', array('user', 'post', 'link', 'comment'));      Those are different object types that belong to different tables and hence can have same primary key ID. Now if we take a look at the functions used to get or check terms, they all lack object_type parameter.               is_object_in_term( $object_id, $taxonomy, $terms = null );     wp_get_object_terms( $object_ids, $taxonomies, $args );      As a matter of fact, there is no reference to object type in term_relationships table at all, and you are going to get false positives for objects with same IDs. How can one fix that?


plugin code is pulling information from database in one instance and not in other. What is wrong?

In my plugin code, I am pulling the table id from two tables. The id is being pulled from one table but not from the other and I get errors in both instances. The queries work on mysql when I use them. any thoughts? code is below and output below that. The id gets pulled from the wp_shclass table but not the wp_shinstructor table. Any thoughts I have been staring at this for a few days and am not sure what's wrong. I am using wp 3.3.1               function shmain_admin(){     if (!current_user_can('manage_options'))  {     wp_die( __('You do not have sufficient permissions to access this page.') );     }          echo "Hello class";     global $wpdb;     $shrow = $wpdb->get_row("select * from wp_shclass ORDER BY classid DESC LIMIT 1", ARRAY_A);       $shclassid = $shrow['classid'];     echo "
 this is " . $shclassid;     $wpdb->show_errors();     $wpdb->print_error();     echo "
 Hello instructor";     $shrow = $wpdb->get_row("select * from wp_shinstructor ORDER BY instructorid DESC LIMIT 1", ARRAY_A);       $shinstructorid = $shrow['instructorid'];     echo "
 this is " . $shinstructorid;     $wpdb->print_error();     }          function shmain_admin_action(){     add_menu_page('sh main', 'main', 'manage_options','shmain', 'shmain_admin');     }          add_action('admin_menu','shmain_admin_action');      and here is the output below * * * Hello class this is 8 > >     WordPress database error: [] >     select * from wp_shclass ORDER BY classid DESC LIMIT 1 >   Hello instructor this is > >     WordPress database error: [] >     select * from wp_shinstructor ORDER BY instructorid DESC LIMIT 1 >


wp_insert_post not updating custom taxonomy selected if logged in as a subscriber

Here is my Code, it works fine When i try to post data from front end if Logged in as admin, but if i logged in as a subscriber code works fine but it is not inserting the taxonomy term i select, here is the code..                 $new_post = array(         'post_title' => $postTitle,         'post_content' => $post,         'post_status' => 'publish',         'post_date' => date('Y-m-d H:i:s'),         'post_author' => $user_ID,         'post_type' => 'publications',         'tax_input' => array( 'publicationstype'=> $term_id )          //'post_category' => array(6)     );          wp_insert_post($new_post);      here 'publicationstype' is the custom taxonomy, is there any one, who can help me!! thanx in advance


Add Title Attribute to WordPress Image the_post_thumbnail

i use this code to show post's thumbnail in my site but this code cant show the title Attribute of the thumbnails. **how can i add Title Attribute to WordPress thumbnails?**               <?php if ( has_post_thumbnail() ) {     the_post_thumbnail('large');       } else {?>     <img alt="<?php the_title(); ?>" title="<?php the_title(); ?>" src="<?php bloginfo('template_url'); ?>/img/thumbnail.png"/>     <?php }?>      you can see my site with this url : http://rokesh.ir


Load post conditionally

I am working on a website which displays only 3 posts unless people subscribe for a newsletter. This is done by setting a cookie on validation and inserting this cookie conditionally in my queries. There is only one problem, visitors should be able to click to a next post from within a post. With single.php I can show them other content based on the cookie (like "you have no access") but I don't know how to use the cookie to stop Wordpress from loading the post at all. Like it was set on private or concept. Anyone, any idea? Thanks, juri


Problem for recover and save metaboxes

I create metaboxes but i can´t save data and also no show data insert into field , this is my code                   <?php     function reaction_buttons_meta2()      {     global $post;     echo $_POST['reaction_buttons_off2'];     update_post_meta($post->ID, 'reaction_buttons_off2', $_POST['reaction_buttons_off2']);     $meta=get_post_meta($post->ID, $field['reaction_buttons_off2'], true);      ?>     <input type="text" id="reaction_buttons_off2" name="reaction_buttons_off2" value="<?php echo $meta[reaction_buttons_off2][0]; ?>">     <?php     }     ?>     <?php     function reaction_buttons_meta_box2()      {     add_meta_box('reaction_buttons2','Reaction Buttons','reaction_buttons_meta2','post','side');     add_meta_box('reaction_buttons2','Reaction Buttons','reaction_buttons_meta2','page','side');     }     add_action('admin_menu', 'reaction_buttons_meta_box2');     ?>


How to add a "publish" link to the quick actions

I'm trying to add a "Publish" link by the quick actions: ![enter image description here](http://i.stack.imgur.com/UXA38.jpg) but I'm not exactly sure of how implement it. Here's what I've got so far:               add_filter('post_row_actions', function ( $actions )     {         global $post;              // If the post hasn't been published yet         if ( get_post_status($post) != 'publish' )         {             $nonce = wp_create_nonce('quick-publish-action');                  $link = get_admin_url('path to where') . "?id={$post->id}&_wpnonce=$nonce";                  $actions['publish'] = "Publish";         }              return $actions;     });      As you can see, I don't know where to link to in `get_admin_url`. I think I should be using `wp_publish_post()`, but I don't know where to put that code, and how to link to it.


Can't use the built-in wordpress install/upgrade plugin feature

When I try to upgrade or install a plugin I get a successful message:               Downloading install package from http://downloads.wordpress.org/plugin/jquery-lightbox-gallery.zip…          Unpacking the package…          Installing the plugin…          Successfully installed the plugin Fancy Gallery 1.0.27.          Activate Plugin | Return to Plugin Installer`      If however I have a look via ftp in my plugins directory the plugin has not been installed and the new plugin folder does not exist. Then when I click the `Activate Plugin` link I get the following error `The plugin does not have a valid header.` which is not surprising considering the plugin hasn't been installed. This happens no matter which plugin I try to install. It's strange because I have several other wordpress installations on the same host, and infact two other separate wordpress installations on the same domain and I have never had this problem. I tried re-uploading a fresh installation of wordpress over the top of the current one and there was no change. I tried deactivating every single plugin and switching to the basic theme but it still didn't work. Any help would be greatly appreciated! Update: So I tried making a new FTP account, and I can now add plugins using this new account. However when I try to upgrade a plugin I still get a `Could not remove the old plugin. Plugin update failed.` error.


WP_User_Query pulling ACF to loop

I'm using following code to display my users on template               <?php     $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;     $paged -= 1;     $limit = 100;     $offset = $paged * $limit;          $args  = array(         'number' => $limit,         'offset' => $offset,         'role'         => 'editor',     );          global $wp_query;     $wp_query = new WP_User_Query($args);          // Get the results     $authors = $wp_query->get_results();                foreach($authors as $author) :                echo $author->description;             endforeach;          ?>      Which works perfectly fine, however I would like to also display custom fields which I have created by using plugin Advanced Custom Fields. I have managed to do that on author.php page with this code:               $author_id2 = get_the_author_meta( 'ID' );     $author_badge = get_field('profile_picture', 'user_'. $author_id2 ); // image field, return type = "Image Object"          <img src="<?php echo $author_badge; ?>" alt="<?php echo $author_badge['alt']; ?>" class="alignright" />       But I'm not sure how to display the same field in my WP_User_Query. Any tips will be much appreciated


How should I approach changing the template & $query as part of a shortcode's execution?

I am working on a project where I need to be able to change the template being used if a given shortcode is used. To complicate things more, the plugin must also be able to rewrite `$query` if this same shortcode is called. I believe that I am running into issues in when various parts of the core exec vs. when shortcodes run, but I can't find the right information in the Codex to verify or debug the issue. Currently, my implementation neither modifies `$query` nor does it redirect the template. Basically, the shortcode works (or, in this case, does not work) as follows:   1. Shortcode is called   2. Based on what info is in shortcode, args are generated to retrive some posts   3. These args are assigned to a global variable, let's call it `$custom`, within the shortcode function   4. Also within the shortcode, I hook `template_redirect` with `get_home_template()` as the argument   5. Also in shortcode function, `pre_get_posts` is hooked with a function that assigns `$query` to `new new WP_Query( $custom )` Like I said, I'm quite sure it's an order of exec issue, but I'm not sure where to look in order to figure out what needs to be modified. Any suggestions would be greatly appreciated!


If post exists, make it a comment in existing post with same name?

Is it possible to make a comment out of a post that already exists (with the same name). For example, if the post 'Hello World' exists and a users posts another 'Hello World' post, it should make the second post a comment beneath the first post... How can I do this?


iis6 multisite and permissions

For testing mobile themes and other reasons, I am trying to use an existing server with wordpress setup as multisite. The root site is not in inetpub/wwwroot but rather on another partition and that seems to work. I want to the site to be conventionally http://somesite.com and http://somesite.com/mobile I can see that the tables are created in the db when I add the other site, but not corresponding directories of /wpadmin, /wp-content, or /wp-includes get created anywhere. I guess I am not sure where they should get created, and what permissions I would need on that directory. I have tried using IIRF to get around the .htaccess rewrite issue, (I think) but since the correct sub-directories never get created, there is nothing to redirect to. What have I done wrong? Is it not possible to have the base site in /? but not in /inetpub/wwwroot/? I hope this is clear


Plugin admin panel JavaScript Broken

I'm trying to implement this plugin on my live wordpress instilation: http://wordpress.org/extend/plugins/frontpage-slideshow/ I wouldn't usually ask a question about a plugin directly but this problem is a little strange, I have a local MAMP installation of wordpress running the plugin, everything db and file wise is identical to the live version, taken from my git repository and a up to date dump of the db. What's very strange here is that the plugin works with no problems on my MAMP instillation, i can access the admin section no problem. But on my live wordpress instillation, all javascript is broken on the plugins admin page, even the wordpress admin js that controls the menu drop downs. I'm not sure what is happening as i have 0 js errors in my console and can see exactly the same files are being loaded as on my local instillation. The only variable here are the servers, but i'm not sure what could be causing this, does anyone have any ideas? Edit: I've isolated the problem down to this line:               $attachments = get_children(array(                                         'post_type'     => 'attachment',                                         'post_mime_type'    => 'image',                                         'post_status'       => null,                                         'post_parent'       => null,                                     ));      if i remove it everything works fine..


WP Ecommerce: Display the “Order Notes” as column in the Sales Log

I have the following function that adds a column in the Sales Log so that I may show the Order Notes. Adding the column is good and showing the id of each item ($item->id) as test is good. Where I am getting stuck is how to display the actual order notes for each item. Tried numerous things including ($purchlog_notes->notes); This adds the column (all good)               function addPurchaseLogColumnHead( $columns ){     $columns['OrderNotes']=__('Order Notes');         return $columns;      }          add_filter( 'manage_dashboard_page_wpsc-purchase-logs_columns', 'addPurchaseLogColumnHead');      This is where I want to show Order Notes content for each sale (issue)               function addPurchaseLogColumnContent( $default, $column_name, $item ) {     if ($column_name == 'OrderNotes'){             echo $item->notes;         }     }          add_filter( 'wpsc_manage_purchase_logs_custom_column' , 'addPurchaseLogColumnContent', 10, 3);      So what I need is this bit **echo $item->notes;** Appreciate any ideas. Thank you.


Filter an array with a callback - for single & multidimensional arrays

I've a filter attached, that allows modifying an array:               $data = apply_filters( 'wpse_example_filter', $data );      The problem is, that the data can be a single or multidimensional array:               // single:     'SINGLE' => array(         // some data     )     // multidimensional:     'MULTI' => array(          0 => array(              // some data          )          1 => array(              // some data          )     )      **Question:** What's the easiest way to loop through the data of one of those arrays (inside my callback), without knowing if I got a single or multidimensional array and without creating another callback function? **In other words:** How would I write a recursive filter callback?


How to check user role without using current_user_can()

I am filtering the map_meta_cap() function, which is called from $user->has_cap (which is called from current_user_can()). I only want my filter to execute if the current user is an administrator, so I need a conditional in my filter that checks their role. I can't use current_user_can(), because that invokes my filter, causing an infinite loop. Is there a reliable way to check whether someone is an administrator without using current_user_can() ?


why is there an author.php

Why is there an author.php file when the same information is in the single.php? I looked at the template hierarchy and one would think that if author.php wasn't present, the single.php would come into play but it doesn't. I would also think that if you styled the author.php then that would affect the author bio on the pages, but it doesn't. So I was thinking about just removing the author bio all together. Maybe make it a function and call it in my page. What do you think?


Woocommerce: Grab total revenue of a product over all orders

I need to display the total revenue of all orders for my products depending on if the logged-in user is the author of the product or not. I can't use the Quantity field as a multiplier either because of the Gravity Forms add-on for Woocommerce processes it in to a meta_key/value field, same goes for the product ID reference to the order. I'm using a `$wpdb` query to grab my order data, but I just can't seem to write it correctly or know how to get it, my SQL skills are not exactly tip-top. So far I've come up with this:               SELECT * FROM wp_woocommerce_order_itemmeta AS order_meta     LEFT JOIN wp_woocommerce_order_items AS order_items         ON order_meta.order_item_id = order_items.order_item_id     LEFT JOIN wp_term_relationships AS term_rels         ON term_rels.object_id = order_items.order_id     WHERE term_taxonomy_id = 24 # 24 being the completed order status ID      This gives me the following: ![MySQL Workbench output for my query](http://i.stack.imgur.com/KQKdJ.png) As you can see the meta values for the Product ID and the Qty: 16/30 etc. are in the same column, I almost need them to be in the same row if possible. After I get the query right, I can then multiply the Qty (gotten with regex) by a custom field value, and the display this on the web site. Anyone able to point me in the right direction? :)


WP upgrade can't create directory even though perms are 777

I'm trying to upgrade to WP 3 but I'm getting a weird error when I try to do so:               Downloading update from http://wordpress.org/wordpress-3.0.4.zip.          Unpacking the update.          Could not create directory: /my/path/web/wp-content/upgrade/wordpress-3.tmp          Installation Failed      The reason it's weird is because the `upgrade` directory has 777 permissions. I ran `chmod -R 777 upgrade/` and when I do an `ls`, I see that `upgrade` is world-writable. I'm sure I'm dealing with the right directory because if I delete `upgrade`, I get a different error. Any idea why this happening?


How to mass-insert categories?

I want to insert hundreds of categories, structured hierarchically. Any suggestions on how I could do it in a batch mode? Thanks.


Modify admin panel tab position

I was just wondering if it's possible at all to move the position of a tab inside the admin panel. Here's what I mean: http://i.stack.imgur.com/XDz8X.png As you can see I have plenty of custom post types, and each one except for the Slider type has position = 5 ( above media ). Unfortunately some of them are sliding below, and I am looking for a way to have media after all of them again. Not a big deal, just wondering if it's possible. Looked around but couldn't find anything. Thanks.


Add_Filter example for wp_get_attachment_link

Let me preface by saying I don't really understand Add_Filter, but I think that I want to be using it here. If not please let me know. I want to modify wp_get_attachment_link so that the link url changes. So for example if I click on a thumbnail in a gallery instead of going directly to the file I want it to go to www.foo.com. So what I would like to do is replace what wp_get_attachment_link does via add_filter. But I can't figure out how add_filter works. How do I get the parameters from the original function? Original Function Call               wp_get_attachment_link($id, $size, $permalink, $icon, $text);      Filter               add_filter( 'wp_get_attachment_link', 'modify_attachment_link');          function modify_attachment_link() {         //how do i access $id, $size, $permalink, $icon and $text???         $foo = $id.$permalink;         return $foo;     }


Does $wpdb->prepare not create a prepared statement that I can execute multiple times?

I am wondering from the syntax               $sql = $wpdb->prepare( 'query' [, value_parameter, value_parameter ... ] )      It appears (from the syntax - values within prepare) that it simple escapes values not craete a prepared statement giving me performance benefits when I execute it multiple times will different params? On 2nd look, since values are optional, I can set them after preparing? How do I do that?


Load entire NextGEN gallery from single thumbnail?

I'm using Alex Rabe's NextGEN Gallery in a lot of client sites as a centralized image repository, and am finding I often need to load an entire gallery into a lightbox (invoked via a single thumbnail), without displaying more than a single thumbnail on page. Thus, I could have a series of four thumbnails on a page, each thumbnail opening a different set of pictures in a lightbox when clicked. **Any idea how I could do this? Thanks.**


Create and update Custom Cookie based on multiple GET and POST Values for first time visitors?

I am not exactly sure the most efficient way to write this code. I collect custom data in my forms and also in my url via get such as:   * Name   * utm_campaign   * URL Referrer   * ID Among many more. Do I really have to create a setcookie per value or can I run some type of loop to make sure it checks if certain variables exist like above and adds it to a cookie? I understand it might create an issue if I just run the loop for any GET, POST Values but is there a way for me to list values to look for and ignore any values not in that list? Here is the code I have so far but I am stumped because I need to gather multiple pieces of information, but I think I am going about it the most inefficient way. I plan on tracking the cookie site wide. I have this in my functions.php file, within a plugin.               add_action( 'init', 'setnew_usr_cookie');     function setnew_usr_cookie() {         if (!isset($_COOKIE['returning_usr'])) {             $first_name = $_POST['first_name'];             $expire=time()+60*60*24*360;             $path='/';             $domain=parse_url(get_option('siteurl'), PHP_URL_HOST);             setcookie(                 'first_name',                  $first_name,                  $expire,                  $path,                  $domain           );         }     }      I didn't know that cookies only hold one piece of information at first which is throwing me off, and I want the cookie to not expire for a year although I know the user might clear it at any time. Want to set a cookie based only if it is the users first time visiting and the user currently doesn't have a cookie.


Change id="respond" to the comments container

On the same page, I have 3 comment threads. Each comment has a meta that tells in which tread they have to be displayed in. At the end of each thread, I have a form to post a comment in this specific thread and it adds the right meta. The problem is when I click the “Reply” link, it adds a form under the comment, but not the good form. It adds the first form that appears in the page, event if I reply a comment from the third thread. So the meta that is added with my new comment is not the good one… To generate my 3 comment threads , I use the comment_form() function. This function generated a div with a lot of hmtl inside. This div has an id="respond". I need to change this id for each comment thread to be different. Right now, all 3 comment threads have the same "respond" id. Than, thanks to the comment reply link() function, i'll be able to control which respond_id is taken by comment-reply.js... So all I need is to change this "respond" id for each comment thread that is generated by the comment_form() function ! But how :( ??? Thanks !


adding a #hash to each link in list_pages()?

hey guys, is it somehow possible to do the following: `wp_list_pages()` lists each link inside a `<li> <a href="link"...`               <?php wp_list_pages('title_li=&depth=0&exclude='); ?>      Is it possible to add a #hash to those links? Like `<a href="link#something"`? thank you for your help


Listing all sidebars

How to list all existing sidebars? I want to show them all in the drop down list (so each item should have also the right value).


Using 'posts_where' on a query with a custom field

I have a page which displays tour dates for an artist. I use a custom field (TheDate) to give each entry a numerical value so that they will show up in the proper order (regardless of when they were actually posted). The custom field uses these values: 20110315 (this would be used for a date on March 15, 2011. I want the page to only return dates for today and onward and not to return any dates which have passed. I think I have the basics down, but I'm clearly not doing something right. Here's what I have, but it doesn't return anything. If I take out the filter it works (but returns all dates, even past ones) so I must be doing something wrong with the filter. Any help, advice or direction would be greatly appreciated. Thanks very much.               $todaysdate = date('Ymd');          function filter_where( $where = '' ) {          $where .= " AND ( ($wpdb->postmeta.meta_key = 'TheDate' AND $wpdb->postmeta.meta_value >= $todaysdate) ) ";          return $where;     }          add_filter( 'posts_where', 'filter_where' );          $args = array(     'cat' => '4',     'posts_per_page' => -1,     'orderby'  => 'meta_value_num',     'meta_key' => 'TheDate',     'order' => 'ASC'     );          $the_query = new WP_Query( $args );


Add jQuery UI datepicker to admin panel

I created a custom post type with a couple of fields where the user can enter the start date and the end date for a project. I am trying to implement the jQuery datepicker but nothing happens when I click on the input fields using 1.7.3; if I use 1.8 it throws an error `$(input).zIndex is not a function` Update: Here is the function                 function webfolio_show_timespan_box(){       ?>                     <link type="text/css" rel="stylesheet" href="<?php bloginfo('stylesheet_directory')?>/css/smoothness/jquery.custom.css" />                <?php         global $timespan_box, $post, $prefix;              echo '<input type="hidden" name="webfolio_meta_box_nonce" value="',    wp_create_nonce(basename(__FILE__)), '" />';               echo '
';               foreach ($timespan_box['fields'] as $field) {             // get current post meta data             $meta = get_post_meta($post->ID, $field['id'], true);                  echo '
',                 '', $field['name'], '	',                 '';             echo '<input class="datepicker" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta ? $meta : $field['std'], '" size="30" style="width:20%" />', '
', $field['desc'];             echo '
';            }              echo '
';     }      Thank you for your help


getting video dimensions

when attaching videos (eg. .flv) to a post - is it possible to query its dimensions? the problem is - i've got videos in 4:3 and 16:9 format and i need to get this information. any ideas? thanks


Multiple WP Sites Same Server - Share WP Base?

I have seen similar questions but none with a definitive answer. I host dozens of WP sites on a cloud server (all latest version) however this causes a lot of unnecessary backup activity. I am not a fan of multisite. Really I am just looking to simplify by keeping a core set of files in a central location that can be read by all domains. The preference would be to extend this by allowing versions. > Core > 3.2.1 > > Core > 3.2.2 then point a domain to the prefered version of central files. This would allow me to backup only uploads, theme and database files. Wondering if there is some documentation out there on this subject without having to do any heavy modifications?


Getting Thumbnail in fetch_feed from custom field

i have setuped showing rss from my network site using fetch_feed();               include_once(ABSPATH . WPINC . '/feed.php');     $rss = fetch_feed('rss link here');     $maxitems = $rss->get_item_quantity(5);     $rss_items = $rss->get_items(0, $maxitems);     THen i can use foreach to get these      $item->get_description();      $item->get_permalink();     $item->get_title();     get_date('j F Y | g:i a');       But i am not sure how to get thumbnail in my feed or here in this system. But in my posts i do have a custom field called post-img for displaying posts. Help is appreciated. Thanks


Any way to inherit methods from both my plugin class and WP_List_Class?

So WP 3.1 introduces the fancy WP_List_Class() causing me to rewrite all my custom admin tables. Fair enough. But...in the good'ol days, i was able to call my plugin methods using `$this->method()` as i included the page file within the method that got hooked to via `add_submenu_page()`. That was nice and somewhat elegant - or at least nice - i thought. Now, though, my code has to live within the methods of My_WP_List_Class, which inherits from WP_List_Class. Since i can't do multiple inheritance, i seem to have to reference my global plugin instance or reinstanciate it within my class, either one of which makes me a little upset. Class stacking doesn't seem to be an option either, because obviously i can't make WP_List_Class inherit from my plugin class, nor do i want to make my plugin class inherit from WP_List_Class. Am i overlooking something or do i just have to live with it? Edit: more context: I might be thinking too complicated, but my scenario is this: I'm having a 'meta' plugin class that is instanciated by other plugins (several times). So i don't even know what it's instanciated as and frankly, i don't want to know. ;-) Each of these instances hooks itself into the admin menu and creates a custom menu page. Each of these instances also get's some parameters passed (like an id-like one for instance) that it stores internally upon instanciation. If i call a method, the method depends on these internally stored values. So far, each of these instances could all live self-contained, i didn't need to register them in any array or anything, you could even instanciate them anonymously, if you wanted. Now i need to add methods to my WP_List_Class inheriting class that will depend on those values as well. So the only thing i can imagine is to do something like this:               function table_me_some() {         $table = new My_WP_List_Class(&$this);         ...     }      and then within `My_WP_List_Class` do something like this:               function __construct($mama) {         $this->_mama = $mama;     }          function whatever() {         $this->_mama->my_plugin_class_instance_method();     }      Then `my_plugin_class_instance_method()` lives in my instanciated plugin class and references it's own internal variable store. However, i only came up with this now, but i still don't find it very neat.


WordPress v3.1 Has Character Encoding Issue With Title/Permalink?

I was on the latest v3.0.x series and had no issues. Once I upgraded to WP v3.1, I am having a strange issue with character encoding in permalinks. If my title was "I have $50 today" in WP 3.0.x, the month/date permalink would be               example.com/2010/05/i-have-50-today/      However, here's what is happening in WP 3.1               example.com/2010/05/i-have-%e2%80%93-50-today/      I tried replicating the problem on a clean install of WordPress and was able to replicate the same issue. Can anyone confirm whether this is a bug or expected?


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 know that wordpress stores URLs in the DB so i want to modify (hard code) my production site not to redirect anywhere. Where and how? Edit: I found the solution to this particular problem here http://www.davidpaulellenwood.com/expression/267/ But when one problem was tackled two new ones appeared and as discussed below, it's not worth it.


Sorting posts ordered by custom field value

I have a series of posts (using a wp-zoom theme). I would like to create a custom field called `order` and sort by that field. Here is part of my homepage code:               <?php      $z = count($wpzoom_exclude_cats_home);     if ($z > 0) {          $x = 0;          $que = "";          while ($x < $z) {             $que .= "-".$wpzoom_exclude_cats_home[$x];              $x++;             if ($x < $z) {                 $que .= ",";             }          }      }           query_posts( $query_string . "&cat=$que" );     if (have_posts()) :      ?>


Using color schemes with Color Picker

# What I'm doing User interface to change website colors - User can change colors individually (like menu color, footer color, content color), or use color scheme that will change all colors (values pre-defined by me) # The Problem $color_menu, $color_footer and $color_content already work individually I need to set the color_scheme now, I tried this, but didn't work:               <?php $color_menu = get_option('color_menu');  ?>     <?php $color_footer = get_option('color_footer ');  ?>     <?php $color_content = get_option('color_content ');  ?>              <?php         if ( get_option( $color_scheme ) == 'blue' ) {             update_option( $color_menu, '#0D5E84' );             update_option( $color_footer, '#1461A2' );             update_option( $color_content, '#132C3F' );         } elseif ( get_option( $color_scheme ) == 'yellow' ) {             update_option( $color_menu, '#CCCC00' );             update_option( $color_footer, '#FFFF33' );             update_option( $color_content, '#FFFFCC' );         } elseif ( get_option( $color_scheme ) == 'red' ) {             update_option( $color_menu, '#CC0000' );             update_option( $color_footer, '#FF0000' );             update_option( $color_content, '#CC0033' );         } else {             update_option( $color_menu, '#252525' );             update_option( $color_footer, '#252525' );             update_option( $color_content, '#FFFFFF' );         }         ?>      Image: http://i.stack.imgur.com/Ktm7h.png ## Extra problem Be able to change individual colors while using Color Scheme. Let's suppose I chose a Yellow color scheme, but would like to set the menu color darker, I should be able to change it while using Yellow color scheme, if possible ### Another Point of View A friend that works with me thought of a different solution for this same problem, and he posted it on Stack Overflow, maybe you would like to see his question. Easier to do? Better? Worse? What path shoud we go?


List Category Posts plugin upgrade fails with fatal error

I just tried an automatic upgrade of List Category Posts plugin to version 0.17.2 on WordPress 3.0.5. I think I had 0.17.1 before. It installed but failed to activate:               Plugin could not be activated because it triggered a fatal error.     Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /hsphere/local/home/carrollp/clanecommunity.ie/wp-content/plugins/list-category-posts/include/CatListDisplayer.php on line 10      If I understand correctly author has requested issues be posted here. I've never debugged WordPress before. Appreciate any help. My site home page is relying on this plugin. Thanks!


Display one result for category post type

I'm using taxonomy categories to show my custom post type, but when I click on it, no page is linked. How do I create a page to display the results from categories? I tryed like custom post type:               category-portfolio.php      but not worked.


Custom post types loop on a page template

Hi I'm trying to make a page template that shows a list of a custom post type ordered by a meta key, I easily made it with `query_posts` but I am trying to do it via `pre_get_posts` so I made a function like this:               add_action('pre_get_posts', 'events');     function events($query) {       if ( is_page_template('page-myevents.php') ){         $query->set('post_type', 'events');         $query->set( 'meta_key', 'start' );         $query->set( 'orderby', 'meta_value_num' );                 $query->set( 'order', 'DESC' );         $query->set('numberposts', 5);        }     }      But it does not work when i enter the page it sends me to the 404 page, I even added `$query->get_posts()` but nothing I get errors with that, any suggestions?


Meta_query weird behaviour

I have a custom field called `date_from`. Dates are stored in the `yymmdd` format (eg 20131104). When I use a `meta_query` to find posts in a specific date range the query works as expected, but when I use a meta_query to find posts which have a date_from which is greater than the specified value it doesn't. That means; it doesn't return posts while I know for sure that it should. I can't figure out what I'm doing wrong... This is working:               $month = date('m');     $start_date = date( 'Y' . $month . '01' );     $end_date = date( 'Y' . $month . 't' );          $meta_query = array(         'key'       => 'date_from',         'value'     => array($start_date, $end_date),         'compare'   => 'BETWEEN',         'type'      => 'DATE'     );          args = array(         'post_type'         => 'events',         'post_status'       => 'publish',         'posts_per_page'    => 20,         'paged'         => $paged,         'meta_query'        => array($meta_query),         'meta_key'      => 'date_from',         'orderby'           => 'meta_value',         'order'         => 'ASC',     );     $query = new WP_Query($args);      And this is not:               $today = date("Ymd");          $meta_query = array(         'key'       => 'date_from',         'value'     => $today,         'compare'   => '>=',         'type'      => 'DATE' // I've also tried type => 'NUMERIC'     );          args = array(         'post_type'         => 'events',         'post_status'       => 'publish',         'posts_per_page'    => 20,         'paged'         => $paged,         'meta_query'        => array($meta_query),         'meta_key'      => 'date_from',         'orderby'           => 'meta_value',         'order'         => 'ASC',     );     $query = new WP_Query($args);      And it does work when I use:               $args = array(         'post_type'         => 'events',         'post_status'       => 'publish',         'posts_per_page'    => 20,         'paged'             => $paged,         'meta_key'          => 'date_from',         'meta_value'        => $today,         'meta_compare'      => '>',         'orderby'           => 'meta_value',         'order'             => 'ASC'     );      Why is that? I can't use `$meta_query = array(...)` to find posts which have a date greater than a specified value? Seems really odd because when I use exactly the same values directly in `$args` it does work.


Restrict access to specific widget field based on user role

I'm looking for a way to restrict the ability to drag certain widgets to specific widget areas in the widget editor. For example, I would like to restrict the widget field 'ads' to only be available to administrators. I would be quite happy if I could do this by disabling the ability to drag-n-drop in these fields. Anyone got any ideas?


Custom fields in Permalinks?

I'm wondering how to add a custom field value to a custom post type's permalink? For example, I have the custom post file ex: cpt-cities.php, which handles registering the custom post type and all of those specifics. Within that file, I'm trying to set it's permalinks to include one of the 'cities' custom field values. I'm able to set the permalinks using add_permastruct. However I'm not able to get the value of the custom field, and get_post_meta() does not work. This may be due to $post->ID not working (since it's within the custom post type file, and not a post loop). Anyone know of a way to get the custom field value within a file like this? Is there somewhere else I can declare the add_permastruct, that will allow me to pull in the custom field value? Any help is greatly appreciated, this is one of the last parts of a pretty extensive project.


Getting rid of /my_custom_post_type/ in the single view URL

When I'm reading a custom type post in the single view, I see that the URL is www.my_site.com/my_custom_post_type/title_of_my_post. How to get rid of this ugly /my_custom_post_type/ ?


wordpress the_post_thumbnail() not cropping properly

I am using the wordpress function the_post_thumbnail(); but it seems to behave differently in different places. I have the following code on one page:               the_post_thumbnail(array('275', '190'));      Does exactly what it's supposed to, i get a thumbnail exactly 275 x 190 that has been cropped to fit. I then paste this code to a different template and this time the image has been resized to the maximum dimension, either 275 wide if its landscape or 190 if its portrait. Anyone know whats going on?


How to relate multiple CPTs via Custom Taxomonies?

I have 3 custom post types - Events, Sessions and Speakers. Events have multiple Sessions. Sessions have multiple speakers. Speakers can be at multiple everything. They all have their own associated meta. 1 hierarchical taxonomy so far, Event Series, that relates Events and Sessions. I can't figure out how to relate Speakers and Sessions, while being able to ensure the ability to query for all 3 - sessions at event, speakers at session, speakers at event... Seems there must be a relatively simple way to do this taxonomically. Tying the multiple CPTs together has me stumped. This isn't the movies, actors, directors, genres example that's so prevalent. Am I making this harder than it should be?


Custom fields on a virtual page

I've used Dave Jesch's solution for making virtual pages (from content temporarily saved in a custom database table, updated from an RSS every four hours). See more here: http://davejesch.com/wordpress/wordpress-tech/creating- virtual-pages-in-wordpress/ So far I've verified that the url looks like one of a virtual page (i.e. it's the child of a certain slug and it contains numbers as the first part of the slug, this is specific to my website, of course). I've fetched all the content needed to create a page, from my custom DB table. And I've managed to use a custom template. What I have yet to solve and need help with, is a solution for adding (faking) custom fields to the page without adding them to the database. There are some values from the custom table that I'd like to use outside of `the_content()` but within the loop, as you would custom fields. All the suggestions I've seen for this saves the data as custom fields to the database, to the page id -1, but since the website has quite a lot of visitors and all virtual pages will get the id -1 that can only end badly, plus I don't want to save a bunch of junk in the DB as the content of my custom database will change quite often (they are job ads, so there will be hundreds of them and they will rarely stay in the system for more than a couple of weeks, tops). So, is there a way to send fake custom fields along with the fake page or is there a better way to do this? ETA: The below code is most of what makes up the function. A few function names are changed to make it less client specific, but on the whole that's most of it. The `get_ip_post()` function is omitted as it only fetches content from the custom table and returns them as an array.               /********************************************/     /*                                          */     /* Virtual page, class and functions.       */     /*                                          */     /********************************************/          // Based on: http://davejesch.com/wordpress/wordpress-tech/creating-virtual-pages-in-wordpress/          if (!class_exists('DJVirtualPage'))     {         class DJVirtualPage         {             private $slug = NULL;             private $title = NULL;             private $content = NULL;             private $author = NULL;             private $date = NULL;             private $type = NULL;                  public function __construct($args)             {                 if (!isset($args['slug']))                     throw new Exception('No slug given for virtual page');                 $this->slug = $args['slug'];                 $this->title = isset($args['title']) ? $args['title'] : '';                 $this->content = isset($args['content']) ? $args['content'] : '';                 $this->author = isset($args['author']) ? $args['author'] : 1;                 $this->date = isset($args['date']) ? $args['date'] : current_time('mysql');                 $this->dategmt = isset($args['date']) ? $args['date'] : current_time('mysql', 1);                     echo $args['post_parent_ID'];                 $this->type = isset($args['type']) ? $args['type'] : 'page';                     echo $this->post_parent_ID;                      add_filter('the_posts', array(&$this, 'virtualPage'));             }                  // filter to create virtual page content             public function virtualPage($posts)             {                 global $wp, $wp_query;                      if (count($posts) == 0 &&                     (strcasecmp($wp->request, $this->slug) == 0 || $wp->query_vars['page_id'] == $this->slug))                 {                     //create a fake post intance                     $post = new stdClass;                     // fill properties of $post with everything a page in the database would have                     $post->ID = -1;                          // use an illegal value for page ID                     $post->post_author = $this->author;       // post author id                     $post->post_date = $this->date;           // date of post                     $post->post_date_gmt = $this->dategmt;                     $post->post_content = $this->content;                     $post->post_title = $this->title;                     $post->post_excerpt = '';                     $post->post_status = 'publish';                     $post->comment_status = 'closed';        // mark as closed for comments, since page doesn't exist                     $post->ping_status = 'closed';           // mark as closed for pings, since page doesn't exist                     $post->post_password = '';               // no password                     $post->post_name = $this->slug;                     $post->to_ping = '';                     $post->pinged = '';                     $post->modified = $post->post_date;                     $post->modified_gmt = $post->post_date_gmt;                     $post->post_content_filtered = '';                     $post->post_parent = 0;                     $post->guid = get_home_url('/' . $this->slug);                     $post->menu_order = 0;                     $post->post_type = $this->type;                     $post->post_mime_type = '';                     $post->comment_count = 0;                          // set filter results                     $posts = array($post);                          // reset wp_query properties to simulate a found page                     $wp_query->is_page = TRUE;                     $wp_query->is_singular = TRUE;                     $wp_query->is_home = FALSE;                     $wp_query->is_archive = FALSE;                     $wp_query->is_category = FALSE;                     unset($wp_query->query['error']);                     $wp_query->query_vars['error'] = '';                     $wp_query->is_404 = FALSE;                 } else {                  }                      return ($posts);             }         }     }          function isJobAd($url){             global $virtual_post_id;             if( strpos( $url, 'lediga-uppdrag/' ) > 0 || strpos( $url, 'ledige-oppdrag/' ) > 0 ){   // Check that we're in the right place, Swedish & Norwegian urls respectively                 $url_parts = explode( '/', $url );                 $slug = end($url_parts);                 $post_id = current(explode("-", $slug));                 if(is_numeric($post_id)){                     $virtual_post_id = $post_id;                     return true;                 } else {                     return false;                 }             } else {                 return false;             }              return true;     }          function dj_create_virtual() {         global $current_blog;         global $ip_slug;              if( !is_admin() ) {             $url = trim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), '/');                  $url_parts = explode( '/', $url );             $slug = end($url_parts);             $post_id = current(explode("-", $slug));                  if (isJobAd($url))             {                      $arr_post = get_ip_post( $post_id );                 if( is_array( $arr_post ) ) {                     $args = array('slug' => $ip_slug . '/' . $slug,                             'title' => $arr_post['title'],                             'content' => $arr_post['description'],                             'type' => 'page',                             'date' => $arr_post['pubdate']);                          $pg = new DJVirtualPage($args);                 } else {                     echo 'No post found.';                 }             }         }     }     add_action('init', 'dj_create_virtual');               // Using page-ip-post.php as template     add_filter( 'single_template', 'portfolio_page_template', 99 );     function portfolio_page_template( $template ) {              if ( is_page( -1 )  ) {             $new_template = locate_template( array( 'page-ip-post.php' ) );             if ( '' != $new_template ) {                 return $new_template ;             }         }              return $template;     }


WordPress function gives different results outside vs inside PHPUnit test

I've been working very hard to get PHPUnit to play nice with WordPress (with the help of this, this, this, this, and this), and I think I've gotten pretty close. The code I run directly before my tests looks like this (basically lifted verbatim from this article):               ( PHP_SAPI === 'cli' ) || die( 'Access Denied' );          define( 'PHPUNIT_DB_PREFIX', 'phpunit_' );          global $wp_rewrite, $wpdb;          define( 'WP_MEMORY_LIMIT', '100M' );          require_once( dirname( __FILE__ ) . '/../../../../wp-load.php' );     require_once( ABSPATH . 'wp-admin/includes/admin.php' );          wp_set_current_user( 1 );      Seems to work fine, except that functions return different things based on where they are in the file. For instance, outside of a test class, `shortcode_exists` returns true, whereas within a test case the exact same `shortcode_exists` statement returns false. What am I doing wrong? Here are the contents of the entire test file: [The file has changed since I originally posted this...] EDIT: Ok, so I've followed J.D.'s tutorial as closely as I could. It feels _really_ close. I'm now getting this error:               PHPUnit_Framework_Error_Warning : copy(data/not-gettexted-0.php): failed to open stream: No such file or directory     #0 [internal function]: PHPUnit_Util_ErrorHandler::handleError(2, 'copy(data/not-g...', '/Applications/w...', 41, Array)     #1 /Applications/wordpress-3.8.3-0/apps/wordpress/htdocs/wp-content/plugins/hf-accountability/tests/wordpress-dev/trunk/tools/i18n/t/NotGettextedTest.php(41): copy('data/not-gettex...', 'data/not-gettex...')     #2 [internal function]: NotGettextedTest->test_replace()     #3 phar:///Applications/wordpress-3.8.3-0/apps/wordpress/htdocs/wp-content/plugins/hf-accountability/tests/phpunit-lts.phar/phpunit/Framework/TestCase.php(988): ReflectionMethod->invokeArgs(Object(NotGettextedTest), Array)     #4 phar:///Applications/wordpress-3.8.3-0/apps/wordpress/htdocs/wp-content/plugins/hf-accountability/tests/phpunit-lts.phar/phpunit/Framework/TestCase.php(838): PHPUnit_Framework_TestCase->runTest()     #5 phar:///Applications/wordpress-3.8.3-0/apps/wordpress/htdocs/wp-content/plugins/hf-accountability/tests/phpunit-lts.phar/phpunit/Framework/TestResult.php(648): PHPUnit_Framework_TestCase->runBare()     #6 phar:///Applications/wordpress-3.8.3-0/apps/wordpress/htdocs/wp-content/plugins/hf-accountability/tests/phpunit-lts.phar/phpunit/Framework/TestCase.php(783): PHPUnit_Framework_TestResult->run(Object(NotGettextedTest))     #7 phar:///Applications/wordpress-3.8.3-0/apps/wordpress/htdocs/wp-content/plugins/hf-accountability/tests/phpunit-lts.phar/phpunit/Framework/TestSuite.php(779): PHPUnit_Framework_TestCase->run(Object(PHPUnit_Framework_TestResult))     #8 phar:///Applications/wordpress-3.8.3-0/apps/wordpress/htdocs/wp-content/plugins/hf-accountability/tests/phpunit-lts.phar/phpunit/Framework/TestSuite.php(749): PHPUnit_Framework_TestSuite->runTest(Object(NotGettextedTest), Object(PHPUnit_Framework_TestResult))     #9 phar:///Applications/wordpress-3.8.3-0/apps/wordpress/htdocs/wp-content/plugins/hf-accountability/tests/phpunit-lts.phar/phpunit/Framework/TestSuite.php(709): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult), false, Array, Array, false)     #10 phar:///Applications/wordpress-3.8.3-0/apps/wordpress/htdocs/wp-content/plugins/hf-accountability/tests/phpunit-lts.phar/phpunit/TextUI/TestRunner.php(350): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult), false, Array, Array, false)     #11 phar:///Applications/wordpress-3.8.3-0/apps/wordpress/htdocs/wp-content/plugins/hf-accountability/tests/phpunit-lts.phar/phpunit/TextUI/Command.php(176): PHPUnit_TextUI_TestRunner->doRun(Object(PHPUnit_Framework_TestSuite), Array)     #12 /private/var/folders/r5/0w5bp7b13pndfymz_pgf_zz00000gn/T/ide-phpunit.php(268): PHPUnit_TextUI_Command->run(Array, true)     #13 /private/var/folders/r5/0w5bp7b13pndfymz_pgf_zz00000gn/T/ide-phpunit.php(506): IDE_Base_PHPUnit_TextUI_Command::main()     #14 {main}      Any idea how I can fix that? In the mean time, I'm going to keep checking all the file paths I defined in the several config files. EDIT EDIT: That last error was resolved by modifying the PhpStorm configuration I was using. You have to both set it to "Use alternative configuration file" and set the test scope to "Defined in the configuration file."


Uses Cases for the Calendar Widget

So I've looked at several themes and visited several theme dev sites and i'm confused about the "purpose" of the WordPress Calendar Widget. So it states it is... > A calendar of your site’s Posts But really? Is that all it is used for? Surely there are more creative uses for this widget. Is anyone using it in any creative way? **Edit** The Question is - how you would modify the calendar widget to extend its functionality for custom purposes.


Help with output of post classes using apply_filters

I’m new to scripting, this is a plugin I'd like to modify to output post classes. When I try using: `apply_filters( 'post_class', $page->post_class )` it only outputs `array=" "`. Do I need an additional function to hook into post classes? In my research I can't tell if my syntax is wrong or I'm missing a function to "pull" in the classes for `apply_filters` to grab onto. Thanks a ton for any help.                   var $db_fields = array ('parent' => 'post_parent', 'id' => 'ID');                   function start_lvl(&$output, $depth = 0, $args = array()) {             $indent = str_repeat("\t", $depth);             $output .= "\n$indent
\n";         }                   function end_lvl(&$output, $depth = 0, $args = array()) {             $indent = str_repeat("\t", $depth);             $output .= "$indent
\n";         }                   function start_el(&$output, $page, $depth = 0, $args = array(), $id = 0) {             if ( $depth )                 $indent = str_repeat("\t", $depth);             else                 $indent = '';                  extract($args, EXTR_SKIP);                  $output .= $indent . '
ID.'" '.apply_filters( 'post_class', $page->post_class ).'>'.apply_filters( 'the_title', $page->post_title, $page->ID ).'';         }


Upgrading wordpress from 3.5.8 to 3.8.2 with multisite

First of all, I want to introduce myself as a novice Wordpress developer and dig out questions in this forum before posting here. So, don't mark this question as duplicate. I have a wordpress application running on windows server. I upgraded Apache, PHP and Wordpress . Below is the old and new version:               #    Entities         Old system               New system     1.    PHP              5.1                       5.3       2.    Apache           2.0                       2.2     3.    Wordpress        3.5.8                     3.8.2     4.    Multisite plugin 1.5                       1.5     5.    MySQL DB         Pointing to same DB. There is no change here.      I installed new version of Apache and PHP on a different Windows server with same configuration. Then, install new version of Wordpress. As I studied on WP forum about manual upgrade - I followed all the steps and able to access the new wordpress application. I also enabled Multisite plugin as well as allowed redirection in .htaccess file. Now, when I access some links - system treats it like a new directory instead of a embedded site. **So, I am getting - 404 not found error message.** Can anyone help me to troubleshoot this issue?


Add tabindex to navmenu

I would like to submit a "tabindex" attribute in a navmenu structure. The default options do not allow me to do it.


Create a new page in a plugin

I'm writing a plugin that lets people add course information online. 'Courses' is a custom post type. I've already made the admin menu to add the course information to the database (in the post meta table). Now I need to bring it out onto the front end. Ideally I'd like to make a new template page (single-courses.php) so I can fully customise the page. I've not found anything that fits the bill online yet, is there an easy way of generating this through the plugin? Thanks


Send along login credentials with comment content

I'd like to allow my users to send their WordPress login credentials along with their comment, as opposed to having to log in first, and then post their comment. I'm not really sure where to hook into here, and any help would be much appreciated. My basic plan is to get the user's login and pass (and comment), log the user in (maybe during preprocess_comment), then supply the user id etc to the comment object, then let everything run as usual. But I'm wondering if I'm opening myself up to some kind of exploit by doing so. I understand that WordPress has a login form for a reason, and I'm hesitant to log the user in without going through the official form.


Wordpress Multi User Entries

I have a question, i want my wordpress site has multi user, like contributor for my site entries. but, in the homepage, i want to show only my entries, not the others. but i also want a page or rss feed maybe to display the other user's entries. So each user will not know other user's entries, except i give them the page url or rss feed of the other user. thanks, .mafaik


wp_dropdown_nav function to list menu items

Is there a `wp_dropdown_nav` function to list the menu items in a dropdown the same way as like in `wp_dropdown_categories`. I need to display a menu when the media size is greater than 480px and dropdown menu if media size is less than 480px. I am trying to list the menu items as dropdown. Currently I am using the wp_dropdown_categories instead of navgiation menu items.


Wordpress featured image url rendering incorrectly when page is loaded causing image to break

I migrated a site from my testing server to the live server. Everything transferred normally only the featured images are broken and not displaying. The URL's are being rendered incorrectly even if i re-upload the image. the testing server is dave-conner.com the live server is qmpdirect.com the page where the issue is happening on is http://qmpdirect.com/cpap-kits/ the first image path should be: qmpdirect.com/wp-content/uploads/2012/02/sleepstyle600-37440_184x184.jpg but is instead rendering as: /home/content/28/9036828/html//wp- content/uploads/2012/02/sleepstyle600-37440_184x184.jpg If anyone can tell me why this is happening and how i can fix it I would greatly appreciate it. I have been banging my head against the wall for a while now.


What is the function to get plugin base url in multisite?

I'm using this function `plugins_url()`. But it always echoes main site url even in subsite. So i'm getting ajax errors like `Domains, protocols and ports must match.` Lets say my main domain name is `blahblah.com` and my subdomain is `mysubdomain.blahblah.com` Is there any function available that returns `mysubdomain.blahblah.com/wp- content/plugins` instead of `blahblah.com/wp-content/plugins`? Thanks ## Update: As of now i'm using like this.               home_url( '/' ).'wp-content/plugins/'.str_replace(basename(__FILE__),"",plugin_basename(__FILE__))      Here `wp-content/plugins/` text hard coded. So any other alternative method there?