title: Performance of my permalink structure?

text: I have read the discussion on the performance of different permalinks on the wp hackers mailinglist, THIS forum and around Google. I could however not really deduce if the permalink structure I have been using for the past years is good or not:               /%postname%-%year%%monthnum%%day%.html      This combination put the postname directly after the / and the year,month,day combination makes it more unique since many postnames carry the same name. The html addition is something I have been using for the past 10 years on my blog (even pre wordpress) so that is legacy. I dont know if this is good for permance or bad for performance, how can i check this? (I have been running the blog for +10 years and there are about 10.000 posts with many links in) links:   1. http://codex.wordpress.org/Using_Permalinks   2. http://www.google.com/search?q=wordpress+category+permalink+performance   3. http://ottopress.com/2010/category-in-permalinks-considered-harmful/   4. http://lists.automattic.com/pipermail/wp-hackers/2010-October/035458.html


title: What are people using for displaying Image / Media copyright information?

text: I have tried the 'Image Credit' plugin but it seems flaky (possibly due to interaction with other plugins). What are other people using? The requirement is for each image used to have an associated field for copyright info.


title: Filter Menu Items by Custom User Role in a page

text: I want to create a page template where the contents of the menu is filtered. Say, on Template 1, I want only the pages/post created by a custom access role areamanager1 to be displayed on the Menu on all the pages that uses the Template 1. And the same goes with Template 2, etc. At first, I thought of creating a separate menu for each template on the widget panel **BUT** that's not practical for me because it would require the admin to constantly update the menu for each template everytime a new page/post is added. Any ideas on how to implement it? I would really appreciate any help. Alright, I am thinking if someone knows the dissected version of this function?               <?php if ( ! dynamic_sidebar( 'sidebar-6' ) ) : ?><?php endif; // end sidebar widget area ?>      I think that would help a lot. Cause I can edit the database query to display the posts/pages on the menu widget. Thank you.


title: Commit changes to WordPress Plugin SVN with TortoiseSVN

text: I'm trying to upload my plugin for the first time to the WordPress SVN. I've been granted access from the WordPress team. I am able to download the directory. Then I try to place my plugin files into the `trunk` folder, and then commit the changes. When I do this. I am prompted for my login credentials. I use the same ones that I use on the Wordpress.org website. However, it keeps re-prompting me to enter my credentials. I am not sure what I am doing wrong. I made a screencast of the process. http://www.screencast.com/t/3QCfSdyM


title: Get first category only and excluding one

text: How can I get the first category (linked to the category archive page) of a post excluding the category called 'featured'? I found various solutions but I can't combine them properly. Thanks UPDATE: This is what I ended up using:               $category = get_the_category();      $cat_id = get_cat_ID( $name );     $link = get_category_link( $cat_id );          if($category[0]->cat_name == "featured") {          echo ''. $category[1]->cat_name .'';     } else {          echo ''. $category[0]->cat_name .'';     }


title: Page Restriction and Redirect for Particular Levels or user

text: I am planning to have a page restriction and redirect for the particular level of users, but I dont have any idea how to implement that. Here's an example of what I want to achieve I have a page lets say for example "News" page, and I want it to be accessible for all Gold Members. If Silver users tried to access it. they should be redirected to any page where I wanted them to be redirected. Is this possible. I almost forgot to mention, I am using WishlistMembership Plugin.. I already asked some support from Wishlist but no reply so far.


title: Custom post types

text: I have made a custom post type called "Case Studies". There is a case studies page which displays the title of every custom post and a small exceprt. However when you click on the title to view the single post, on the navigation the current tab changes from "`Case studies`" to "`News`". Where news is the default post page and case studies is a templated page. Is there a way to make the custom post type a child of the `Case Studies` page? Or atleast set a template file that I can use for the custom post type. When you view a single `case study` post I need the navigation to show that you are still on the `Case Studies` page and not on News. Thanks


title: Prompting for review / reapproval of page content

text: I have a fair amount of content in wordpress pages that gradually gets out of date over time. I can have an 'offline' process to set reminders in my calendar to remind me to review particular pages and bring them up to date. However I was wondering if there is a way (with a plugin perhaps) to have WordPress put the pages into a 'needs review' state a certain amount of time after it was last edited. This would keep the page live, but prompts me to review the content.


title: Is it possible to load plugin from console with core ?

text: I developing some scrapping plugin for my own purpose. So each 10 minutes i need to start my plugin from the cron. Plugin will parse some posts from other pages and add it to wp. So is it possible to load plugin with wp core from console?


title: How to filter post from categories only if the posts appears in one of them, not the other?

text: The scenario is, some posts have one category, ok. Some others have more than one category. I must create post with content and also slideshow thumbnails for use with Nivo plugin gallery. Ok. I want to filter all the posts in the "slideshow" category when in index pages, so I use a simply query_posts($query_string . '&cat=-1,-36'); Category number 1 is "Undefined", and number 36 is "Slideshow". Ok. But... I have some posts that have another category, lets say, number 50, "Applications" and I wanna show these posts, despite they are too in "Slideshow" category. I cannot find the way to say WP "show me posts, except the ones in categories 1 and 36, but show me them if they have more categories". Googling and reading a ton of docs and pages I haven't found any way to know the categories count by post (not how many posts by category), maybe to build a query like "show me that, filter that EXCEPT if count(categories are my post present) > 2 ). Some ideas? Thank you!


title: How can you handle rewrite rules for custom post types with option to filter on custom taxonomy terms?

text: I have seen this question but can't wrap my head around actually filtering on the taxonomy as well.. Essentially what I'm looking for is an archives page for the taxonomy such as mysite.com/movies (which the previous question answers), but to filter on custom taxonomy within the custom post type such as Settings => New York, Berlin so that you can use links such as mysite.com/movies/new-york. Any pointers as to what my rewrite rules should be would be greatly appreciated.


title: WP-e-Commerce and W3-Total-Cache integration problem

text: My shopping cart is being cached by w3 total cache. This is the expected default behaviour. The thing is I can't find an easy solution for this. I am showing my shopping cart on almost every page, so using rejected cookies or something similar is not an option. Is it possible to tell w3 total cache not to cache a single php file like cart_widget.php? Or some other workaround? I know there is the possibility to load the cart via ajax as the plugin does not cache GET requests with parameters (by default). Still, I would like to avoid that extra request. EDIT: Also, w3 total cache is not regenerating the page when I edit the product, is there an easy way to tell w3 total cache to empty the cache for a single page?


title: 404 Error on Activate / Deactivate Plugin

text: I have a standard WP install (3.5.1) and am trying to activate a new plugin (WP Super Cache) however each time I try to activate it, I get my site's 404 error page... which is strange as it's the same page (wp-admin/plugins.php) as the plugin list page I'm activating from, but with a query string. Stranger still is that I cannot deactivate, or activate any of my other plugins?!? I haven't changed the `.htaccess` file or made any changes to the permalink structure and can't seem to nail down what is going on? There doesn't seem to be any resource on this anywhere; anyone have any ideas? Any help would be greatly appreciated!


title: How do I unset all of the select boxes for pages

text: I am using WooCommerce and need to recreate the default pages. The answer given is   1. Go to WooCommerce > Pages and unset all of the select boxes for the pages (including the shop base option).   2. Deactivate the WooCommerce plugin   3. Activate the WooCommerce plugin But how do I actually unset all of the select boxes for pages - not sure what it means


title: Widget "Save" resetting jQuery hidden fields

text: I have a widget plugin that I've created, that lists about 10 fieldsets. jQuery runs at the beginning and hides and fieldsets that have no values. There are also buttons that allow to "Add" and "Remove" fieldsets. Everything works great except for when its time to "Save". After clicking Save all of the jQuery stops working, all of the hidden fieldsets are shown, and the "Add" and "Remove" buttons no longer work. The only way to continue using the widget properly is to refresh the page Anyone idea what might be causing this, or a possible solution?


title: greatest() function returns undefined property

text: I'm using the mysql GREATEST() function to compare two table fields and display in a loop either one with the highest integer value. The 2 fields consist of vote scores for posts: UP or DOWN.               function vote_results($post_id) {        global $wpdb;        $table = $wpdb->prefix . "post_votes";           $results = $wpdb->get_row( "SELECT GREATEST (up, down) FROM $table WHERE voted_post_id = $post_id" );       echo $results->up; //echo if highest value       echo $results->down; //echo if highest value          }      Then in my loop I call the function but get `Notice: Undefined property: stdClass::$up` for               echo $results->up;      and the same notice for `down`. I'm not sure what I'm doing wrong here.


title: Allowing a user to write a post from another website?

text: The idea here is to have a site (any site) which somehow has the user's WordPress user-name and login (maybe as part of a sister site) to allow him to write a post on his own blog. The idea I have now is basically a simple form sent (perhaps with curl or socket) to the user's blog admin_ajax.php, even though it is strictly not an AJAX call. Are there any other methods which I could try or is there something built into WordPress itself already?


title: Slow Query for the wp_options table

text: I have been tracking the slow queries log of the WP based site (with the default value of the a long_query_time set to 10), and I have noticed that the following query is often getting logged -               # User@Host: root[root] @ localhost []     # Query_time: 0  Lock_time: 0  Rows_sent: 394  Rows_examined: 458     SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes';      I do not understand how such a small table can take so much time to execute. Is this just a symptom of some other problem? (Currently running Moodle, phpbb and WP on a dedicated VM).


title: Walker for menus

text: I want to modify all of my `<li>`'s `class`es and `id`s, but the function `wp_nav_menu()` does not let me do so, so I think I need to use a walker. I am pretty new in OO, so using an object is not really easy. I'm pretty sure I need to extend `Walker` class (or `Walker_Nav_Menu` class?), but I'm not sure what method to override/implement. What method of my object is being called when I pass it as an argument in `wp_nav_menu( array( 'walker' => new myWalker ) )`? I do not want to do this with filters and actions because I find it cleaner with walkers.


title: Cannot install plugins even though www-data has write permissions

text: All the files in my WordPress path are owned by `myuser:www-data` and Apache is running as www-data. All files and folders have group write permissions, e.g. `-rw-rw----`, but I keep being prompted for FTP details when I try to install a plugin. If I chown the path to the www-data user, plugin installation and deletion work as expected, but then _myuser_ cannot edit files. I could add _myuser_ to the _www-data_ group, but then _myuser_ could access all other sites. My files are chown'ed as follows:               chown -R myuser:www-data wordpress-folder/*      And chmod'ed as follows:               find wordpress-folder/ -type d -exec chmod 755 {} \;     find wordpress-folder/ -type f -exec chmod 644 {} \;      If my files are owned by the www-data group and are group-writable, then surely WordPress should be able to install plugins. Why can't WordPress install plugins? Here is the output of `ls -la` in my plugins folder:               total 48     drwxrwx---  9 myuser www-data 4096 Aug  5 01:26 .     drwxrwx---  6 myuser www-data 4096 Aug  5 01:51 ..     drwxrwx---  6 myuser www-data 4096 Jul 10 16:27 disqus-comment-system     -rw-rw----  1 myuser www-data 6148 Jul 10 15:37 .DS_Store     drwxrwx---  7 myuser www-data 4096 Jul 10 16:30 gravityforms     -rw-rw----  1 myuser www-data   30 Jul 10 15:37 index.php     drwxrwx---  3 myuser www-data 4096 Jul 10 16:30 lime-export     drwxrwx---  6 myuser www-data 4096 Aug  1 11:17 mp6     drwxrwx---  6 myuser www-data 4096 Aug  5 01:26 rewrite     drwxrwx--- 10 myuser www-data 4096 Jul 10 16:38 wordpress-seo     drwxrwx---  7 myuser www-data 4096 Jul 24 17:14 wp-minify


title: Custom archive pages without "the loop"

text: Is there a way that I could control the rendering of an archive page that uses my own loop? I'd like to group the posts by a custom taxonomy, then sort them by date.


title: wpautop() when shortcode attributes are on new lines break args array

text: I have a custom shortcode tag with a few attributes, and I would like to be able to display its attributes on new lines - to make it more readable to content editors:               [component         attr1 ="value1"         attr2 ="value of the second one"         attr3 ="another"         attr4 ="value"         ...         attrN ="valueN"]      The reason behind this requirement is that a few attributes might be quite verbose in content. Unfortunately, `wpautop()` adds some nasty extra markup that breaks the `$atts` array like this (using php `print_r($atts)`):               Array ( [0] => attr1 [1] => ="value1"     /> [3] => attr2 = [4] => "value [5] => of [6] => the [7] => second [8] => one"     /> [10] => "" //...and more like this)      I've tried with the attributes **inline** :               [component attr1 ="value1" attr2 ="value of the second one" ="value"... attrN ="valueN"]      and the output is as expected:               Array ( [attr1] => value1 [attr2] => value of the second one [attr3] => //...and so on)      is there any way to have the attributes intented and avoid that extra markup that breaks the `$args` array? the function that I use to register the shortcode `[component]` extracts the values like this:               function component_func( $atts, $content = null ) {     extract( shortcode_atts( array(         'attr1' => 'attr1',         'attr2' => 'attr2',         'attr3' => 'attr3',         ), $atts ) );         // more code     }      I then use those extracted variables to populate another array


title: Multiple loops for plugin

text: Ok I'm using the plugin "The Cart Press" and I am trying to understand how multiple loops work when using a custom post type. If I do a regular query for posts it just gives me back my blog posts and not my TCP products. When displaying products regularly they use the same loop functions as blog posts and so I'm wondering what is happening differently to cause these products to be loaded. I have used a portfolio plugin in the past called "Simple Portfolio" which has a custom function called simple_portfolio_get_projects() which just gives me an array of projects and I would like to be able to do the same with TCP products.


title: Whats the point of returning a value in AUTO_SAVE

text: > **Possible Duplicate:**   >  Return $post_id when DOING_AUTOSAVE?               if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {         return $post_id;     }      I always see this in custom made themes, but is it really necessary to return a value if you're trying to get auto save to not do anything? why not just leave it empty or return false.


title: Custom media upload content for inserting custom post shortcode

text: I’m working on a plugin that creates custom post type “portfolio” along with shortcode to insert in any page or post. The shortcode is: `[portfolio option1=“1” option2=“0” option3=“1” ]` And it works just fine, it shows all custom posts via custom `WP_query`. But I want to go further. Create a custom button next to `upload media` for generating a portfolio shortcode output, where user can select which post to include and define all options. So the output would be: `[portfolio option1=“1” option2=“0” option3=“1” ids=“12,311,432,443,” ]` This is the code for a button I found in wp’s media.php:               add_action( 'media_buttons', array( $this, 'media_buttons' ) );          public function media_buttons($editor_id = 'content') {         $post = get_post();         if ( ! $post && ! empty( $GLOBALS['post_ID'] ) )             $post = $GLOBALS['post_ID'];              wp_enqueue_media( array(             'post' => $post             ) );         $img = ' ';              echo '' . $img . __( 'Add Portfolio' ) . '';     }      And it does what does. But, now, what it the best way to modify the content of created window? Here’s a picture of how I see it, it’s better that any description: ![enter image description here](http://i.stack.imgur.com/XgJED.png) How potentially complicated and tricky this would be to accomplish? I do not know what direction should I look to, is that even possible? Please advise any suggestions where should I start digging for solution. P.S.: Or maybe I'm wrong in the first place and should consider using ThickBox? But I want to the keep native look of the media upload popup. Cheers! **EDIT:** Well, maybe a much better solution would be to use native gallery shortcode pattern. It not difficult to add a new menu item in the media upload window, as it explained for example here. So the final vision is something like this: ![enter image description here](http://i.stack.imgur.com/09O5e.jpg) ![enter image description here](http://i.stack.imgur.com/rbWaK.png) It must be done with Backbone.js I believe? But the main question, can it manipulate custom posts instead of images?


title: meta_query: using BETWEEN with floats and/or casting to DECIMAL

text: Each post has a lat/lng value attached to it via postmeta. I'm trying to grab all posts within a bounding lat/lng value. Here's the `get_posts` query:               $posts = get_posts(array(         'posts_per_page' => 100,         'post_type' => 'place',         'post_status' => 'publish',         'meta_query' => array(             array(                 'key' => 'places_lat',                 'value' => array($lat_min, $lat_max),                 'compare' => 'BETWEEN',                 //'type' => 'DECIMAL',             ),             array(                 'key' => 'places_lng',                 'value' => array($lng_min, $lng_max),                 'compare' => 'BETWEEN',                 //'type' => 'DECIMAL',             ),         ),     ));      Since postmeta values are stored as strings, I figured I should be casting to `DECIMAL`, but it just seems to trim the decimal value from the string due to the lack of `DECIMAL` arguments/precision parameters. I did notice the query treats the floats within the `value` array as strings, which could also be another point of failure. Running the compiled query without the quotes around each floating value works as expected. I'll be using `get_permalink()` on each post. I can run a custom query outside of `get_posts` (via `$wpdb->get_results()`) to properly grab the posts within the bounding box, then loop through the posts and `get_permalink`, but it ends up firing an additional database query per post to build the permalink - not an ideal solution! Any ideas?


title: How do I programatically remove Menus?

text: I know that each menu item is simply post present in `nav_menu_item` post type. It has has ID and can be removed with `wp_delete_post()` but posts deleted this way don't remove menus present under [Appearance > Menus]. Only menu items are removed. For instance I have "My Menu" under [Appearance > Menus] that has the following items: page-1, page-2, category-3. I can remove menu items with `wp_delete_post()` but "My Menu" (group for those items) remains intact. How can I programatically remove all defined Menus (and menu items)?


title: How do I switch my Wordpress to point to Parked Domain?

text: Bought some hosting with BlueHost, and when I signed up, I carelessly choose 'DekhoForum' as my domain name. I proceeded to setup a website with Wordpress 3.1 at the root folder of that address. Realised that my company had already reserved some domain names with a different provider, that were more suitable. So we got those domains forwarded to the BlueHost nameservers. So. I now have a parked domain for dekho.com.au as shown in my cPanel: ![BlueHost](http://i.stack.imgur.com/npKhe.png) If I hit the parked domain, it does take me to my Wordpress install. However, when I click on subsequent links, it will take me to URLs like:   _dekhoforum.com/page=1_   I would prefer it to retain:   _dekho.com.au/page=1_ How do I fix this? Seeing as I am still in the early stages of my development, I would like to iron this issue out from the beginning to avoid any headaches further down the track. I am not sure if this is something I should be changing under the Wordpress settings or something from within my BlueHost cPanel?


title: WordPress as a data-store?

text: I would like to use WordPress to not only run my site, but also to manage users, handle authentication, and read/write content via a client application, but I would like to avoid writing everything from scratch on the PHP-side, as I don't know PHP that well. Is there a "Services" plugin similar to that in Drupal, or something else that can give me easy access to using WordPress as a data-store for a client application? Thanks much in advance for all of your assistance!


title: Caching for logged in user and Ajax update

text: I would want to serve the homepage with a cached version of the page for both logged in and new users. And then to use Ajax to update the content appropriately, for example if the user had already vote up a post, the relevant button would be different than otherwise. As I am new to wordpress, I wonder is there any way or appropriate plugins to achieve this goal. Alternatively can I use Ajax to update only some part of the page, e.g. Post meta on the present page?


title: Customizing gallery shortcode in 3.5

text:
I'm trying to customize the gallery shortcode using the new gallery system in 3.5 and I'm having a bit of trouble and can't figure out where I'm going wrong. This is what I've got at the moment **(in functions.php)** :               include( 'lib/theme-setup.php' );     include( 'lib/load-scripts.php' );          add_filter( 'post_gallery', 'my_custom_gallery', 10, 2 );     function my_custom_gallery( $output, $attr) {         global $post;              // We're trusting author input, so let's at least make sure it looks like a valid orderby statement         if ( isset( $attr['orderby'] ) ) :             $attr['orderby'] = sanitize_sql_orderby( $attr['orderby'] );             if ( !$attr['orderby'] )                 unset( $attr['orderby'] );         endif;              extract(shortcode_atts(array(             'order'      => 'ASC',             'orderby'    => 'menu_order ID',             'id'         => $post->ID,             'columns'    => 0,             'size'       => 'medium',             'include'    => ''         ), $attr));              $id = intval($id);              if ( !empty($include) ) {             $include = preg_replace( '/[^0-9,]+/', '', $include );             $_attachments = get_posts( array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );                  $attachments = array();             foreach ( $_attachments as $key => $val ) {                 $attachments[$val->ID] = $_attachments[$key];             }         } else {             $attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );         }              if ( empty($attachments) )             return '';              if ( is_feed() ) {             $output = "\n";             foreach ( $attachments as $att_id => $attachment )                 $output .= wp_get_attachment_link($att_id, $size, true) . "\n";             return $output;         }              $output .= '
';         $i = 1;              foreach ( $attachments as $id => $attachment ) :                  $attimg = wp_get_attachment_image( $id, $size );             $atturl = wp_get_attachment_image_src( $id, $size );             $output .= '';             $i++;              endforeach;              $output .= '
';              return $output;     }      Then I just have a simple custom page template that displays the gallery referencing 'the_content()' within the loop to output the gallery shortcode:               if (have_posts()) : while (have_posts()) : the_post();          the_content();      endwhile; endif;      The images show up, but for some reason the javascript functionality for the gallery does not work using it this way. The problem has to be with the shortcode because oddly enough, if I take out the loop in the custom page template and just add a function to retrieve the attachments of the page instead of using the shortcode, the javascript works and loads fine. The problem with this though, is that it pulls in all the images attached to that page, and I just want the ones that are in the gallery for that particular page which the gallery shortcode accomplishes. I really like the new gallery interface for 3.5 and would love to be able to implement this functionality for my galleries. Any advice on what might be causing this?


title: How to disable Page Attributes dropdown in wp-admin

text: As discussed at WordPress admin screen very slow / timing out when editing or adding a new page/custom post I am having a similar issue on a WP site containing 7,784 pages. Edit screens are slow loading due to the rendering of all 7k pages in the source code for the Page Attributes dropdown menu. Besides editing core, there must be a better way to deal with this. Seems like a flaw to render all pages on the edit screen. Feedback from others with high volume/traffic WP sites much appreciated!


title: How would I get a list of posts from a custom post type

text: I know the query method that you would use, that's not what I want. I could query the post type, then do the if statement with the while statement and go from there, but I am trying to populate a drop down with post titles. Thus I need an object. What I have, which isn't working - there should be two posts in this object but their isnt, it comes back NULL, is:               $args = array('post_type' => 'carousel', 'suppress_filters' => 0, 'numberposts' => -1, 'order' => 'ASC');     $content_block = get_post($args);          var_dump($content_block) // NULL      What would I do to get all the posts of the type `carousel`? which I know for a fact has 2 posts in it. I can go to `site.com/carousel/ctitle` to see `ctitle`'s content. But when I try the above I get `NULL`


title: Encode URL picked up by Digg Digg

text: I have found the following JavaScript to encode. It's just I don't know where to plug it into Digg Digg plugin.               encodeURIComponent(location.href)      How can I customize / modify Digg Digg plugin (Facebook share) so it will picked up URL by encoding first ?


title: Remove the deleted users avatar from list

text:
## Problem Hi everyone, I have a bit of a problem. I have a function that outputs the avatars of users that follow me . It works great, but if the user is deleted the avatars remain visible as a blank image box with a broken hyperlink missing the users username. Is there any way to get rid of the deleted users avatar from the list? ## Function               function get_status_following($userid, $count = 0){          $followers = get_the_author_meta('following', $userid);          /** if no followers at the moment */     if( !is_array($followers)){         $return = "";     } else {              $return = '
' . "\n";         foreach( $followers as $folow){                  $return .= "
";                 $return .= '';                     if( get_the_author_meta( 'user_custom_avatar', $folow ) != "" ) {                         $return .= '';                     } else {                         $return .= get_avatar( get_the_author_meta( 'user_email', $folow ), '40' );                     }                 $return .= '';             $return .= "
";              }         $return .= '
' . "\n";     }          echo $return;          }      ## Outputing the function in a page               <?php printf( __(' %1$s', 'bo'), count_following($curauth->ID) ); ?>     <?php get_status_following($curauth->ID); ?>      Thank You for the help in advance


title: Multiple Taxonomy in URL/Query - No Custom Post Type

text: I have Volume and Issue as separate Taxonomies and all Posts have a Volume and Issue assigned. These posts are of post_type=post, not a custom post type. I linked to and queried for the Volume Taxonomy quite easily . However, I'm stuck when I need to make a URL and query for all posts which belong to Volume-X and Issue-X. I'd love for the url which lists all posts in Issue-X to be example.com/volume-1/issue-1 (i use _volume-1_ taxonomy term and _issue-1_ taxonomy term to perform a query) but cannot figure out how to do this. The query is not an issue, I can do a tax_query with 2 taxonomies, I just cant figure out how to rewrite my url to the appropriate place/page to do the query. How would I accomplish a url structure of example.com/volume-1/issue-1/ or example.com/volume1/issue/1 and have it list posts which have a taxonomy term of volume-1 and issue-1? Again, these posts are regular wordpress posts, not custom_posts. Hopefully, an answer would allow for pagination as well? i've been struggling with this for a week or so, really need to put this one to bed :(               function add_custom_taxonomies() {               // Add new "Locations" taxonomy to Posts     register_taxonomy('volume', 'post', array(     // Hierarchical taxonomy (like categories)     'hierarchical' => false,     // This array of options controls the labels displayed in the WordPress Admin UI     'labels' => array(     'name' => _x( 'Volume', 'taxonomy general name' ),     'singular_name' => _x( 'Volume', 'taxonomy singular name' ),     'search_items' =>  __( 'Search Issues' ),     'all_items' => __( 'All Issues' ),     'parent_item' => __( 'Parent Volume' ),     'parent_item_colon' => __( 'Parent Volume:' ),     'edit_item' => __( 'Edit Volume' ),     'update_item' => __( 'Update Volume' ),     'add_new_item' => __( 'Add New Volume' ),     'new_item_name' => __( 'New Volume Name' ),     'menu_name' => __( 'Volume' ),     ),     // Control the slugs used for this taxonomy     'rewrite' => array(     'slug' => 'volume', // This controls the base slug that will display before each term     'with_front' => false, // Don't display the category base before "/locations/"     'hierarchical' => false      ),     ));          register_taxonomy('issue', 'post', array(     // Hierarchical taxonomy (like categories)     'hierarchical' => false,     // This array of options controls the labels displayed in the WordPress Admin UI     'labels' => array(     'name' => _x( 'Issue', 'taxonomy general name' ),     'singular_name' => _x( 'Issue', 'taxonomy singular name' ),     'search_items' =>  __( 'Search Issues' ),     'all_items' => __( 'All Issues' ),     'parent_item' => __( 'Parent Issue' ),     'parent_item_colon' => __( 'Parent Issue:' ),     'edit_item' => __( 'Edit Issue' ),     'update_item' => __( 'Update Issue' ),     'add_new_item' => __( 'Add Issue Volume' ),     'new_item_name' => __( 'New Issue Name' ),     'menu_name' => __( 'Issue' ),     ),     // Control the slugs used for this taxonomy     'rewrite' => array( 'slug' => 'issue', 'with_front' => false )               ));      } add_action( 'init', 'add_custom_taxonomies', 0 );


title: Determining Slug Before and After Edit

text: If I were to edit a post or a page, how would I determine what the slug was before the edit, and again afterwards to compare them and see if it was changed? Also, would the same method work for any Custom Post Types created, or is that done differently?


title: Smart post format loop problems

text: Hi i'm trying to adopt the `get_template_part()` method for looping post formats as in:               if ( have_posts() ) :         while ( have_posts() ) : the_post();             if( ! get_post_format() ) {                 get_template_part( 'format', 'standard' );             } else {                 get_template_part( 'format', get_post_format() );             }         endwhile;     endif;      The theme i'm developing from see files has an `index.php` file with the following calls               <?php     /**      * @package WordPress      * @subpackage WP-Skeleton      */              get_header();  //the Header              get_template_part( 'menu', 'index' ); //the  menu + logo/site title               get_template_part( 'loop', 'index' ); //the Loop                get_template_part( 'sidebar', 'index' ); //the Sidebar               get_footer(); //the Footer           ?>      loop.php is the main loop. I'm not sure if I have to modify the index.php or loop.php files. I realise I have to create `format-audio.php`, `format-video.php` etc. for my various formats. Whenever I try to get this going I get a continous loop of my posts. Any help explaining this would be appreciated. Many thanks


title: Custom shortcode that writes to file

text: I'm trying to maybe do too much in a shortcode call. Here's the code I have:                       //[rand]     function randnumber_func( $atts ){      $digits = 4;      $randnumber = rand(pow(10, $digits-1), pow(10, $digits)-1);      $space = "\r\n";      $myFile = "offer_codes.txt";         $fh = fopen($myFile, 'a+') or die("can't open file");         $stringData = date("F j, Y, g:i a") . " - " . $randnumber;         fwrite($fh, $stringData.$space);         fclose($fh);      return $randnumber;     }     add_shortcode( 'rand', 'randnumber_func' );      I want to create a random 4 digit number and have it printed to the page. I also want to take that random number, append the date to it, and have that written to a text file. It works in PHP, but not when I call it via a shortcode. Is something it Wordpress stripping it out or do I have it written incorrectly for the shortcode function?


title: List Categories (wp_terms) and count posts

text: I have a problem (of course) and I'll go straight to the point: I need to list all the custom categories and count the posts for each category eg.   * Category 1 (xx posts)   * Category 2 (yy posts)    * etc.. I tried a couple of queries but with no luck. All these categories are stored in the wp_terms table, how do I list them since I've seen that there isn't, apparently, any elations between wp_terms and the posts?   Worthless to say that i've tried wp_list_categories but it shows just "Uncategorized" since the website I'm using, uses custom post rather than "default" categores. Thanks in advance!


title: "Duplicate" Posts Appearing Since 3.1.2 Update

text: I've encountered some issues on a clients site since upgrading to WP 3.1.2, and have this evening updated to version 3.1.3, only to find that the problems still persist. http://www.harmonyreins.com.au The website is for a local animal shelter, and each post represents a different animal that lives at the shelter. There are a number of categories that specifically relate to the type of animal, such as dogs, cats, horse as well as a "recently adopted" and an "old friends" category. Those last two categories were excluded from the full post list (under 'Meet The Gang' in the navigation) using the following code:               <?php query_posts($query_string . '&cat=-10,-12'); ?>      The upgrade to WordPress 3.1.2 (or the accompanying database update, I'm not sure which) made this code redundant, and the excluded posts began appearing in the 'Meet The Gang' section. I enquired about the issue on WordPress.org, and the following fix was suggested: > Chris, > > Replace the following in your theme's index.php >   >   >     <?php query_posts($query_string . '&cat=-10,-12'); ?> >     <?php if (have_posts()) : ?> >     <?php while (have_posts()) : the_post(); ?> >   > > with >   >   >     <?php query_posts('cat=-10,-12'); ?> >     <?php if ( have_posts() ) : while  ( have_posts() ) : the_post(); ?> >   > > and you should be good. Unfortunately this resulted in another issue, displaying the posts from page one of the list on page two also (you can see what I mean if you go to the site). I've tried multiple pagination plugins with no success. Regardless of what page you're on, only the first ten animals are displayed. My client has been really good regarding this issue, but it's been going on for weeks now, and I really need to get it solved. Hoping someone can help me out. :-)


title: FB like adds WordPress install screen text to the wall

text: I have a site for a client that is behaving very strangely. You can view the site here http://cruisephotofactory.com When you click the like button in the sidebar instead of using the open graph values the site gives, FB posts the text from the WordPress install screen. This text is 100% not on the site anywhere and anyway the only time it appears is during install, when obviously the FB button was not yet installed or active. I have the same site, same code, same theme, same everything installed on a second domain http://cruisephotofactory.it and here I would expect the same thing to happen, only it doesn't. instead it seems to post the wp object on the FB wall. If I clone the site to a different domain on a different server, everything works fine the problem only seems to be happening on these 2 domains. I am sure it has to be something blindingly obvious I am missing and I am going to feel really stupid when its pointed out, but blasted if I can figure out how 2 different, repeatable outcomes are happening with the same code and how its getting the install text in the first place!


title: CDN: Origin server URL, WordPress Core files installed in sub-directory

text: I've just purchased a plan with MaxCDN to deliver my content through CDN, but i've got a small issue before i create a pull-zone. I moved my WordPress core files out of my root and into a sub-directory. These are my current settings: WordPress address URL: `http://example.com/wordpress` Site address URL: `http://example.com` The question is whether i should have my Origin Server URL and custom CDN domain name according to my WordPress address or site address. Here is the tutorial I'm currently following, in case you need to view the MaxCDN dashboard. Thanks in advance.


title: Code for Category, Tags, Archive URLs

text: Working on an SEO plugin and stuck on something I thought would be simple. Looking for code to generate just the URLs for categories, tags, search, and date archives when on that archive set. So if on category ABC there's the URL to www.domain.com/category/abc/ Was hoping it was something simple like this for the categories part:               echo get_category_link($cat->term_id);          or          echo get_category_link($category->term_id);      but apparently not. The general code works if I add a specific category               echo get_category_link(123);      The plugin adds code to the head via wp_head() The plugin (if I ever finish it) will be a replacement for so called SEO plugins that use noindex and nofollow to 'sculpt' PR/protect link benefit. Noindex wastes link benefit, nofollow deletes link benefit so they shouldn't be used. David


title: 'Global' settings page for multisite plugin

text: I'm working on a plugin that will be installed in a multisite instance. How do I create a single settings page that is visible at the "Network admin" level only - most of the guides i've seen relate to a standard blog level plugin. Any links to information would be useful, otherwise I'll just end up going through sitewide tags to see how it's being done there. [Update] Looks like sitewide_tags uses `add_site_option`, `get_site_option` and `update_site_option`, and these functions use wp_sitemeta. However, from what I can see, there's no support for register_setting, add_setting, etc, so you have to get and set your options manually.


title: Wordpress Custom Post Types with a page as a parent?

text: I have a lot of custom type items in my new WP project, and for navigation reasons, I want to make the parent to some of them a Wordpress page. The problem is that apparently, Wordpress does not let you establish parent-child relationships between items with different post type. Is there anyway to override this? I am using Wordpress 3.1


title: How to display all custom fields associated with a post type?

text: What is the best way to display/dump **all** custom fields associated with a post? It doesn't have to be pretty, I just need to verify what is being saved in what field array for debugging. Thanks!


title: woocommerce - How Can I add author metadata for a product?

text: Hi I am using woocommerce with Mystile Theme for a book store. How Can I add author taxonomy for a product? I need to set an author for every book I am selling and possibly to search trough, author, categories, product names and tags.


title: Display posts between two particular dates

text: I have this code for display posts between two particular dates:               $s = '2011-10-23';     $e = '2011-11-17';          function filter_where($where = '') {             $where .= ' AND post_date >= $s AND post_date <= $e';         return $where;       }     add_filter('posts_where', 'filter_where');     query_posts($query_string);      But that's not work until change to this:               function filter_where($where = '') {             $where .= ' AND post_date >= '2011-10-23' AND post_date <= '2011-11-17'';         return $where;       }     add_filter('posts_where', 'filter_where');     query_posts($query_string);      What's wrong in first code?


title: Best way for a plugin to define a custom post type archive template?

text: I'm working on a plugin which registers a new post type, and I want to be able to define a default loop for the archive page. I've been trying to brainstorm the best way to do this, and I keep coming up short. Basically, what I need to do is this: My post type should display in archive pages as title, excerpt, and custom field only. I also need to run certain filters on the archive page. I've been asking users to create their own archive-{myposttype}.php file, but that is a little over the heads of casual site owners. So, thoughts I have had include:   * Creating my own template file that I load on the template_redirect hook... probably out, as there's really no way to generate the correct markup for a given theme.   * Trying to save a new file on plugin activation by some crazy regex processing of existing template files... I think that it might be possible, but I feel like I must be doing something wrong.   * Asking users to choose an existing page to hold the archive for my custom post type, then using the_content filter to output my archive... which is very doable, but then I have to hack the query a good deal, and I end up breaking the is_query conditionals and so on... This question may be too subjective to provide a good answer to, but I'd like to hear any thoughts on it.


title: Use Author Ids or Names to echo different output inside loop

text: Is there a way to use the author ids (or names) to echo different output for different authors (in this case author id 7 and author admin? I tried the following but it didn't work.                   ?php if (get_the_author_meta(7)) {echo '<a href="<?php the_permalink(); ?>" >';           echo'<?php echo get_post_meta($post->ID, "Thumbnail", true);?>'; echo '';} else {         echo '<a href="<?php the_permalink(); ?>" ><img src="<?php echo get_post_meta($post->ID, "Thumbnail", true);?>"/>';  } ?><?php  ?>


title: Is it possible to create a post using a metabox?

text: I am trying to create a post (well, in the end, multiple posts) from a metabox using the 'save_post' hook. I executed the script once, creating 3900 or so new posts before I crawled into posts.php and discovered that wp_insert_post() calls the 'save_post' hook. Does anyone have a creative solution around this to create the post without doing a direct db insert (the less hacky the solution is the better). # Code               add_action( 'add_meta_boxes', 'my_metabox_init' );     add_action( 'save_post', 'my_metabox_save' );     function my_metabox_init()     {         add_meta_box(             'my-metabox',             'My Metabox',             'my_metabox_render'             'post',             'normal',             'core'         );         //enquque scripts and styles     }     function my_metabox_render() {         //generate datasets     }     function my_metabox_save() {         //data authenticity check         //process & sanitize data              //create posts         for( $i=0; $i<$count; $i++ ) {             $args = array(                 'post_status' => 'pending',                 'post_title'  => $_POST['post_title'][$i],                 'post_type'   => 'custom_post_type',             );             foreach( $category_array[$i] as $category ) {                 $args['tax_input']['custom-taxonomy'][] = $category;             }             if( $_POST['id_of_previously_created_post'][$i] != '' ) {                 $args['ID'] = $_POST['id_of_previously_created_post'][$i];                 unset( $args['post_status'] );             }             $new_post_id = wp_insert_post( $args );         }     }      Thanks!


title: How to group non-hierarchical tags?

text: Similiar to category drop down box for a list of terms with the same parent, I want to make such a drop down for a list of tags with the same group name( or some other conditions that works). Seems WP doesn't provide a way to use term group, any other way to make the drop down ?


title: Unwanted Links and Spam Wordpress Pages and Posts

text: In webmaster tools I have a number of crawling errors of the Google spider. for example http://mydomain.com/my-page/de/roulette.html They say they cannot crawl to this page.. but what kind of page is this ? what is /de there ? I checked the link and my site says the page doesn't exist. Then i just noticed that my "Akismet" is not activated... So i will activate it now and how can i remove that extra link in my site?


title: custom post type or taxonomy, which approach is better?

text: I have a custom post type where i need a field called country along with its flag. Now i am divided in between two choices: [1] to create a custom post type called country with title(name of country) and featured image(flag) ... or [ 2]. to register a taxonomy called country and add a custom field in the taxonomy called flag with type image(using plugin like taxonomy manager) I would like to use your expertise to make this important decision which one would be a better practice and more convenient and efficient as well. thanks in advance!


title: Wordpress “Categories to tag converter” not working on imported Blogger posts

text: I just imported a blog from blogger to wordpress recently. The blog consisted of about 3500 tags in total. On importing them into wordpress, they were converted to categories for some reason. I have installed and the **categories to converter** plugin by wordpress that allows you to convert them to tags. On the converter page, i have checked all the categories (using the **check all** button) then clicked on the **convert to tag** button. However, after waiting for the conversion to take place, the page refreshes and goes back to exactly how it was before i clicked on the button, i.e, nothing is converted. Tried it several times and even uninstalled and re- installed the plugin, but no luck. Was wondering if someone else has had the same problem and resolved in. I'd appreciate any help Many thanks in advance.


title: Deleting a custom field field

text: Is there a way to delete a custom field (in the sense of complete removal from WP database) without using a plugin?


title: Get the <!--more--> link text

text: How I can get the link text is using WordPress? By default is something like:               Read More →      buy I want to get that value in a variable because some WordPress installation can have that value customized (using filter the_content_more_link) or in another language. In resumen: what I need is to get from WordPress the text (the HTML code) that WordPress uses to replace the when display a Post Content.


title: how can i hide category?

text: Please help me I am new baby in wordpress, how can i hide that 'course or call' category from the page.. i have var dump the variable which is passing as parameter to query_post                       $args = jr_filter_form();             var_dump($args);             query_posts($args);      ![enter image description here](http://i.stack.imgur.com/6y4CR.png) this category is having tag_ID="65" in its url , which i have seen in wordpress dashboard, job category page please help me a little thanks


title: Enqueue AWS Script

text: I am working on the integration of an Amazon Webstore (Amazon Checkout) on a WordPress site using Amazon Documentation here. Has been a while since I worked with enqueueing external JScripts. I need to load two scripts from Amazon. I added some code to functions.php, but I seem to have made a mistake and I keep on getting errors such as:               TypeError: 'undefined' is not a function (evaluating '$(jQuery(document).find("#globalParameters"))').       On merchant_cart.js:5 Here is the code:                   function img_scripts_with_jquery()     {         // Register the script like this for a theme:         wp_register_script( 'aws-cba', 'https://images-na.ssl-images-amazon.com/images/G/01/cba/js/common/cba_shared.js',  array( 'jquery' ));              // For either a plugin or a theme, you can then enqueue the script:         wp_enqueue_script( 'aws-cba' );         //second script             wp_register_script( 'aws-merchant-cart', 'https://images-na.ssl-images-amazon.com/images/G/01/cba/js/shoppingcart/merchant_cart.js',  array( 'jquery' ));              // For either a plugin or a theme, you can then enqueue the script:         wp_enqueue_script( 'aws-merchant-cart' );     }     add_action( 'wp_enqueue_scripts', 'img_scripts_with_jquery' );      What coding mistake am I making here? is the enqueueing of these two external scripts in need of jQuery OK? **Update** Loading scripts in footer makes things better, but when I added the button to load the cart I still got the same error. Current script is now:               /Enqueue AWS Scripts          function img_scripts_with_jquery()     {         // Register the First Script:         wp_register_script( 'aws-cba', 'https://images-na.ssl-images-amazon.com/images/G/01/cba/js/common/cba_shared.js',  array( 'jquery' ),'version', true );              // Enqueue it:         wp_enqueue_script( 'aws-cba' );         //Register Second Script             wp_register_script( 'aws-merchant-cart', 'https://images-na.ssl-images-amazon.com/images/G/01/cba/js/shoppingcart/merchant_cart.js',  array( 'jquery' ), 'version', true);              // Enqueue this one too:         wp_enqueue_script( 'aws-merchant-cart' );     }     add_action( 'wp_enqueue_scripts', 'img_scripts_with_jquery' );      **Update II** Firebug described the error as follows:               TypeError: $ is not a function     https://images-na.ssl-images-amazon.com/images/G/01/cba/js/shoppingcart/merchant_cart.js?ver=version     Line 5      Seems like a jQuery conflict..


title: Custom Post Type Link from Plugin

text: I'm currently working on a plugin that creates a custom post type. The issue I'm strugging with at the moment is that the custom post type is created fine, but when I go to add a new post I receive an "Invalid Post Type" error. The ui is hidden and I'm trying to link to it from add_submenu_page. I need assistance for how to properly link it. Here is what I have in the submenu declaration:               add_submenu_page( 'restaurant-orders', 'Menu Management', 'Menu Management', 'manage_options', 'edit.php?post_type=menu-item');      My post type:               function restaurant_menu_items() {              $labels = array(             'name' => __('Restaurant Menu Items', 'post type general name'),             'singular_name' => __('Restaurant Menu Item', 'post type singular name'),             'add_new' => __('Add New', 'product page'),             'add_new_item' => __('Add New Menu Item'),             'edit_item' => __('Edit Menu Item'),             'new_item' => __('New Menu Item'),             'view_item' => __('View Menu Item'),             'search_items' => __('Search Menu Items'),             'not_found' =>  __('Nothing found'),             'not_found_in_trash' => __('Nothing found in Trash'),             'parent_item_colon' => ''         );              $args = array(             'labels' => $labels,             'public' => true,             'publicly_queryable' => true,             'show_ui' => false,             'query_var' => true,             'menu_icon' => get_stylesheet_directory_uri() . '/article16.png',             'rewrite' => true,             'capability_type' => 'post',             'hierarchical' => false,             'menu_position' => null,             'supports' => array('title','editor','thumbnail'),           );               register_post_type( 'menu-item' , $args );     }      I can add a new post if I show the ui and do it the conventional way. However I do not want it this way, the post menu has to be under the plugin menu. Thanks!


title: How to filter the taxonomy terms based on another taxonomy term

text: I have created a custom Post Type called "Tour" which Holds up-to five Taxonomies called "destination", "Types", "Month of Travel", "Year of Travel" and "Led by". Now I brought them as drop-down category using "wp_dropdown_categories" - (each of the taxonomy were listed as drop down). and search term works fine in the combinations (if exist). for example:: I am searching for "destination" as "Bangalore" and "Month of travel" as "June" combination works as post were chosen on particular terms. ~ it's perfect. But, when there is no post chosen for a category / no search combination avail... It triggers "No post available". ~ its a common things in word press. So I prefer to filter the TAXONOMIES based on the Previous TAXONOMIES (Its little confusing while relating them). Here is the main concept: If I choose the "destination" as "Bangalore" I need the "Type" to be filtered based on the destination. that is Bangalore can have only two types "A type and B Type" rest of the type should be ignored. - (Once again all the five thing comes as Taxonomies). I want something like this![enter image description here](http://i.stack.imgur.com/UxhAV.jpg) if post_type=tour&tour_destination=bangalore filter the other taxonomies with relevant terms? Help me ~ thanks in advance dev


title: Don't submit post if post title exists

text: I am using the `User Submitted Posts` plugin which I love. The only problem with this plugin is that it does not check for **duplicate post titles** and outputs a post with the same title, even if it already exists. **So I want to know: how can I check if someone clicks on the submit button, if a post with the same title exists and give them a`404 error`**? Is this even possible? PS: it would be even better that if the post with the same title exists, the submitted would be a comment beneath that post, but I guess that's utopia. I already tried                   if (is_null(get_page_by_title( $content['title'], OBJECT, 'post'))) {          // Do your stuff in this case (no post with the same title)          }          else {          // Do not create post          }      and               jQuery(document).ready(function($){     var titleArray = $('.row-title');     for (i=0;i<titleArray.length;i++) {             var thisTitle = $(titleArray[i]).text();             for (j=0;j<titleArray.length;j++) {                 if (thisTitle == $(titleArray[j]).text() && i < j ){                     $('input',$(titleArray[j]).parent().parent().parent()).attr('checked', true);                 }             }         }     });      But it did not do what I wanted.


title: Posts with at least 3 tags of a list of tags

text: There is a set of tags against which posts that have at least 3 of those tags should be matched. Say there is the tags {foo, bar, chocolate, mango, hammock, leaf} I would like to find all posts with at least 3 of these tags. For example, a post with tags {foo, mango, vannilla, nuts, leaf} will match it because it has {foo, mango, leaf}, so at least 3 tags from the needed set of tags. So it would be in the list of the matched posts. Is there a simple way to do that, without doing multiple loops through all the posts ?


title: Wordpress : Cannot Get User id after login success in file wp_login.php

text: I have a problem when I want to get user id WordPress after login in file `wp_login.php`, I tried to insert some code in this file, after line `wp_safe_redirect($redirect_to);` in login case. I must get user id after login to update my custom WordPress table.               session_start();     require( dirname(__FILE__) . '/wp-load.php' );     global $wpdb;          $session_id     = session_id();      $current_user   = wp_get_current_user();     $id_user        = $current_user->ID;          $wpdb->query(          $wpdb->prepare("UPDATE wp_shortlist SET id_user='$id_user' WHERE id_session='$session_id' ")     );      any idea to get user id after login in file `wp_login.php`?


title: Wordpress admin panel is blank

text: When i logged in wordpress admin, the dashboard looks a blank page. Only left side navigations are visible. What might be the problem? Can any one me give solution or idea?


title: How do I export my WordPress blog as a book?

text: I want to export some or all of the posts of a blog into a format that makes sense to a publisher (traditional or self-publisher(e.g.: Lulu.com)) (MS Word, RTF, PDF, epub, something else). What tools are available to accomplish this?


title: Max number of multisites

text: Does anyone know of any max number of WP multisites or performance issues with having many? Thanks!


title: How to let users choose posts order in categories?

text: Hi to all I'm running a wordpress based website and I need to let the users choose how to show the posts inside categories pages. I would like to have a button inside a category page that can be clicked so the reader can choose if he wants to see posts ordered by date or from A to Z or from Z to A. Is there anyone who can tell me how to achieve this? Please explain it like if you are speaking to your 12 years son :-) I google a lot about this and I've never found nothing that I can copy/paste into my code or that I can modify. I can't understand how to do this... any solution?


title: Use wp_list_categories to list parent categories from actual term

text: I currently have a taxonomy called wpsc_product_category. Under that taxonomy I have several terms used as sub-categories, and finally each sub-category has a number of products. I'm trying to use wp_list_categories to show an ul starting from the parent category of the current product your are viewing. ¿Is this possible?               <?php              $taxonomy     = 'wpsc_product_category';     $orderby      = 'name';      $show_count   = 0;      // 1 for yes, 0 for no     $pad_counts   = 0;      // 1 for yes, 0 for no     $hierarchical = 1;      // 1 for yes, 0 for no     $title        = '';     $child_of     = $actualcategoryparentid          $args = array(       'taxonomy'     => $taxonomy,       'orderby'      => $orderby,       'show_count'   => $show_count,       'pad_counts'   => $pad_counts,       'hierarchical' => $hierarchical,       'title_li'     => $title       'child_of'     => $child_of     );     ?>          <ul>     <?php wp_list_categories( $args ); ?>     </ul>      I thought of something like this, but I don't know how to retrieve $actualcategoryparentid. Any ideas? Thanks!


title: Help integrating Custom post type meta field with custom profile fields

text: I have a custom post type for "locations" and I need to have "users" log in and be able to pick a location that is within a certain distance from them. I have added some spots to the profile using update_contact_methods() to get an address etc, and the location custom post type I am using the Custom- Metaboxes-and-Fields-for-WordPress to add specific fields for address information etc. I am simply not sure of how to achieve what I need to and am hoping for some input. I need to get it working quickly so I am more concerned with at least a proof- of-concept approach then the most performant. My initial thought was to use Google Maps API distance matrix, https://developers.google.com/maps/documentation/javascript/distancematrix but I am not sure if that is a good way to go... A thought was to have a page that is clickable once user is logged in, that would, upon navigating to it, would need to iterate through each "location" custom post and compare its address as destination and the logged in users address (pulled from profile) as origin, and discard the post if > (greater than) x hours. Does that make sense? I would really appreciate any help you all may have to give, I have confused myself into a corner. Thank you!


title: Shortcode: display list of created shortcode in popup

text: I want to create a popup shortcode in admin panel. I already create the shortcode button and a popup on button click. I want to display in the popup (not in the shortcode button), all my custom shortcodes that I have created in a dropdown list. I really don't know how to get my shortcodes name with a loop like this for example:               <tbody>     <select id="shortcode-generator-select">     <option value="raw"></option>     <?php foreach( $shortcode as $shortcode ) : ?>     <option value="<?php echo $shortcode['name']; ?>"><?php echo $shortcode['title']; ?>    </option>     <?php endforeach; ?>     </select>     </tbody>       I just want to understand what is the way to create a popup shortcode generator.


title: All blog posts are not showing up

text: This post may already exists but I just missed it in how I searched for it. Here goes. I have recently changed my blog back to the Genesis Framework. I am using the Nameless child theme. These are my issues:   1. The only way the front page shows up correctly is for me to select "Show latest posts" in the Settings---->Reading section   2. Only my posts are showing up and not those of the other authors. I created a page called "Blog" and entered the code below, but it still only shows my posts. My template file:               <?php     /*     Template Name: Blog     */     get_header();          $args = array(         'post_type' => 'any', #all post types         'posts_per_page' => 10 #get 10 posts     );     $query = new WP_Query( $args );     if($query->have_posts()):       while($query->have_posts()):         $query->the_post();         the_title(); #display the title       endwhile;     endif;          get_footer();      In the author box I see where different authors can be chosen by the post, but I need all posts by all authors showing up in the listing. Any help would be greatly appreciated. Here is a link to my site, if that helps: http://fullfigureplus.com


title: Proper way to add a button to the top menu of the media library?

text: I want to add a simple button to the Media Library top menu (say, to the right of the bulk actions / filters dropdowns. I have scoured the WordPress codex for a proper way to do this and have found nothing useful. So before I start attacking this problem with Javascript, I wanted to ask the community if there's a proper WordPress API way of doing this - along the lines of `manage_media_columns` and `manage_media_custom_column`. Thanks everyone!


I have a plugin which throws the error "Warning: Variable passed to each() is not an array or object in /...../wp-content/plugins/page-scroll-to-id/malihu- pagescroll2id.php on line 174" and at line 174, it says               `   while(list($var, $val)=each($pl_instances)){                     add_settings_section(                         $this->db_prefix.'settings_section'.$this->index,                         null,                         '__return_false', // instead of null to avoid wp <3.4.1 warnings (https://core.trac.wordpress.org/ticket/21630)                         $this->plugin_slug                     );`      The plugin is not modified, i did google on the error, but found nothing. I am new to php. so don't know much what's going in the code that is showing error.


title: How to add data from wordpress tables to new database tables you have created

text: I'm just learning this database stuff and so I am a bit confused and was hoping someone could push me in the right direction. I have managed to create users in the wp_tables I have created in my database. ![enter image description here](http://i.stack.imgur.com/0lLCY.png) Here are my specific questions.   1. What I am wondering is how do I link the hm_tables with data from the wp_tables. Wouldn't I need to insert a foreign key (i.e email address from wp_users) into the hm_tables. Because, otherwise I won't know which hm_account is linked to which wp_user? Is this dumb? And if so, HOW?   2. Also, I have become familiar with using WPDB commands, but when playing around with the hm_tables can I use $wpdb or do I need to use straight SQL commands.  Can you please give explicit instructions or examples as I get very lost at this early stage. I have read around but can't seem to find something that explains this at a level I can understand (which at this stage is quite low).


title: Get custom posts with certain ids in a custom loop using a shortcode

text: So I'm using custom loop and shortcode to insert it in any page. Like this:               function register_custom_shortcode($atts){              extract(shortcode_atts(array(             'ids' => '', // this is what I need             ), $atts));              $cutom_loop = new WP_Query( array(              'post_type' => 'cutom_post',             'orderby' => 'menu_order',             'order' => 'ASC'             ) );              ob_start();                   while ( $cutom_loop->have_posts() ) : $cutom_loop->the_post(); ?>              <article id="post-<?php the_ID(); ?>" <?php post_class(''); ?>>              // post thumb, title and so on              </article>              <?php endwhile;                   wp_reset_postdata();         $content = ob_get_contents();         ob_end_clean();         return $content;     }          add_shortcode( 'custom_loop', 'register_custom_shortcode' );      How shoud I handle this ids to have shortcode like this: `[custom_loop ids="112,93,34,91"]`? **EDIT:** Ok, if i add `'post__in' => array(189,173)` to new WP_Query it will output only this two posts, but still can't figure out how to grab this ids from shortcode.


title: How do you store options with a:n:{{}} syntax in wp_options?

text: I'm checking out how a particular plugin works and noticed that it stores its data for option_value in wp_options in this array format... **a:2:{i:20;a:2:{s:8:"original";s:15:"20.original.jpg";s:9:"thumbnail";s:12:"20.thumb.jpg";}i:8;a:2:{s:8:"original";s:14:"8.original.png";s:9:"thumbnail";s:11:"8.thumb.png";}}** I like this method, since it only uses a single row to hold my custom data, uninstall cleanup is easy. Is there a standard way to do a get/set operation on a custom field that results in this syntax? Update: Thanks to Denis and the others who've added responses. Here's an excellent tutorial on this method in case anyone else has this question > http://striderweb.com/nerdaphernalia/2008/07/consolidate-options- with-arrays/


title: How to exclude content (and other returned values) from WP_query()?

text: Does a method exist that can return a simple array of the pages in the site that are published? I only want the name and the slug returned, not the full content or other default values. I've tried WP_query(), get_posts(), get_pages() and query_posts() but they all return the post/page content. I'm only looking to get the post name and slug returned. If there's no lighter method, I can use one of these. Just want to make sure. Any help, much appreciated.


title: Where is the logic that defines the excerpt?

text: I'm trying to learn HOW to learn about WordPress by following its source code etc. I'm really stumped at the_excerpt(). Documentation states that the_excerpt uses get_the_excerpt(), and will return either the (manual) excerpt, or will use the first 55 characters of the_content. I'm interested in the logic that looks first for the manual excerpt and then decides whether it needs to go in and extract a substring from the post content. But I can't find it. In post-template.php, we see the_excerpt() and get_the_excerpt() defined. the_excerpt() does nothing more than echo out get_the_excerpt():               249 function the_excerpt() {     250         echo apply_filters('the_excerpt', get_the_excerpt());     251 }      get_the_excerpt() seems to do nothing more than grab the post_excerpt column from the wp_post table:               261 function get_the_excerpt( $deprecated = '' ) {     262         if ( !empty( $deprecated ) )     263                 _deprecated_argument( __FUNCTION__, '2.3' );     264      265         global $post;     266         $output = $post->post_excerpt;     267         if ( post_password_required($post) ) {     268                 $output = __('There is no excerpt because this is a protected post.');     269                 return $output;     270         }     271      272         return apply_filters('get_the_excerpt', $output);     273 }      I don't see where the logic to grab $post->post_content resides. Is it in the filters? I can't see those filters defined anywhere, but this may be because I just don't know where to look. A cursory glance at Adam Brown's source code search site doesn't seem to be turning up any definitions either. Can someone help me pick up the thread and figure this out? Remember, I'm more interested in how to figure it out than I am in the actual answer. I appreciate everyone's input. Tom


title: How to open a lightbox form from a navigation menu item

text:
I want to add a custom menu item to the main navigation menu, On clicking this item I want to open a lightbox form. I have the form-shortcode ready to be placed but on a page but I don't know how to do this in the main navigation menu, i have used cforms-II for the form and lightbox form to display it in lightbox modal. please help. i'm using wordpress 3.5 Note: I may need to change my theme in recent future so I would like the solution to programtically do this.Thanks. Edit: I'm trying to use the following code: `add_filter()` to add menu item, and for light box form i have this code:               add_filter( 'wp_nav_menu_items', 'my_custom_menu_item', 10, 2 );          function my_custom_menu_item ( $items, $args ) {         if (is_single() && $args->theme_location == 'primary') {             $items .= '
Show whatever
';         }         return $items;     }          [formlightbox_call title="Get free quote" class="4"]here[/formlightbox_call]     [formlightbox_obj id="4" style="padding: 10px; width:350px"][contact-form-7 id="848" title="Contact form 1"][/formlightbox_obj]


title: Adding short codes from a page's content on header and hiding the same from page's content

text: I have created a page and added the following shortcode from wp-orbit-slider                [orbit-slider category="test"]       I want the contents of                [orbit-slider category="test"]       be displayed on the header part, instead of on the content area part, which the wordpress usually does . I tried adding the the short code on header.php and it works, but the same content will be duplicated on the content area also. I need to avoid this. How can this be achieved ?


title: Add button to TinyMCE bar without creating a plugin

text: I'm trying to add a custom button or two to the TinyMCE rich text editor. The tutorials I've seen so far are either outdated or explain how to do it with a custom plugin. How can I do this without creating a plugin, perhaps in the `functions.php` file instead? To be specific, I want to add a "h2" button that will add in a `<h2></h2>` into the body.


title: Updating a live theme safely?

text: Apologies for the general question, but I spent some time looking for an answer and couldn't find anything. I often find myself in a situation where I need to make tweaks to a live site based on a client's feedback after going live, so I'm wondering the best way to quickly make changes on the live site without disruption. Presumably it's possible to duplicate the live theme, rename it in style.css so that it's considered a 'new' theme yet still uses the same database etc. and then work on that? The question is, how would I view that new theme and then switch to it once all updates are done? One day, I'll need to get my head around GIT as from what I've heard that would solve this kind of problem in a very safe way.


title: Register widget only page is a singular of custom post type

text: I've made a custom post type, with a few accompanying widgets, and I was wondering if it is possible to show (some of) these widgets only if you're on a specific page. Currently I've got               function widget($args, $instance)     {         global $post;         $links = unserialize(get_post_meta( $post->ID, 'links', true ));              if(!is_singular( 'press_articles' ) || $links == false) {             unregister_widget( 'Point72_Press_Article_Links_Widget' );             return false;         }              // widget stuff     }      But, that doesn't seem to completely remove it, and with that I mean, it removes the widget in the right places, but the positions for the widgets stay even if it's not empty. So, is there anyway to either remove the empty positions, or not show it at all outside a custom post type?


title: Warnings in nav-menu when visiting query pages

text: Using query-wrangler, similar to drupal's views, I created some query pages. When I visit these pages, in the top-navigation-menu there is this warning:               Warning: in_array() expects parameter 2 to be array, null given in /.../wp-includes/nav-menu-template.php on line 425      The line cited by the warning is inside the ancestral post object wich I fully report here:               // ancestral post object     (         'post_type' == $parent_item->type &&         ! empty( $queried_object->post_type ) &&         is_post_type_hierarchical( $queried_object->post_type ) &&         in_array( $parent_item->object_id, $queried_object->ancestors ) &&         $parent_item->object != $queried_object->ID     ) ||      Line 425 is the one starting with `in_array(` The top-navigation-menu items are not related with the query pages. Are simple pages, some of them childpages. I really don't know how to fix this warning, because I don't understand to what is related.


title: Check if taxonomy is attached to at least one post in a post-type

text: To check if at least one post in post-type `products` has the `led` term I usually do this:               $query = array('numberposts' => 1, 'post_type' => array('products'), 'television' => 'led');     $products = get_posts($query);          if ($products) {     echo 'At least one post has the term led';     } else {     echo 'No post with the term led';     }      Is there a better way?


title: how can i display all youtube videos from a users youtube account

text: I want to display all recently uploaded youtube videos from my youtube account as a widget on the right side of the page. Just like how technobuffalo.com has done. Is there such a plugin that will do this? ps: as for what I've tried, i have searched on wordpresses plugin pages and all i see are plugins that allow me to add a short code for the video as a post. But this isnt what i want. I just want to display all recently uploaded videos automatically on the right side just like technobuffalo.


title: archive-{post_type}.php is defaulting to category.php vs. archive.php on category searches

text: I am using `archive-{post_type}.php` for queries of a custom post type. I want the system to use `archive.php` for category searches but it is defaulting to `category.php` which I am using for category searches (different categories) for regular posts. Does anyone have an idea of what could be going wrong?


title: Create thumbs only when a post is sticky or any other way?

text: I have a slider and I want to create thumb of specific sizes for my slider but only when the post post is sticky or if there is any other way so it won't create all these sizes I set for the slider for all the posts?


title: How can I show errors in the "Add Media" iframe?

text: I've added a custom field to the "Add Media" form using `add_filter('attachment_fields_to_edit', ...)` and I'm validating the existence of it when saving the attachment fields using `add_filter('attachment_fields_to_save', ...)` but I can't figure out how to get the form to show the error and prevent any further actions. Basically I want the error to show below the input field when the user presses "Insert into Post," "Save All Changes," or "Use as featured image," and I don't want the subsequent action to be executed. How can I accomplish this? Thanks in advance.


title: Multiple post types for BuddyBlog plugin

text: Hello can anybody help me to return "multiple" Custom Post Types in this snippet? I would like to use 3-5 other custom post types and I can't get it work. The snippet above for ONE custom post type works, the snippet below for multiple custom post types doesn't.               add_filter( 'buddyblog_get_post_type', 'buddyblog_my_post_type' );     function buddyblog_my_post_type( $post_type ) {         return 'portfolio';     }      I have tried this and several other snippets without a success:               add_filter( 'buddyblog_get_post_type', 'buddyblog_my_post_type' );     function buddyblog_my_post_type( $array ) {         $array = array( 'post','portfolio' );         return $array;     }


title: AJAX issue - Uncaught SyntaxError when processing Zip File

text: I'm creating an application that will allow a user to fill out a form and then have a customized zip file downloaded for them upon submit. I'm utilizing AJAX to accomplish this task.                   Build.prototype.ajaxHandler = function(method, values) {             jQuery.ajax({                 type: 'POST',                 url: WP_LOCALIZED['url'],                 data: {                     action:     'request_handler',                     method:     method,                     data:       values                 }, success: function(data) {                     var response = jQuery.parseJSON(data);                     console.log(response);                      }, error: function(XMLHttpRequest, textStatus, errorThrown) {                     console.log(XMLHttpRequest, textStatus, errorThrown);                 }             });         };      Whenever I try to return basic data with my ajax handler I am able to successfully return without issue, but when I try to process my zip file method I consistently get `Uncaught SyntaxError: Unexpected token <` even though the `zip_file()` method is not actually returning any data back to the javascript method.               /**      * AJAX handler      *       * @return {json}      * @since 1.0      */     public function request_handler()     {              $post = $_POST;         $data = $post['data'];              // If this wasn't here it would return my $data variable         $this->zip_file();              die(json_encode($data));     }      I've also tested the `zip_file()` method on its own by placing it in the `init()` function and it runs just as I would expect it to without issue.               /**      * Create Zip File      *       * @return void      * @since 1.0      */         public function zip_file()     {         $zip = new ZipArchive;              if($zip->open('test.zip', ZipArchive::CREATE) === TRUE) {             if($zip->addEmptyDir($this->_plugin_path . 'assets/temp_files')) {                 // Do stuff             }             $zip->close();         }              header('Content-Type: application/zip');         header('Content-disposition: attachment; filename=filename.zip');         header('Content-Length: ' . filesize($zip));         readfile($zip);     }      Interestingly the same thing happens if I replace the `$this->zip_file()` call with just a basic `echo` statement. Except instead of telling me the `Unexpected token` is `<` it says `e` instead. I think I'm misunderstanding something fundamental about the way these two interact together, but so far have not been able to locate any information on what that may be. Any help would be appreciated.


title: use advance custom field inside query post command

text:
I can't find a solutions in internet or advance custom field website docs about this. I hope wordpress genius can help me. I use http://wordpress.org/extend/plugins/advanced-custom-fields/ for themes options/function. I want to show category post in homepage using category name. here is my code:

<?php the_field('cat_1'); ?>

         <?php query_posts('category_name=<?php the_field('cat_1_name'); ?>','showposts=5'); ?>         <?php if (have_posts()): while (have_posts()) : the_post(); ?>
             <li id="post-<?php the_ID(); ?>" <?php post_class(); ?>>                 <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?>

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

<?php _e( 'Sorry, nothing to display.', 'fileketchup' ); ?>

                      <?php endif; ?>         <?php wp_reset_query() ?>

<a href="<?php echo home_url(); ?>/<?php the_field('view_cat1'); ?>">View more

           Please check `<?php query_posts('category_name=<?php the_field('cat_1_name'); ?>','showposts=5'); ?>` this... Here I use advance custom field meta insert of category name.. but its show error... How I solve this?? If I use **('category_name=blog','showposts=5')** then its works.


title: Why is WordPress redirecting users to random posts after commenting?

text: After commenting on one of my posts, WordPress redirects me to another random post. Only after, when checking the previous post, I can see that my comment was posted. Still, why is WordPress sending me to a random post after commenting? Here's my comments.php file and here's my website (please don't publish it anywhere else, as I'm launching it tomorrow). Feel free to test the comments, though. I'll clear then before I launch it. Any suggestions? PS: I'm using no plugins and the bug doesn't work on other themes. Also, I'm using pretty `/%postname%/` permalinks.


title: Is a no RSS plugin setup supposed to work?

text: I'm using WP 3.1.2 as provided by Awardspace, a free hosting service. I haven't made any configuration regarding RSS but it seems to work on Google Reader. However, pictures and flash elements won't appear. Is this normal? Should I get a plugin then? Thanks in advance - Victor.


title: Wordpress multisite causing Error 101 (net::ERR_CONNECTION_RESET): Unknown error

text: > **Possible Duplicate:**   >  WordPress upgrade now receiving Error 101 (net::ERR_CONNECTION_RESET): > Unknown error We have just installed WordPress 3.0.1 and everything worked fine. However, as soon as we started to install the multisite functionality by following this tutorial, things started to go wrong. At the end of step 5, the tutorial has you update your wp-config.php file and .htaccess file. Once we made the reccommended changes to these files, uploaded them back to the server and tried to re-log in, none of the pages would serve up anymore. We now get the following error for ALL pages in the blog:               Error 101 (net::ERR_CONNECTION_RESET): Unknown error.      Any ideas? Here are the code changes we made (following the sub-folder setup): wp-config.php               define( 'MULTISITE', true );     define( 'SUBDOMAIN_INSTALL', false );     $base = '/';     define( 'DOMAIN_CURRENT_SITE', 'oursite.com' );     define( 'PATH_CURRENT_SITE', '/' );     define( 'SITE_ID_CURRENT_SITE', 1 );     define( 'BLOG_ID_CURRENT_SITE', 1 );      .htaccces file (in wordpress root directory)               # BEGIN WordPress     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]          # uploaded files     RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]          # add a trailing slash to /wp-admin     RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]          RewriteCond %{REQUEST_FILENAME} -f [OR]     RewriteCond %{REQUEST_FILENAME} -d     RewriteRule ^ - [L]     RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]     RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]     RewriteRule . index.php [L]     # END WordPress


title: Wordpress sub-posts and permalinks

text: I'm thinking about one problem... There is a set of regular posts. Just posts in categories. I need to add for some of them a sort of subposts, posts which will be related to parent-post. This issue can be solved by adding meta_box to edit post page. (any better ideas?) Another problem is about permalink of this sub-post. If parent-post have permalink like this http://blabla.com/simple-post/ then i need sub-post with permalink like this http://blabla.com/simple-post/little-sub-post/ How can i deal with this?


title: Multiple Loops Breaking Pages

text:
I'm new to WordPress, and I'm having an issue with "The Loop." I have a sidebar on the left side of a page that's supposed to show recent posts from two categories. In the middle of the page, there should be content for that specific page. In the right column, there should be posts for a specific category. Here's the problem: When I set up the left column, the middle column shows the posts content instead of the pages. See http://opachicago.com/wp/ if that doesn't make sense. Here's my Loop codes: Left Column (which should show Latest Posts):               <?php query_posts('category_name=News and Events, Uncategorized&showposts=5'); ?>     <?php if (have_posts()) : ?>         <?php while (have_posts()) : the_post(); ?>
<?php the_time('M j') ?>: <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?>
         <?php endwhile; ?>     <?php endif; ?>      Middle Column (which should show Page content):               <?php if (have_posts()) : ?>     <?php while (have_posts()) : the_post(); ?>         <?php the_content(); ?>     <?php endwhile; ?>


title: Resizing old post thumbnail images

text: In my `functions.php` I have defined the following:               add_theme_support( 'post-thumbnails' );     set_post_thumbnail_size( 475, 475, true );      I have used the **Regenerate Thumbnails** plugin to regenerate the thumbnails. When calling `<?php the_post_thumbnail(); ?>`, the images do not look cropped. When checking my uploads folder I do not see any thumbnails set for 475x475. Thoughts?


title: Extending Class in Custom-Metaboxes-and-Fields-for-WordPress

text: Custom-Metaboxes-and-Fields-for-WordPress is a great custom meta box script as it is, and even allows for adding new field types within their code. However, I want to create a new field type similar to the address field example they show, but uses the file field in it as well. In other words a field grouping, with a file upload. I can't seem to get this to work as the new field group saves the data in an array ( serialized data ) and the file upload saves the data in an array as well. One won't allow the other for some reason. I will continue to tinker with this, but if anyone knows how to do this, please let me know. Thanks!


title: Read More link scrolling page

text: I'm creating a theme, and I want to prevent the page from being scrolled when a user clicks 'Read More' and the code given in the Wordpress Codex is not helping me at all. My `functions.php` is exactly the same as the snippet in the Codex and the relevant line of my `index.php` is: `<div class="content"><p><?php the_content(__('Read More')); ?></p></div>` Edit: I have a new, weird bug: the content of the Codex snippet is being shown as raw HTML in my blog and admin pages.


title: WordPress plugin overloading with tmp tables

text: I have asked at the plugin's (WordPress Popular Posts) support a few days ago, since no response hope to get some insight or help here. Thanks. Hesitant to tweak settings like `max_heap_table_size` & `tmp_table_size` because kind of (naively?) hoping that such a popular plugin has a way of managing load. On a rather popular site on a VPS the host is asking us to investigate constant, frequent tmp writes that is increasing server load. Any ideas on how to manage / decrease these? Example:               Copying to tmp table | SELECT p.ID AS 'id', p.post_title AS 'title', p.post_date AS 'date', p.post_author AS 'uid' , ( IFNULL(v.pageviews, 0)/(IF ( DATEDIFF('2013-02-25 12:07:23', MIN(v.day)) > 0, DATEDIFF('2013-02-25 12:07:23', MIN(v.day)), 1) )) AS 'avg_views' FROM XXXXXX_posts p LEFT JOIN (SELECT id, SUM(pageviews) AS 'pageviews', day FROM (SELECT id, pageviews, day FROM XXXXXX_popularpostsdatacache WHERE day > DATE_SUB('2013-02-25 12:07:23', INTERVAL 1 WEEK) ORDER BY day) sv GROUP BY id) v ON p.ID = v.id WHERE p.post_status = 'publish' AND p.post_password = '' AND p.post_type IN('post','page') GROUP BY p.ID HAVING avg_views > 0.0000 ORDER BY avg_views DESC LIMIT 5 |


title: wp_query orderby random do not repeat infinite scroll - one loop

text: I have found a lot of documentation on solving this issue with multiple loops, I'm finding it hard to see a solution for one custom loop. Problem: I'm using infinite scroll to load in the next page of posts to the homepage. The posts need to be shown in a random order so I need to store which posts have been shown and then exclude them the second time the query is hit.               <?php $my_query = new WP_Query(array('post__not_in'=> $do_not_duplicate,                              'orderby' => 'rand',                             'category_name' => 'projects',                              'posts_per_page' => 20,                              'paged' => $paged));     while ($my_query->have_posts()) : $my_query->the_post();     $do_not_duplicate = $post->ID; ?>          <?php get_template_part( 'entry' ); ?>     <?php endwhile; ?>      I have built this from http://codex.wordpress.org/The_Loop#Multiple_Loops_in_Action \- however the approach there is to use `$do_not_duplicate` in the second loop. Perhaps I need to shuffle this around a bit, store the posts shown in another way, a cookie? Any guidance appreciated.


title: Showing all the posts in one page?

text: There are over 200 posts tagged with the keyword "Apple." Each tag page -- example.com/tag/apple/page/2/ -- shows 10 posts. So there are 20 tag pages. Is it possible to show all these 200 post (links) in one page? I don't want to show any of the excerpt -- just consolidate all those 200 links in one page. Appreciate your help!


title: Are WordPress Heartbeat API 'beats' staggered or do they occur simultaneously for all users?

text: The WordPress Heartbeat API uses admin-ajax.php to run AJAX calls. If User X leaves their browser open, many calls will be made to the server, with each call happening when there is a 'beat'. Now if User Y leaves their browser open, many more calls will be made to the server, with each of these calls happening when there is a 'beat'. It's possible a large website will also have User A, User B and User C all do the same. **My question:** Considering lots of users might access a website simultaneously, are WordPress Heartbeat API 'beats' staggered (the 'beat' for User X happens a few seconds before the 'beat' for User Y) or does a 'beat' occur at exactly the same time for all users? If 'beats' aren't staggered, my concern is a very heavy load on the server at the point when a 'beat' occurs.


title: I am trying to install a site that a larger organization sent me, where do I start?

text: I have the zip file with everything in it, but there's just not a simple way to "run"? What all do I need? Do I need my own server or should they have their own?


title: Remove the deleted user comment

text: ## Problem I have a user based site, so when user **deletes** his profile somehow his/her comments stay visible. There is no name and blank avatar with the comment. Is there any way to delete the comments of a user if the user deletes his/her profile and how? Is there a function of somehow? This really is a strange problem.


title: Plugins missing in front end but appear in backend FTP

text: So, I'm working with the Advanced Access Manager and then the W3 Total Cache plugins and all of a sudden WHOOPS, there's a problem. First last night: After setting up W3 Total Cache, and then playing with it a bit, I broke the site. I couldn't go to my wp-admin page to login. All it would do was complain about lines in the pluggable.php & wp-login.php. Now today: So I'm back at it after a good break hoping to be able to fix it with fresh eyes. Great! The pluggable.php error has been fixed. Now in the process of trying to install w3 total cache again, it's randomly complaining about some lines in wp-login.php so I replace my newer wp-login.php file with an older one from a back up and it's fine, however now after some testing and renaming the plugin folder in FTP something different and then back to plugins it's not actually activating ANY plugins and I have no active plugins in my wordpress plugins section...but they are all there in my FTP. The older wp-login.phph file is of the same site, same login admin credentials and same login info. So now why, as an administrator, I can see any plugins on the front end when they are ALL there in the FTP back end? Any suggestion as to how to go about this?


title: Plugin recommendation - posting to Social Networking sites

text: I know there are a lot of Social Networking plugins around, so I thought I'd ask for some recommendations. When writing a new post in the admin area (standard post type), I'd like the option to post it (the excerpt and a link, for instance) to my Facebook and Twitter accounts. I'm not referring to buttons on the front-end for my users to share on their profiles. Does such a plugin exist?


title: Number of posts per page setting is not working?

text:
OK, here's my prob. I have static homepage and a separate posts page on my wordpress site. I have defined the two in the admin panel. Now, I have also set the max number of posts to be displayed to 5(in settings> reading), but all the posts(10+) are still being displayed on the blog page. I'm also displaying the latest 3 posts on the static homepage using a custom query. i.e               $wp_query = new WP_Query( array( 'posts_per_page' =>3));          <results loop code>      But this list also is displaying more than 3 posts.It seems wordpress is ignoring the posts_per_page limit I set whether I do it at the admin panel or through code. What the hell is going on? This is my 1st time using wordpress for developing a site. Is this a common problem for noobs? **EDIT:** I just stripped the static homepage bare and left a basic code block that simply fetches titles of the posts. More than 3 posts are still being returned. Here is the actual(and only) code currently in the homepage:
            <?php $wp_query = new WP_Query( array( 'posts_per_page' => 3) );?>            <?php if ( $wp_query->have_posts() ) : ?>
         <?php while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
           <a href="<?php the_permalink() ?>"><?php the_title(); ?>
         <?php endwhile;?>
       <?php endif; ?>


title: Serious social interaction

text: I have an old blog... 25 posts on wp 2.6. good content, valuable information, right to the point. I am about to update the blog and the posts. Make the posts more up-to-date (there are some 3 years old, and still new!) and repost it to media sites and create a buzz around this really good information. So the question is... What, if you build a new site TODAY (wp 3.3) and have good content to post... over the years... what will be your strategy/plugin/toolbox to get the info OUT THERE... I have tried wordbooker (to publish on facebook) which is always broken... and really bad to use... I have heard of dlvr.it, which seems promising. Twitter feed auto publish and anything and everything. I would like to know the basic plugin toolset to get the info into the social media and rate good on : http://marketing.grader.com/ I would like to know your experience, your success, your fails... and the good news is, I will apply it RIGHT NOW