title: How to change default post type / post to media or attachments

text: Im using wordpress 3.1.1, in frontpage i need to display only the media uploads, now im using this acction:               add_action( 'parse_query', 'custom_query' );          function custom_query( &$query ) {            $query->set( 'post_type', array('attachment') );          }      add_filter( 'pre_get_posts', 'my_get_posts' ); function my_get_posts( &$query ) {                 if ( is_home() || is_frontpage() ) {              $query->set( 'post_status', 'inherit' );         $query->set( 'post_type', 'attachment' );            }                 return $query;          }      But doesnt work. Any help is working.


title: switch a theme different per user role

text: I plan to use the member plugin by Justin Tadlock I wish to know if how could I, on the front side, auto switch to a theme according to a role status.. for example authors would have the site presented using theme 1 while editor would have the site presenter using theme 2 I would rather have 2 different theme rather than conditionals within one theme structure Thank you in advance


title: WordPress MySQL & PHP Performance

text: have a website (www.americanbankingnews.com) that gets 40,000-50,000 page views today. It's currently sitting on a dedicated quad-core Xeon server with 8GB of ram. The site is powered by WordPress and MySQL (sitting on the same server) and I'm currently using W3 Total Cache for page and MySQL query Caching. Unfortunately, that doesn't seem to be enough. During peak traffic times, my servers are getting a few HTTP 500 errors and pages that aren't cached load slowly. I'm currently not using Xcache or any other PHP cache/acceleration tools. Are there additional steps that I should take to try to optimize MySQL and PHP performance? Or should I fork over for an additional server. Specifically, I'd be interested in additional suggestions to improve MySQL performance and whether or not tools like xcache might help in this situation


title: Long Waiting Times on GoDaddy?

text: I prefer not to use GoDaddy because I always encounter performance issues. However, one of my clients is rather insistent on using them... so we are. I've tested this with a vanilla Wordpress 3.0+ install with no active plugins, but it always seems to happen for me: Whenever a new page/post is called by the browser, we encounter 3-10 second "waiting" times. ![enter image description here](http://i.stack.imgur.com/pFz28.png) I don't have this problem on any non-godaddy wordpress installs (they nearly always get their pages in queue in under 2 seconds). But all my Godaddy installs exhibit this behavior. Is anyone familiar with this issue?


title: defining a folder location in order to recall it

text: I'm creating a child theme off of wp-framework and in it's header it uses               <?php echo IMAGES . '/favicon.ico'; ?>      to recall the folder where images are kept. How do I define or create the location in order to recall it using echo IMAGES? and if I can save the image folder location as IMAGES (If I recall it's a string?) can I do the same with other information?


title: Allowed Memory Size Error in WordPress

text: My WordPress is always down. I contacted my host and they said that the server is fine. My WordPress site has some basic plugins which are   1. all in one seo   2. seo search tagging   3. google xml   4. robots.txt   5. related post I can't find what is my problem. I have some HTML files which are working fine, but my Wordpress site is not working. I think the issue is with Wordpress. Do I need to reinstall Wordpress to fix the issue? Thanks. I have this error in error_log. I think it is a memory problem. > `[28-Apr-2011 13:32:20] PHP Fatal error: Allowed memory size of 33554432 > bytes exhausted (tried to allocate 82 bytes`


title: Remove classes from body_class

text: I don't need this whole mess of classes like this... `<body class="page page-id-829 page-template page-template-page-template- portfolio-php portfolio">` I'd like something like this... `<body class="portfolio">` Is there a filter snippet somewhere that has a list of all the classes and I can then just uncomment the stuff I don't want to see in the body class. Thanks.


title: Custom Post Type pagination when CPT 'rewrite' rule and a page have the same slug

text: I would like to achive the following link structure on my site:   1. /properties/ -> a `properties` page with `properties` CPT, page 1.   2. /properties/page/2 -> a `properties` page with `properties` CPT, page 2.   3. /properties/property-name -> a single `properties` page with a property details.       I have a Custom Post Type (CPT) called `property`. It's registered as following with the `rewrite` rule specified as `'rewrite' => array('slug' => 'properties', 'with_front' => false)`:               function property_post_type_init() {       $labels = array(         'name' => _x('Properties', 'post type general name'),         'singular_name' => _x('Property', 'post type singular name'),         'add_new' => _x('Add New', 'property')       );       $args = array(         'labels' => $labels,         'public' => true,         'publicly_queryable' => true,         'show_ui' => true,         'rewrite' => array('slug' => 'properties', 'with_front' => false),         'query_var' => true,         'capability_type' => 'post',         'hierarchical' => false,         'show_in_nav_menus' => false,         'menu_position' => 5,         'supports' => array(           'title',           'editor',           'revisions'         )       );       register_post_type('property',$args);      I also have a page with the slug `properties` and the permalink structure is set as `/%category%/%postname%/` On the `Properties` page I construct a new `WP_Query` object with the following arguments:               $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;     $args = array(         'post_type' => 'property',         'orderby' => 'date',         'order' => 'DESC',         'paged' => $paged     );     return $args;      I use a custom pagination code (in functions.php) which generates pagination correctly with the correct urls:               <my-site>/properties/     <my-site>/properties/page/2/     <my-site>/properties/page/3/      However, when I click on any page in the pagination I get redirected to 404 page. I've expected the query params and they are the following:               [page] => 2     [property] => page     [post_type] => property     [name] => page      Which is not correct! I don't understand where these parameters are coming from:               [page] => 2     [property] => page     [name] => page      I'm sure it's something to do with the `rewrite` rule when registering a CPT. How can I achive the following set up to work correctly:   1. A `properties` page that displays all `properties` custom post types posts with pagination.   2. A `properties` custom post type with `'rewrite' => array('slug' => 'properties', 'with_front' => false)` rule.   3. Permalink of `/%category%/%postname%/` structure So that I have the following link structure:   1. /properties/ -> a `properties` page with `properties` CPT, page 1.   2. /properties/page/2 -> a `properties` page with `properties` CPT, page 2.   3. /properties/property-name -> a single `properties` page with a property details. Hope that makes sense. Thanks, Dasha


title: Can my hooked uninstall class function access a global var declared in main plugin file?

text: My current setup is as follows... In the main plugin file, these two hooks are set (not inside any class):               register_activation_hook(__FILE__, array('DG_Setup', 'activation'));     register_uninstall_hook(__FILE__, array('DG_Setup', 'uninstall'));      This same main file includes the file containing `DG_Setup`:               include_once DG_PATH . 'inc/class-setup.php';      And declares `$dg_options`:               define('DG_OPTION_NAME', 'document_gallery');     $dg_options = get_option(DG_OPTION_NAME);      I assumed that by referencing the main plugin file for the hook, all the setup within would run before my uninstall hook was executed, but this doesn't appear to be the case. In this same file, a number of declarations and variables are setup. When the uninstall hook fires, it doesn't seem to have access to any of the declared values or to the variable. I have tried explicitly including the main plugin file within the uninstall hook, but that doesn't change anything.               class DG_Setup {        public static function uninstall() {           if (!current_user_can('activate_plugins')) return;           check_admin_referer('bulk-plugins');                include_once plugin_dir_path(__FILE__) . 'class-thumber.php';                $options = DG_Thumber::getOptions();           var_dump($options); // null                foreach ($options['thumbs'] as $val) {              if (false !== $val) {                 @unlink($val['thumb_path']);              }           }                delete_option(DG_OPTION_NAME);        }     }          class DG_Thumber {        public static function getOptions() {           include_once plugin_dir_path(dirname(__FILE__)) . 'document-gallery.php';                global $dg_options;           return $dg_options['thumber'];        }     }      Obviously I could just re-declare all of theses values, but then I'm declaring the same value in multiple places which is very un-DRY. So my question is, how can I handle this _cleanly_?


title: meta_query keys and sticky posts

text: The problem is that the code works but when i make a post sticky it doesn't appear at first. The function of the code: It only shows posts that have a thumbnail or a slideshow image.               <?php          $args = array(  'numberposts'  => 5,                     'meta_query'   => array(                         'relation' => 'OR',                         array(                             'key'     => '_thumbnail_id',                             'compare' => '!=',                             'value'   => ''                         ),                         array(                             'key'     => 'slideshow_image',                             'compare' => '!=',                             'value'   => ''                         )                     )                 );               $my_posts = get_posts( $args );     global $post;     foreach( $my_posts as $post ) : setup_postdata($post);          ?>          <?php the_post_thumbnail('thumb-small'); ?>     <a href="<?php the_permalink(); ?>">         <?php the_title(); ?>     </a>          <?php     endforeach;     wp_reset_postdata();     ?>


title: Bulk delete WordPress posts with phpMyAdmin

text: I have over 8,000 posts generated by wp-o-matic and I want to get rid of all of them. I want to execute this query in phpMyAdmin. I just want to make sure this is safe to run and it's not wiping out my pages. This is the query:               DELETE FROM 'wp_posts' WHERE 'post_type' = 'post'      Thanks


title: Is it possible to allow a user to only edit categories of posts and nothing else?

text: I have a site with a lot of articles that aren't categorized. I'd like to hire someone to go through the articles and assign categories to them, then submit them for review and approval. However, if they can also edit the text of the articles the whole review/approval process by me would take up a lot of time as I'll have to check the text on a lot of articles. So is there a way to set permissions in such a way that the specified user can only tweak the categories of a post and **NOTHING** else? Any alternative ideas are also welcome.


title: transition_comment_status called when untrashing comments

text: The author gets two mail when I untrash a comment. I only want to send the "untrash_answer_notification"-mail when untrashing comments. Any ideas?                // Send mail to user when their comment has been restored     function untrash_answer_notification($comment_id) {     $comment = get_comment($comment_id);     if ( $comment->comment_parent != 0 ) return;     $author = get_userdata($comment->user_id);     $headers = "MIME-Version: 1.0" . "\r\n";     $headers .= "Content-type: text/html; charset=UTF-8" . "\r\n";     $headers .= "From: Blabla.com <bla@bla.com>" . "\r\n";     $subject = "Your comment was restored";     $message = "blabla";          wp_mail($author->user_email, $subject, $message, $headers);     }     add_action( 'untrash_comment', 'untrash_answer_notification' );          // Mail author if/when they're comment is approved     function approve_comment_callback($new_status, $old_status, $comment) {     if($old_status != $new_status) {     if($new_status == 'approved' || $new_status==1) {     if($comment->comment_author_email!=''){     $author = get_userdata($comment->user_id);     $headers = "MIME-Version: 1.0" . "\r\n";     $headers .= "Content-type: text/html; charset=UTF-8" . "\r\n";     $headers .= "From: Blabla.com <bla@bla.com>" . "\r\n";     $subject = "Your comment was approved";     $message = "blabla";          wp_mail($author->user_email, $subject, $message, $headers);         }         }             }     }     add_action('transition_comment_status', 'approve_comment_callback', 10,3);


title: Check if post title already exists

text: I'm using the plugin "User Submitted Posts" which allows my users to create posts frontend. So I basically have a frontend post form. I'm trying to find a way for my users to be informed if a post with the same posttitle/link already exists. So when they write an already existing postname in the input field called "usp-title" I want a message to pop up saying "Post name already exists blabla...". I've been searching around a lot for a solution. The closest thing I found was this code:               $page_check = get_page_by_title($content['title'],OBJECT,'post');      if(!$page_check->ID){      //do something when post not exits      }else{      // give a error or something      }      But I don't know how to implement it. I guess I'm asking for pretty much, but I'm stuck so I decided to give it a try.


title: Checking whether template part is loaded in a page

text: I have a template part like this:               <nav id="subpagemenu" class="sidebar">         <?php get_template_part( 'nav', 'subset' ); ?>         <?php get_sidebar(); ?>     </nav>      Both of these are conditional, I mean, nothing will load if there's no content. if there is content, they both load boxes like:                <div class="widget">       Now I would like to be able to know if there are any widgets (sidebar, or my template_part), so that in my functions.php, I can set a variable $mywidgets=true or false. I know that I can use '_is_active_sidebar' for the one part, but how can I check the other part? I don't want to register that part as a sidebar... All I need is a 'true/false'. I tried 'is_page_template' and 'set_theme_mod'. I also looked at these threads: http://stackoverflow.com/questions/6366351/getting-dom-elements-by-class-name Is there a way to check which template file is being loaded, if it is not a page template file? Am I thinking of this in the wrong way? Need to construct the theme differently? Thanks!


title: Using OR in WP_Query negates the "NOT EXISTS" compare

text: I'm attempting to filter posts by a custom field that either are equal to 'new' or have not been set yet. I'm able to get either of those meta_queries to work on their own but when I use them in an 'OR' query, the 'NOT EXISTS" portion is ignored and the query returns every post that has ANY value set. Here is the sample 'meta_query' that is causing the strange behavior:               array(       'relation' => 'OR',       array(         'key' => 'status',         'compare' => 'NOT EXISTS',       ),       array(         'key' => 'status',         'value' => 'new',         'compare' => '=',       ),     );


title: When querying a combination of posts and other meta fields, is there a better solution than directly modifying the WHERE value?

text: This question is a follow up to a question I recently asked. I've implemented what seemed to be the only solution, and it seems to work (YAY!). I just need to verify that:   1. This is really the only way to modify the query to match with a match to the (`post_title OR post_content` _OR_ any one of the other meta fields desired.   2. That this won't mess with other queries not related to searches. The regex used below, I think, would generally only be used for search, but what chance is there of it matching some other functionality in the core or a plugin. I realize with plugins anything could happen, but I'm especially concerned about conflicts in the WP Core.   3. I considered doing all the work in the `posts_where` filter, but thought it was best to rely on modifying `$query` as much as possible and limit direct modification of `WHERE`. Is that a reasonable choice? In any event, here is the function used to modify the `WHERE`:               function st_posts_where( $where ){         if( !is_admin() ){             global $wpdb;             $ptn = "/(\s*AND \(\(\({$wpdb->prefix}posts.post_title LIKE '%.*%'\)\s+OR\s+\(".                    "{$wpdb->prefix}posts.post_content LIKE '%.*%'\)\)\)\s+)AND(.*)/";             $where = preg_replace( $ptn, "$1OR$2", $where );         }         return $where;     }     add_filter( 'posts_where' , 'st_posts_where' );      Additionally, here is the function that the original question was addressing, which is still being used alongside the above one.               function st_search_all( $query ) {         if( !is_admin() && $query->is_search ) {             $query->set( 'post_type', array( 'page', 'attachment' ) );             $query->set( 'post_status', 'inherit' );             $query->set( 'meta_query', array(                 'relation' => 'OR',                 array(                      'key'       => '_st_plaintext',                     'value'     => $query->get('s'),                     'compare'   => 'LIKE'                 ),                 array(                     'key'       => 'Training Classes',                     'value'     => $query->get('s'),                     'compare'   => 'LIKE'                 ),                 array(                     'key'       => 'External Content',                     'value'     => $query->get('s'),                     'compare'   => 'LIKE'                 )             ) );         }         return $query;     }     add_filter( 'pre_get_posts', 'st_search_all' );      All of this in combination results in the following query result which achieves the desired result:               AND (((dev_posts.post_title LIKE '%sbir%')        OR (dev_posts.post_content LIKE '%sbir%')))       OR dev_posts.post_type IN ('page', 'attachment')      AND (dev_posts.post_status = 'inherit')      AND (      (dev_postmeta.meta_key = '_st_plaintext'        AND CAST(dev_postmeta.meta_value AS CHAR) LIKE '%sbir%')     OR  (mt1.meta_key = 'Training Classes'        AND CAST(mt1.meta_value AS CHAR) LIKE '%sbir%')     OR  (mt2.meta_key = 'External Content'        AND CAST(mt2.meta_value AS CHAR) LIKE '%sbir%'))


title: Show wp_nav_menu() based on URL with no fallback

text: I have specific wp menus for each url.   When I encounter a url that has no matching wp menu I dont want any nav. So far it seems if none is found it will show a default nav or pick one of the existing navs to show. use case http://domainnameA.com show wp_nav_menu('domainnameA') http://domainnameB.com no menu exists - dont show a nav instead I am getting Nav on Domain B that has a link to the only page that exists. If I delete the page I get no navigation but that is not a great solution.


title: @file_get_contents and wp_remote_get

text: `$content = json_decode(@file_get_contents($query));` what correctly replacement for @file_get_contents in this string? if i just replace @file_get_contents for @wp_remote_get i get error > Warning: json_decode() expects parameter 1 to be string, array given in > example.php on line 88


title: Redirect deleted page URL ?p=xxxx

text: Google Webmaster Tools shows a bad URL of /?p=xxxx This page id does not exist. I don't use this form of permalink at all. If I try using a 301 redirect or RewriteRule in .htaccess nothing happens. All my other redirects work fine, but none of them include the format /?p=xxxx Is there a method to redirect this specific URL type in .htaccess? Is there a Wordpress admin specific method to redirect this URL? Thanks.


title: Class variables not correct on page

text: I'm trying to make some of the variables from my plugin available for an instance of the class on my page. But it's not showing up the correct values. Here's the relevant part of the plugin:               class opi{         // version         public $opi_version = "1.0";              public $mg = 0;              //constructor         public function opi(){             $this->__construct();         }              public function __construct(){             add_action('init', array(&$this, 'o_check'));             // ...         }              function o_check(){             if (is_user_logged_in()){                 $this->mg = 4;             }         }     }     $opi = new opi;      If I put `echo $this->mg;` just before the closing brace in the `o_check()` function, then it shows `4`. Fine. Now if I put the following in page.php, and I'm logged into WordPress, I get the result `0`.               <?php $pageopi = new opi; ?>     <?php echo $pageopi->mg; ?>      Any ideas where I'm going wrong please?


title: Taxonomy, Terms, and Template Files

text: I have post type 'product' and hierarchical taxonomy 'types' attached to it. In this taxonomy, I have terms: 'dry-clean', 'washer', etc. With several sub terms on each terms. In my situation, I need to display, eg:   1. http://example.com/types/washer -> display all sub terms on it   2. http://example.com/types/washer/{subterm} -> display all posts on it **My questions is:**   1. How do I get permalink URL for parent terms? I try URL above, but it result in 404.   2. How the template files work for that kind of problem?      1. is `taxonomy-types-washer.php` enough for case #1? or should I create `taxonomy-types.php` and create the logic there?     2. in my mind, after scanning template hierarchy, I might need `taxonomy-types-{term_parent}.php` to list all sub terms and `taxonomy-types.php` to list all product in sub terms.     3. ultimately, to display each product, I will have to create `single-product.php`   3. On a slightly unrelated problem. I find that `archive-{posttype}.php` doesn't work when I don't have any post on it. Is there any solution for this? ( _should I create different question, or stick with this one_ )? **UPDATE** I checked my `rewrite_rules` options and it doesn't list [types] at all. I don't know why. To test it, I change my slug into `product-types`, flush permalink and it list this:               [product-types/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?types=$matches[1]&feed=$matches[2]     [product-types/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?types=$matches[1]&feed=$matches[2]     [product-types/([^/]+)/page/?([0-9]{1,})/?$] => index.php?types=$matches[1]&paged=$matches[2]     [product-types/([^/]+)/?$] => index.php?types=$matches[1]      So I guess it's registered now. I try to load URL `product-types/washer` it goes to 404. I try to load URL `index.php?types=washer`. It too, goes 404. Right now, I have this files:   * taxonomy-types-washer.php   * taxonomy-types.php So, I don't know what's wrong with this one :(. **UPDATE #2** I find the problem. It's because I missed `'rewrite'=>array('hierarchical'=>true)` Here's the new `rewrite_rules`:               [product-types/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?types=$matches[1]&feed=$matches[2]     [product-types/(.+?)/(feed|rdf|rss|rss2|atom)/?$] => index.php?types=$matches[1]&feed=$matches[2]     [product-types/(.+?)/page/?([0-9]{1,})/?$] => index.php?types=$matches[1]&paged=$matches[2]     [product-types/(.+?)/?$] => index.php?types=$matches[1]


title: How can I use AJAX to save/update a widget form?

text: My custom widget's form will have two pull-down menus: the content of the second menu is dependent on the user's selection in the first menu (think of the way Country and State/Province works). I think the easiest implementation (though perhaps not the most user-friendly) would simply be to have the form automatically submit itself when the first pulldown is changed (ie: `<select onchange="submit_the_page_via_ajax()">`). I tried `onchange="this.form.submit();"` but that didn't leverage the Ajax call to my surprise (I would have thought that the sophisticated WordPress developers would have hiJaxed the form's submit event). They must be hijaxing the submit _button_ however, since all my view source shows me is a standard html input type for the button. Anyway, I would appreciate a little insight into a best practice for submitting a widget's form leveraging ajax. This is a great post but only addresses the widget's display, not the back-end form.


title: How can I insert default widgets when my theme is activated (similar to what twenty eleven does)?

text: When Twenty Eleven theme is activated, it inserts several default widgets into its sidebars. How can I code my theme to do the same?


title: register multiple post types on one menu entry

text: ### Case: I `register_post_type()` 3 different CPTs1) Example: 3 post types named _party, event, location_. The other needed arguments in the array are left out.               register_post_type(          'party'         ,array(              'show_in_menu' // true (for main) or "edit.php?post_type=party (for subentries)          )     );        * Then I set the `'show_in_menu'` argument for the _first_ CPT item (a.k.a "party") to `true`   * The other items get set `'show_in_menu'` to `'edit.php?post_type=party` ### Result: ![enter image description here](http://i.stack.imgur.com/xcHMu.png) What's the point with this? What I expected was that I get "`Add New`" menu items for all of them, not only for the main CPT. How would I do set the arguments to not only get list views, but single new/edit screens as well? ### Notes: I know, that I got an `Add New` button in the list view on top next to the title, but I want to know how I could add these links to the admin menu items. I also know that I can work around with               add_submenu_page(          "edit.php?post_type=party"         ,"Add New"         ,"Add New"         ,"post-new.php?post_type=party"     );      but I'm not interested in the work around. I want to know how this is thought to work out of the box. 1) CPT = short for custom post type


title: How would I make a function to dynamically determine if user is logged to change navigation menu text?

text: I would like to create a function to determine if a user is logged in or logged out. If the user is logged in I would like the navigation menu text to say "My Account" (this is what it currently displays because 'My Account' is the page name.) If the user is logged out, I would like the navigation menu text to read "Login". This is my idea so far....               if (is_user_logged_in()) {         $my_account = "My Account";         return is_page($my_account);     } else {         $login = "Login/Sign Up";         return is_page($my_account) = "$login";          }


title: Change language of comments template

text: I have a Wordpress installation in italian, I need to keep italian for the admin section but the frontend needs to be in english. The theme is custom so that's ok, but in single posts I'm using `comments_template()` which prints its output in italian. I have read this question but adding that filter seems to have no effect. Is there anything else I need to do to change `comments_template()` language?


title: thumbnails are getting clipped down, want to resize instead

text: I am working on a pre-built theme, and it is clipping the thumbs off. It looks like it is happening in functions.php. I already checked the media and it is not checked. I want to achieve a resizing instead. The site is the- carstore.info


title: Wordpress will not operate correctly

text: My website is ImASpy.com. If you click on the link, Findings, this takes you to my first Wordpress page. It appears to work fine until you click on comments, or you try to go to the about page, which is another Wordpress page. it stops working and usually gives a database error. Even worse, I cannot get into my Wordpress administration. Any idea what's going on? If you need details please let me know what you need. I can give you the entire Sql file or the wp-config.php if you need it. Thanks!


title: Add Admin User via SQL

text: I gave my client the admin account to his wordpress install and I forgot to add an administrator user for myself. Now, I can no longer access the admin panel because they have changed their password. I have direct access to the database and was wondering if I could inject a new admin user via SQL?


title: Auto add pages to category menu

text: I have created a custom post type called Products, on the product pages i have a menu in the left sidebar. This menu is made up of categories for the products. Is it possible to have my products automatically added to the category menu based the category of the product? For example, i make a product, i give it a category of blue. Where blue appears in the menu the product will automatically be added underneath blue. Is this possible? Thanks Update: To be more clear i'm using a plugin called Jquery Accordion Menu and the menu uses a widget. It still uses the built-in wordpress menu system. The Jquery Accordion Widget effectively just styles the menu, in the widget settings you pick what menu you want it to show. I've found this code inside the plugin file after the comments below. I don't know if it's any help.                       function widget($args, $instance) {                 extract( $args );                 // Get menu                      if(! isset($instance['speed']) ){ $instance['speed'] = 'slow'; }                      $widget_options = wp_parse_args( $instance, $this->defaults );                 extract( $widget_options, EXTR_SKIP );                      $nav_menu = wp_get_nav_menu_object( $instance['nav_menu'] );                      if (!$nav_menu)                         return;                      $instance['title'] = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);                      $classMenu = ($instance['classMenu'] != '') ? $instance['classMenu'] : 'menu';                      echo $args['before_widget'];                      if ( !empty($instance['title']) )                         echo $args['before_title'] . $instance['title'] . $args['after_title'];                      ?>                      <div class="dcjq-accordion" id="<?php echo $this->id.'-item'; ?>">                              <?php                                 wp_nav_menu(                                         array(                                                 'fallback_cb' => '',                                                 'menu' => $nav_menu,                                                 'container' => false,                                                 'menu_class' => $classMenu                                                 )                                         );                         ?>                      </div>                 <?php                      echo $args['after_widget'];         }      EDIT 2: If i can get this working without the plugin then that's great. I just need some sort of menu that displays categories and the pages for that category automatically.


title: CSS/JS files in WordPress

text: In web development, I get used to place css/js files under separate folders (css folder, js folder ..etc). What I am experiencing in WordPress is that I cannot access these folders in WordPress Admin Editor Page, the editor only displays the files under the main theme folder, not the nested folders. Is there an option to enable showing nested folders? is there a plugin to accomplish that? If not, then what is the best practice to follow for placing files and folders under WordPress folder?


title: How to display the most popular posts of all the blogs in a mu setup?

text: When you visit wordpress.com, they have a list of the most popular posts right on the front page. I was wondering if there was a way to do the same thing on my multisite installation. Is it possible, and if it is, how would I go about doing it (plugin? theme?)?


title: Different page content for default pages on Wordpress Multisite

text: I've got this code which sets up 4 default pages on every new site install on Wordpress MU. I was wondering how I could set up different 'post_content' for each of the four pages? * * *               function default_pages( $blog_id )     {     $default_pages = array(         'Contact',         'Information',         'About',         'Home',     );          switch_to_blog( $blog_id );          if ( $current_pages = get_pages() )         $default_pages = array_diff( $default_pages, wp_list_pluck( $current_pages, 'post_title' ) );          foreach ( $default_pages as $page_title ) {                 $data = array(             'post_title'   => $page_title,             'post_content' => "This is your '$page_title' page. Enter in your content here.",             'post_status'  => 'publish',             'post_type'    => 'page',         );              wp_insert_post( add_magic_quotes( $data ) );     }          restore_current_blog();     }          add_action( 'wpmu_new_blog', 'default_pages' );


title: is there a quick way to hide category from everywhere?

text: I want to get rid of some posts, old ones, that I don't really want to keep. I was thinking to create a category named 'old' and use it as a garbage can to trash everything I don't like from old posts. Reason I don't simply delete them is the google traffic. Some of those pages receive 1-2 visits a day, so why not leave them? just as adsense traffic :) Anyhow. Now I need a way to hide category 'old' from everywhere. I need a quick and dirty way to do this, preferably through functions.php - don't want to change every menu listing and add -old. I also want to exclude posts inside this category from being displayed in 'related posts' section. But for this I guess I will have to take a look in the plugin itself... any help? Thanks!


title: The correct way of adding TinyMCE editor to custom meta box textarea?

text: Since Wp 3.2 a lot of changed to TinyMCE and Wordpress and ow I can not find out how to add the Tiny MCE to meta box in Page. This is how it looks when I am not firing up the MCE http://screencast.com/t/ECQeyvJYC And this is when I fire up the Tiny MCE               if ( typeof( tinyMCE ) == "object" && typeof( tinyMCE.execCommand ) == "function" ) {     tinyMCE.execCommand("mceAddControl", false, "templatetext");     }      http://screencast.com/t/muvuD0esJW So everything is messed up somewhow. Do you know the solution?


title: extra text in Vimeo Embedded videos

text: For a WordPress site I am working on, there is a jquery slider (based on the coda slider) where videos are presented. All of the videos are from Vimeo. If a video is playing and someone slides to the next video, the other video continues to play. I have found some API code from Vimeo that allows me to control the video, so i could possibly add a "pause" class to the slider buttons that will pause videos when someone slides to the next video. However; in order for this to work, I need an id added to the iframe tag, and this line of code to the end of the video player url: `?api=1&player_id=player_1` (except player_1 should be a unique id) So the final output should look like this (except player_id number will be unique on each video):               <iframe id="player_1" src="http://player.vimeo.com/video/27421766?api=1&player_id=player_1" width="670" height="377" frameborder="0" webkitAllowFullScreen allowFullScreen></iframe>          I wonder if there is a function I can create that will do this. I know there are some core files in WordPress where the embed code lives, but am hestitant to mess with that.


title: Why does WordPress append numbers to page slugs sometimes? How to reliably style based on page

text: Why isit that WordPress sometimes add a number to my slug even if I explicitly set it. Like if I set slug to be 'about' I get 'about-2'. I want the slug to be correct so I can style using CSS easily. Or is there a better way?


title: Custom markup with wp_nav_menu based on pages

text: How might I have custom markup for my menus, like I want to give menu items something like `id="menuitem-postname"` how might I do that?


title: How to get only ONE category of “Portfolio” posts to display on main page rather than ALL categories?

text:
I have a section on my main page that displays a new “Portfolio” post each time I write one no matter what category I assign them to. What I want to do is make the main page only display **one** specific category (`events`) from these Portfolio posts. I’m just wondering what I need to change in the below code to do that?               $args_for_latest = array(         'numberposts'     => 5,         'offset'          => 0,         'orderby'         => 'port_date',         'order'           => 'DESC',         'post_type'       => 'port',         'tax_query'       => array(                                   'taxonomy' => 'portcat',                                   'field' => 'slug'                             ),         'post_status'     => 'publish'      );                $temp_latest = $wp_query;     $wp_query_latest= null;     $wp_query_latest = new WP_Query();     $wp_query_latest->query($args_for_latest);     while ($wp_query_latest->have_posts()) : $wp_query_latest->the_post();     $featured_image_latest = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' );          $terms = get_the_terms($post->ID, 'portcat');     $array_keys = array_keys($terms);          ?>
<?php if ($featured_image_latest[0]!=="") {             echo "";              } else { ?>             <img src="<?php echo IMGURL; ?>/pic_article1.jpg" alt="" />             <?php } ?>             <?php  echo $terms[$array_keys[0]]->name;  ?>
<?php the_title(); ?>
             <?php echo substr(get_the_excerpt(), 0, 70)."..."; ?>             <a href="<?php echo get_permalink($post->ID); ?>" class="read">Read more
     <?php endwhile; wp_reset_query(); ?>


title: How to limit the posts

text:
I have a new question, how can I limit the amount of posts coming out of this query? I only need 7               <?php     $newsposts = new WP_Query('cat=restaurant');     if ( is_front_page()) {          echo '
Latest Restaurants

';         if ($newsposts->have_posts()) : while ($newsposts->have_posts()) : $newsposts->the_post();             echo '

';         endwhile; endif;          echo '
';         }      ?>      I tried to put: `('cat=restaurants'.'limit=7')` but she no work. How did i go wrong? any help would be appreciated


title: Image limit from 1 to 5

text: I found this code posted by: MikeSchinkel some time ago have a question how to change this code that i will be able to upload max 5 pictures insteed of 1 ? :)                   add_filter('wp_handle_upload_prefilter', 'yoursite_wp_handle_upload_prefilter');     function yoursite_wp_handle_upload_prefilter($file) {       // This bit is for the flash uploader       if ($file['type']=='application/octet-stream' && isset($file['tmp_name'])) {         $file_size = getimagesize($file['tmp_name']);         if (isset($file_size['error']) && $file_size['error']!=0) {           $file['error'] = "Unexpected Error: {$file_size['error']}";           return $file;         } else {           $file['type'] = $file_size['mime'];         }       }       list($category,$type) = explode('/',$file['type']);       if ('image'!=$category || !in_array($type,array('jpg','jpeg','gif','png'))) {         $file['error'] = "Sorry, you can only upload a .GIF, a .JPG, or a .PNG image file.";       } else if ($post_id = (isset($_REQUEST['post_id']) ? $_REQUEST['post_id'] : false)) {         if (count(get_posts("post_type=attachment&post_parent={$post_id}"))>0)           $file['error'] = "Sorry, you cannot upload more than one (1) image.";       }       return $file;     }


title: Wordpress ping spam issue with Ping services?

text: My client wants me to install a plugin from here: http://www.maxblogpress.com/plugins/mpo/ that optimizes how WP pings. If you read the article, the version he mentioned were 2.1 and 2.3, if I am not wrong. Does this issue still exist?


title: using upload image with media_handle_upload .. but !

text:
I'm tring to upload image in wordpress by using some function .. I found the way to upload images but there are one problem .. when the user upload his image , wordpress create more than one image diffrent sizes, this is a problem because I want one image only .. this is wp-conent/uploads/2010/10 folder .. look at the picture (this is one picture but wordpress create same picture but diffrent sizes) . http://i.stack.imgur.com/fn6ab.jpg this is my code               <?php /*     Template Name: Uploading Page          */?>          <?php get_header();     ?>

         <form id="file-form" enctype="multipart/form-data" action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="POST">
         upload         <input type="file" id="async-upload" name="async-upload"> <input type="submit" value="Upload" name="html-upload">

         <input type="hidden" name="post_id" id="post_id" value="<?php echo '212';?>" />         <?php wp_nonce_field('client-file-upload'); ?>         <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>" />

         <input type="submit" value="Save all changes" name="save" style="display: none;">
         </form>          <?php     if ( isset( $_POST['html-upload'] ) && !empty( $_FILES ) ) {         require_once(ABSPATH . 'wp-admin/includes/admin.php');         $id = media_handle_upload('async-upload', 1199); //post id of Client Files page         unset($_FILES);         if ( is_wp_error($id) ) {             $errors['upload_error'] = $id;             $id = false;         }              if ($errors) {             echo "
There was an error uploading your file.
";         } else {             echo "
Your file has been uploaded.
";         }     }          get_sidebar();     get_footer();?>      how can make it one picture? I wish you understand me ^_* because my language >_<


title: How to import WP XML file automatically on installation?

text: I'd like the user to install WP and have the default content loaded automatically but i don't want to have to write in in PHP in the wp_install_defaults(); I'd much rather export an xml file each time i make a change to the default and just bundle that with the install. Thanks.


title: Replacing the default content created while the site creation

text: How do you replace the default title for first comment? **Mr WordPress on Hello world!** I could not able to locate this in theme's comments.php file I want to edit the title 'Mr wordpress on Hello world' to Admin on -Site Name- * * * How can I replace the default text created with about us page? _This is an example of a WordPress page, you could edit this to put information about yourself or your site so readers know where you are coming from. You can create as many pages like this one or sub-pages as you like and manage all of your content inside of WordPress._ to It is the page about your self.Feel free to edit the page * * * Some times I cannot able to locate certain content(As I mentioned above comment.php and default about us page) in core files when perforimg search .is there any way to find certain content or code overall? * * *


title: Problem with viewing single page correctly. (taken half way down the page on click through)

text: I have a strange situation occurring with a website that I am currently developing. On the main articles page at http://wptest.lancscps.co.uk/articles/ when the user clicks on the continue reading link to view the single page based on the single-article.php, we end up halfway down the page which isnt the desired effect. I would prefer the user to be taken to the top of the page as one would expect. Has this happened to anyone else and are there any known reasons for this?


title: How do I create a Custom Post Box that Connects Different Posts Together

text: In WordPress, I'm trying to create a Custom Post Box that will allow one post to be manually connected to another post. The easiest way to illustrate this request was to mockup what I would like the final Post Box to look like. That mockup can be viewed here » http://cl.ly/3hI3 **Requirements:**   * The Post Box needs to resemble the "Categories" Post Box, in that it has tabs at the top and checkboxes.   * Each tab at the top of this Post Box needs to be a Post Category (as illustrated in the mockup.) If I could manually control this so that the tabs were managed by a Custom Menu (ie. "Post Connections Menu"), that would be ideal.   * The checkboxed list of items needs to be posts that have already been categorized to that specific category. Thank you very much for any help / insight you can throw my way!


title: Changing the comments link produced by the get_comments_link() and get_comments_pagenum_link() functions

text: Currently my theme calls upon `get_comments_link()` to create the standard anchor **#comments** to link to the comments below the post, as does the `get_comments_pagenum_link()` function on paginated comments. I would like to replace the **#comments** anchor in these functions with any other string, without of course changing WP's core php files. A simple `add_filter` to completely replace core functions (other than in pluggable.php) doesn't seem to be possible. Are there any other ways of achieving this small change to the output of a core function, that use PHP (rather than say Java)? Is there a way here of using an `add_filter` with `str_replace()` perhaps? This will be useful for foreign language sites, and for redirecting comments to another page with a url request, for example.


title: Custom post type paging 404 error

text: I've an issue on custom post type, I've create a custom post type called "Agenda" and the rewrite url for http://example.com/agenda it works correctly, it points to the archive-agenda.php template but for http://example.com/agenda/page/2 it shows 404 error, what do you suggest me? The code that I've used to add the custom post type is:                <?php     function create_event_type() {         $event_args = array(             'label' => __('Agenda'),             'singular_label' => __('Evento'),             'public' => true,             'show_ui' => true,             'capability_type' => 'post',             'hierarchical' => false,             'rewrite' => true,             'has_archive' => true,             'publicly_queryable' => true,             'show_in_nav_menus' => true,             'query_var' => true,             'supports' => array(                 'revisions', // (will store revisions)                 //'page-attributes', // (menu order, hierarchical must be true to show Parent option)                 'title',                 'editor')         );         register_post_type('agenda', $event_args);     }     add_action('init', 'create_event_type');     ?>      Thanks in advance!


title: Count posts within a custom post type and specific category

text: I'm looking to count how many post live within the custom post type called "videos", but only the ones from the category called "work".               <?php $count_posts = wp_count_posts('videos'); echo $count_posts->publish; // ?>      How can I adjust the above code to accomplish this? Thanks!


title: Show Post ID in "Find Posts or Pages" box in Media Library?

text: In the Media Library, when I go in to attach a media item to a post, I know I can use "Attach" to pull up the "Find Posts or Pages" pop up. This brings the following list of post title, date and status.   ![find posts or pages results](http://i.stack.imgur.com/PBtRH.png) I wonder if there is a way to have the results show the post ID as well? It might have something to do with the `find_posts_div` function, but I'm not sure how to apply the proper filters.


title: the_meta - no get_the_meta query?

text: I want to use `the_meta` as though it were `get_the_meta`. I want to do this because when i use `the_meta` in my `functions.php` file (I'm using a shortcode to enter data to pages), it posts the meta information to the top of the post as opposed to where I want it. I have tried `get_the_meta`, but it doesn't seem to work and instead, it returns an error because it's obviously not a valid query.


title: using wp_enqueue_script to attach jquery-ui

text: I am trying to load jquery-ui using wp_enqueue_script. I can check that jquery is loaded. jquery-ui is registered i.e. output of var_dump( wp_script_is( 'jquery-ui-tabs', 'registered' ) ); is bool(true) which indicates it is registered but it does not get included to the page. I am using wordpress version 3.3.1 What is going wrong? I am attaching the relavant snippet from functions.php from my theme.               <?php     function my_scripts_method() {       wp_register_script('jquery');       wp_register_script('jquery-ui-core');       wp_register_script('jquery-ui-tabs');     }     add_action('wp_enqueue_scripts', 'my_scripts_method');     ?>


title: Date not displaying in category post

text: I am not able to get the date to display for posts listed in a category using [catlist] tag. I use the parameter 'date=yes'. The time displays, but not the date. I have checked the list-category-posts/list_cat_posts.php and found the 'get_the_time' function, but cannot figure out how to get the date to display, not the time?? Please help.


title: How does wordpress link page templates to individual pages

text: According to the Codex docs, wordpress uses the query string and the template hierarchy to determine which template to use for a certain page. > First, WordPress matches every Query String to query types — i.e. it decides > what type of page (a search page, a category page, the home page etc.) is > being requested. Templates are then chosen — and web page content is > generated — in the order suggested by the WordPress Template hierarchy... However, using Dashboard settings, you can hand pick templates for pages: ![screenshot of dashboard page attributes](http://i.stack.imgur.com/wFw8Z.png) So, in this case, how does the Wordpress engine determine this, and where is the information stored?


title: Conditional IF statement not returning true even though echo of $user->province is correct

text:
I am having a problem with an if statement which I have now tested many times over.                       $user_query = new WP_User_Query( array( 'role' => 'Subscriber' ) );                  if ( !empty( $user_query->results ) ) {                 foreach ( $user_query->results as $user ) {                          echo $user->province . '
'; // this outputs the province as expected, i.e. Free State                               if ($user->province == 'Free State') { // This does not return true, even though the echo above works                         echo '' . $user->company_name . '
';                         echo $user->town. '
';                         echo $user->province. '
';                     }                       } else {                 echo 'There are currently no photographers for this region.';             }      } I basically only wanting to show photographers in a certain province. Many thanks.


title: Get search.php results in header.php?

text: I want one image in header.php to change for different pages. The function in header.php looks like that:               if(is_archive()):       //change image to "Archives"     endif;     if(is_404()):      //change image to "404"     endif;      Now, is it possible to check if page is the search page AND what's the search string AND how many posts were found? So what I want to do is basically:               if(is_search()):      //change image to "Search" AND echo %s     endif;     if(is_search_empty()): //yes I made this up      //change image to "Nothing found" AND echo $     endif;      Is it even possible outside the search.php page loop?


title: what is the best and safest way to allow users to register to site

text: I'm wanting to allow users to register to my wordpress site. What is the best and safest way to implement this? The ultimate goal is to give the users the option to subscribe to alerts when updates are made to the site. Thanks,


title: Individual rss feed entry length for categories?

text: I know how to retrieve the rss2 feed from a category in wp, namely adding `/feed` behind the category name. However when I do this, not all entries from that feed are included in the rss, this is because I set the feed restriction to be 50 at the admin backend. I would like to know if a feed length could be set indiviually for each category/feed programatically. I could not find any api settings for the size of the feeds ... any help is welcome here. Thanks for your help.


title: allow previews outside wordpress folder (Outsourcing WP previews)

text: I am outsourcing the wordpress and I already figured out the external view. I even know how to make a WP query for previews, but when I want to do that I simply cant - wp-load stops all operations and I get something like "You do not have permission to preview drafts" - any idea what might cause that? (Its the same hosting, and I am correctly logged in.) - so my guess is that wordpress checks for some part of REQUEST_URI ? How to fix this ?


title: How to remove post redirects

text: I recently installed a plugin called "Q and A FAQ and Knowledge Base for WordPress" Turns out it was lacking in the features I needed so I trashed every faq I had created and then deactivated the plugin. I have since gone and created a post with the same name/url (i.e. /faqs) BUT when I access the /faqs URL is displays all the faq posts that I have previously deleted? How can I make sure that nothing to do with faqs still shows up? How can I permanently remove the redirect to /faqs which displays the old faqs and make it show my new page?


title: Edit html for menu items in default frontend menu

text:
I am running Multisite, and would like to be able to append menu items to all frontend menus on all sites. This should work for menus saved via the admin interface as well as the default menu that is displayed. This code works for saved menu items, but not the default menu:               add_filter( 'wp_nav_menu_items', 'your_custom_menu_item', 10, 2 );          function your_custom_menu_item ( $items, $args ) {         $items .= '
my menu item
';         return $items;     }      **So my question is, how can I achieve functionality similar to that in the code above for the default front end menu?** Ideally, I would be able to prepend/append the generated html for the menu items **regardless of how they were generated** (saved menu / default menu). **Alternatively** , any information about how WP generates the default menu would be helpful. I can say that the wp_nav_menu_times filter is not even triggered with the default menu. The function `wp_nav_menu` in `wp_includes/nav_menu_template.php` that applys the filter returns early (before most work including the application of filters) if no menu is found by `wp_get_nav_menu_object`.


title: How to disable Vary cache header on W3Total Cache plugin

text: I've hired incapsula.com performance services for my wordpress blog, and one of their techs is telling me this about the performance of my website: > On important note, yoursite.org returns the **Vary caching header on User- > Agent**. **This will reduce caching and acceleration performance** > dramatically (!!!). Why are you using Vary on User Agent for images? Is it > possible to disable it? As I use W3 Total Cache, I guess this 'Vary on User Agent for images' was activated by this plugin. My question: How can I deactivate this 'Vary on User Agent for images' from W3TC that this tech is talking about? I tried to find such an option but can't find it inside W3TC menu. I appreciate any light on this. Thanks a lot.


title: I'm not able to get RSS feed working. I get 'XML parsing failed'

text: After I updated my site, I'm not able to get the RSS working. I used to get this RSS icon in the address bar in my web browser (opera), but now it's not there any more. I try accessing the following URL: http://www.norwegianfashion.no/feed/ But I only get this error message:               XML parsing failed     XML parsing failed: syntax error (Line: 3, Character: 0)            1:        2:        3: <?xml version="1.0" encoding="UTF-8"?>       4: <rss version="2.0"       5:    xmlns:content="http://purl.org/rss/1.0/modules/content/"       6:    xmlns:wfw="http://wellformedweb.org/CommentAPI/"      Testing it in a feed validator, is says I have a blank line at the start of the file.   Clicling he help link, says that Wordpress has a tendency to create empty spaces :( Does this mean I have to go through each template file, include file and plugins and remove the `?>` at the end? Anything else that could cause my problems?


title: Why do sticky posts show in this menu?

text:
The code below writes out a list of the most recent posts. However, it does not appear to be skipping over sticky posts although I'm using 'post_not_in' => get_option('sticky_posts'). What am I missing?               <?php     $cat=get_cat_ID('top-menu');      $catHidden=get_cat_ID('hidden');     $myquery = new WP_Query();     $myquery->query(array(         'cat' => "-$cat,-$catHidden",         'post_not_in' => get_option('sticky_posts')     ));     $myrecentpostscount = $myquery->found_posts;          if ($myrecentpostscount > 0)      { ?>

Recent Posts

     <?php     global $post;     $current_page_recent = get_post( $current_page );     $myrecentposts = get_posts(array('post_not_in' => get_option('sticky_posts'), 'cat' => "-$cat,-$catHidden",'numberposts' => $cb2_recent_count));     foreach($myrecentposts as  $idxrecent=>$post) {         ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
     <?php     }     ?>


title: Programatically creating image attachments from local URLs and setting featured image

text: I'm currently working on importing an MovableType blog into WordPress. The blog has several thousand posts, and each post has an image associated with it. The export file contains references to each image as follows (and as expected):               <img src="http://domain/path/to/image">       I've got all the images, and have rewritten all the links in the export file to use the new (local) location. However, the WordPress import process doesn't actually create attachments for the post, which I need. So - what's the best way of doing this - right now I'm thinking about iterating through the set of posts, parsing out any image urls, and creating new posts:   * post_parent = the actual post   * post_type = attachment **Questions**   * Is `post_guid` the image location reference? Or is the path to the image stored somewhere else?   * Where is featured image set?   * Is this the best way of doing this? [I've tried using the cache-image plugin, but it borks on the number of posts / images]


title: Remove the "View" Link in Post Admin

text: I have a custom post type that I'm just using just to keep data in but I sometimes share it with others, and I don't want any confusion when the "view" link appears in the admin column. Is there a way of removing that? ![http://img.skitch.com/20110421-des28mtj4br3aeyfxnypnkghsy.jpg](http://img.skitch.com/20110421-des28mtj4br3aeyfxnypnkghsy.jpg)


title: Custom login form

text: I am very new to WordPress. I am trying to display a login form in the header section of my website. However, when I look at all of the files in my directory it is very overwhelming and I am afraid to touch anything. Does anyone know of any good tutorials on the topic or perhaps shed some light on the issue?


title: Is a user_meta research case-sensitive or not

text: I am using the Wordpress get_users() function to search for users with a specific meta_key value.               $wordpress_user = get_users( array('meta_key' => 'unique_id',                                         'meta_value' => 'unique_id_value') );      According to the result of the preceding, I am performing the creation of a new wordpress user, or if the user already exists, I am simply logging in that user. The 'meta_key' is about 10 character's length, with letters and number and i am retrieving it from an external source : for more secure behaviour, I would like to know if the get_users function will use case-sensitive research. (If not I have a potential risk in the future that I retrieve 2 similar meta_key, with an upper case / lower case difference...) In addition I have noticed all wordpress table, including wp_users_meta do have "_ci" so that is an additional reason why I do not feel secure with my present code. Thank you in advance if you can provide me some information about that !


title: get_next_posts_link() stops displaying at page 4

text:
Please start by taking a look at this quick video: http://www.screenr.com/8vSH **The problem:** `get_next_posts_link()` disappears on page 4. That is, the "go to older posts" link disappears once I am in `&paged=4` of my blog. However, I can manually type eg. `&paged=5` and I do get the fifth page's posts (which means, the posts are there, but the `get_next_posts_link()` is just not showing up). **So..**   * Printing my total posts-number returns the correct amount (33), which tells me that all my posts are being queried properly.   * The posts and blog-pages are working properly (i.e. I can type &paged=5 or 6 or so on), and I do get that specific blog-page with the corresponding posts.   * I have also tried `next_posts_link()` to no avail. **The current code looks like this:**               echo '

'.get_next_posts_link($pagi_older_text, 0).'

'.get_previous_posts_link($pagi_newer_text).'

';      Thank you! **The posts query**               get_header();          $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;          $blogcats = $era_opts['era_opts_blog_thecats'];     if(!isset($era_opts['era_opts_blog_thecats'])) {         $blogcats = '';     } else {         $blogcats = implode(',', $blogcats);     }          $args = array(         'post_type' => 'post',         'numberposts' => '-1',         'paged' => $paged,         'category' => $blogcats     );     $era_blog_posts = get_posts($args);      **The added pre_get_posts function in functions.php**               function era_blog_cats_wpse_103587($qry) {       if ($qry->is_page(122) && is_main_query()) {         $era_opts = get_option('era_theme_panel');         $blogcats = $era_opts['era_opts_blog_thecats'];              if(!empty($era_opts['era_opts_blog_thecats'])) {           $qry->set('category__in', $blogcats);         }       }     }     add_action('pre_get_posts','era_blog_cats_wpse_103587');


title: Display user meta data from a textarea as a formated text

text: With the below two functions I can add a textarea custom user meta field named 'publications' to the user profile and save/update it:               add_action( 'show_user_profile', 'extra_user_profile_fields' );     add_action( 'edit_user_profile', 'extra_user_profile_fields' );          function extra_user_profile_fields( $user ) { ?>       <textarea rows="10" cols="450" name="publications" id="publications"  class="regular-text" />       <?php echo esc_attr( get_the_author_meta( 'publications', $user->ID ) ); ?></textarea>     <?php }               add_action( 'personal_options_update', 'save_extra_user_profile_fields' );     add_action( 'edit_user_profile_update', 'save_extra_user_profile_fields' );          function save_extra_user_profile_fields( $user_id ) {          if ( !current_user_can( 'edit_user', $user_id ) ) { return false; }       update_user_meta( $user_id, 'publications', $_POST['publications'] );     }      With the next function I can display the meta data from the field created above on an user page, with a shortcode `[USER_META user_id=2 meta="publications"]`:               add_shortcode('USER_META', 'user_meta_shortcode_handler');          function user_meta_shortcode_handler($atts,$content=null){         return esc_html(get_user_meta($atts['user_id'], $atts['meta'], true));     }      The problem is that in the textarea I can format the text with simple paragraphs, but when it is displayed on front-end the paragraphs disappear and I see only a simple text flow. How to solve this? I have Wordpress 3.5, Twenty Twelve Theme.


title: cannot achieve this structure (custom posts VS categories VS ??)

text: I'm a bit despaired because I cannot figure out how to do what I need (and I worked with WP since a lot of time ..) Basically, I need to show my artistic work. Each work is a post, or a page or a custom types (I still don't know which fits the best) I have 3 categories of work and I won't have more. I have a blog on my website and the custom permalink is: > /blog/%year%/%monthnum%/%day%/%postname%/ So I guess it already removes the post type hypothesis (I don't want an url like : **julienbayle.net/blog** .... I want this: **julienbayle.net/works** shows ALL my works as a portfolio page with only thumbnails as a grid/table and pagination. **julienbayle.net/works/creation** shows only works in category creation as the grid of thumbnails too **julienbayle.net/works/lab** shows only works in category lab as the grid of thumbnails too **julienbayle.net/works/collab** shows only works in category collab as the grid of thumbnails too When you click on thumbnails, you see the work considered, for instance: **julienbayle.net/works/collab/work1** **julienbayle.net/works/collab/work2** etc. I tried with a custom type named "works" but I had some problems with pagination. So I tried by using basic category hierarchy and pages : **works** **\-- creation** **\-- lab** **\-- collab** But I cannot have the good permalink + the link to each work is wrong (contains the structure of a blog post) Anyone here to help me? BIG thanks in advance :)


title: Strange paginate_links behavior. First page link is always whatever page I'm on, all other links are correct

text:
I'm using the following code to generate some pagination:               $wp_query = new WP_Query();     $wp_query->query('posts_per_page=5'.'&paged='.$paged);     $big = 999999999;     echo '
';     echo paginate_links(array(  'base' => '%_%',                                 'format' => str_replace($big, '%#%', esc_url(get_pagenum_link( $big ))),                                 'current' => max( 1, get_query_var('paged') ),                                 'total' => $wp_query->max_num_pages,                                 'end_size' =>4,                                 'type' => 'list'));              echo '
';      Its generating my links correctly on the first page, but if I go to any other page everything is still correct except the link for page 1 is always the url of whatever page I am on. Seems like I'm missing somthing simple, anyone know a fix?


title: How to add additional search terms (e.g. synonyms) to the search?

text: I'm running a blog about different software tools. I frequently use the search to find articles that I wrote for the blog. I also wrote an article about `latexdiff`, but always forget the name and try for example `difftex` which gives no results in the search. I thought, that adding a tag `difftex` might solve the problem, without disturbing the main article by adding e.g. a sentence "I sometimes mix it up with difftex, difflatex,...". But I found out, that tags are not used for the search. What is the **golden way** to add terms to the search?


title: How can I get a different image size, if all I have is the link?

text: For various reasons, I can't use Wordpress' built-in Thumbnail functionality. What I want to do instead is to use the first image in the post as the thumbnail. Here's what I found in the codex: Show the first image associated with the post. However, the problem with that is that if the post has multiple images, but the first image in the post is not actually the one that was uploaded first, you'll end up getting the second image instead of the first one. * * * So, I decided to use something similar to this approach, which uses a regex to parse `the_content` to find the first post. This works out fine, but I end up with the image size that was used in the post, and I only want the Thumbnail size. * * * **So, here's the question:** If I have a link to an image, is there any way I can get a different size? Seems what I need is to somehow get the attachment ID, so that I can get the image size with this:               wp_get_attachment_link( $id, 'thumbnail' );      The problem is, **how do I get an ID if all I have is the URL**?


title: What is a good way to implement photo galleries on Wordpress?

text: I want to publish about 1GB of photos on my Wordpress-powered website. I want viewers to load the photos quickly, but also tobe able to download high- resolution versions. Here is what I have tried. 1) Using NextGen: This seems great, but when huge photos are uploaded, NextGen does not automatically shrink them, making galleries very slow. 2) Using Flickr: Unfortunately, many of my clients view the photos from China, and Flickr is slow there sometimes. Besides, free Flickr has an upload limit of 300MB/month. 3) Picasa: Same, Google applications are slow in China. I am open to a budget of < $25/year, but would really appreciate free services. Thank you.


title: Page with Multiple Loops Breaking Pagination

text:
I made a customized index.php so that I have multiple loops on the same page so that the content can be displayed differently. I got this to work, however the pagination is broken. Despite several hours of Googling and trying all sorts of things, I can't get it to work. Subsequent pages just display the same thing as the home page. I'm also using the WP-PageNavi plugin to do the pagination at the bottom. Each subsequent page is correct in the address bar and at the bottom of the page according to the plug-in, but the content is the same on every page. I understand that you cannot have 'paged' and 'offset' at the same time, but I have absolutely no understanding of how to fix it. Here is the code:
             <?php                 $temp = $wp_query;                 $wp_query= null;                 $wp_query = new WP_Query();                 $wp_query->query('showposts=1'.'&paged='.$paged);                  ?>                  <?php $posts = get_posts('numberposts=1&offset=0'); foreach ($posts as $post) : start_wp(); ?>                      <?php static $count1 = 0; if ($count1 == "1") { break; } else { ?>                                                                 <?php $wp_query = null; $wp_query = $temp;?>                  <?php $count1++; } ?>             <?php endforeach; ?>

         <?php                 $temp = $wp_query;                 $wp_query= null;                 $wp_query = new WP_Query();                 $wp_query->query('showposts=4'.'&paged='.$paged);              ?>              <?php $posts = get_posts('numberposts=4&offset=1'); foreach ($posts as $post) : start_wp(); ?>         <?php static $count2 = 0; if ($count2 == "4") { break; } else { ?>

         <?php $count2++; } ?>         <?php endforeach; ?>
          <?php $wp_query = null; $wp_query = $temp;?>
              <?php                 $temp = $wp_query;                 $wp_query= null;                 $wp_query = new WP_Query();                 $wp_query->query('showposts=6'.'&paged='.$paged);                  ?>         <?php $posts = get_posts('numberposts=6&offset=5'); foreach ($posts as $post) : start_wp(); ?>         <?php static $count3 = 0; if ($count3 == "6") { break; } else { ?>

              <?php $count3++; } ?>         <?php endforeach; ?>
               <?php $wp_query = null; $wp_query = $temp;?>


title: JS.Alescurf notification

text: I am trying to remove this virus that cause certain browsers like Opera cannot open this website because it detects malware. This is the blog. How to solve this?


title: Custom loop with conditional statement to separate each terms

text: Let's say for example: I have a custom taxonomy called "fruit", which has 3 terms "apple", "orange", and "grape". So in order to get all the posts within all these three terms, I would :               $args = array(             'post_per_page' => '-1',         'tax_query' => array(             array(                 'taxonomy' => 'fruit',                 'field' => 'slug',                 'terms' => array('apple','orange','grape')             )         )     );     $query = new WP_Query( $args );          while($query->have_posts()) : $query->the_post();     ... Stuff to display from each post     endwhile;      Now the above loop will display all the post from every terms. My question is, how do I separate each terms so I can display Apples inside a div#apple, orange inside a div#orange, and grape inside a div#grape. I am trying to use conditional statement, but I can't figure out how to... @kaiser - My result of var_dump               object(WP_Query)#300 (45) { ["query_vars"]=> array(58) { ["posts_per_page"]=> int(15) ["tax_query"]=> array(1) { [0]=> array(3) { ["taxonomy"]=> string(12) "psny-contest" ["field"]=> string(4) "slug" ["terms"]=> array(5) { [0]=> string(10) "fall-award" [1]=> string(12) "spring-award" [2]=> string(12) "summer-award" [3]=> string(12) "winter-award" [4]=> string(22) "special-occasion-award" } } } ["error"]=> string(0) "" ["m"]=> int(0) ["p"]=> int(0) ["post_parent"]=> string(0) "" ["subpost"]=> string(0) "" ["subpost_id"]=> string(0) "" ["attachment"]=> string(0) "" ["attachment_id"]=> int(0) ["name"]=> string(0) "" ["static"]=> string(0) "" ["pagename"]=> string(0) "" ["page_id"]=> int(0) ["second"]=> string(0) "" ["minute"]=> string(0) "" ["hour"]=> string(0) "" ["day"]=> int(0) ["monthnum"]=> int(0) ["year"]=> int(0) ["w"]=> int(0) ["category_name"]=> string(0) "" ["tag"]=> string(0) "" ["cat"]=> string(0) "" ["tag_id"]=> string(0) "" ["author_name"]=> string(0) "" ["feed"]=> string(0) "" ["tb"]=> string(0) "" ["paged"]=> int(0) ["comments_popup"]=> string(0) "" ["meta_key"]=> string(0) "" ["meta_value"]=> string(0) "" ["preview"]=> string(0) "" ["s"]=> string(0) "" ["sentence"]=> string(0) "" ["fields"]=> string(0) "" ["category__in"]=> array(0) { } ["category__not_in"]=> array(0) { } ["category__and"]=> array(0) { } ["post__in"]=> array(0) { } ["post__not_in"]=> array(0) { } ["tag__in"]=> array(0) { } ["tag__not_in"]=> array(0) { } ["tag__and"]=> array(0) { } ["tag_slug__in"]=> array(0) { } ["tag_slug__and"]=> array(0) { } ["ignore_sticky_posts"]=> bool(false) ["suppress_filters"]=> bool(false) ["cache_results"]=> bool(true) ["update_post_term_cache"]=> bool(true) ["update_post_meta_cache"]=> bool(true) ["post_type"]=> string(0) "" ["nopaging"]=> bool(false) ["comments_per_page"]=> string(2) "50" ["no_found_rows"]=> bool(false) ["taxonomy"]=> string(12) "psny-contest" ["term"]=> string(10) "fall-award" ["order"]=> string(4) "DESC" } ["tax_query"]=> object(WP_Tax_Query)#298 (2) { ["queries"]=> array(1) { [0]=> array(5) { ["taxonomy"]=> string(12) "psny-contest" ["terms"]=> array(5) { [0]=> string(10) "fall-award" [1]=> string(12) "spring-award" [2]=> string(12) "summer-award" [3]=> string(12) "winter-award" [4]=> string(22) "special-occasion-award" } ["include_children"]=> bool(true) ["field"]=> string(4) "slug" ["operator"]=> string(2) "IN" } } ["relation"]=> string(3) "AND" } ["meta_query"]=> object(WP_Meta_Query)#299 (2) { ["queries"]=> array(0) { } ["relation"]=> NULL } ["post_count"]=> int(15) ["current_post"]=> int(-1) ["in_the_loop"]=> bool(false) ["comment_count"]=> int(0) ["current_comment"]=> int(-1) ["found_posts"]=> string(2) "20" ["max_num_pages"]=> float(2) ["max_num_comment_pages"]=> int(0) ["is_single"]=> bool(false) ["is_preview"]=> bool(false) ["is_page"]=> bool(false) ["is_archive"]=> bool(true) ["is_date"]=> bool(false) ["is_year"]=> bool(false) ["is_month"]=> bool(false) ["is_day"]=> bool(false) ["is_time"]=> bool(false) ["is_author"]=> bool(false) ["is_category"]=> bool(false) ["is_tag"]=> bool(false) ["is_tax"]=> bool(true) ["is_search"]=> bool(false) ["is_feed"]=> bool(false) ["is_comment_feed"]=> bool(false) ["is_trackback"]=> bool(false) ["is_home"]=> bool(false) ["is_404"]=> bool(false) ["is_comments_popup"]=> bool(false) ["is_paged"]=> bool(false) ["is_admin"]=> bool(false) ["is_attachment"]=> bool(false) ["is_singular"]=> bool(false) ["is_robots"]=> bool(false) ["is_posts_page"]=> bool(false) ["is_post_type_archive"]=> bool(false) ["query_vars_hash"]=> string(32) "36947eefd755aba84b755ec8db4398dc" ["query_vars_changed"]=> bool(false) ["thumbnails_cached"]=> bool(false) ["query"]=> array(2) { ["posts_per_page"]=> string(2) "15" ["tax_query"]=> array(1) { [0]=> array(3) { ["taxonomy"]=> string(12) "psny-contest" ["field"]=> string(4) "slug" ["terms"]=> array(5) { [0]=> string(10) "fall-award" [1]=> string(12) "spring-award" [2]=> string(12) "summer-award" [3]=> string(12) "winter-award" [4]=> string(22) "special-occasion-award" } } } } ["request"]=> string(690) " SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) JOIN wp_icl_translations t ON wp_posts.ID = t.element_id AND t.element_type IN ('post_post','post_page','post_picture') JOIN wp_icl_languages l ON t.language_code=l.code AND l.active=1 WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (92,90,91,89,88) ) AND wp_posts.post_type IN ('post', 'page', 'attachment', 'picture') AND (wp_posts.post_status = 'publish' OR wp_posts.post_author = 1 AND wp_posts.post_status = 'private') AND t.language_code='en' GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 15" ["posts"]=> array(15) { [0]=> object(stdClass)#350 (24) { ["ID"]=> int(1086) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2012-01-16 03:59:46" ["post_date_gmt"]=> string(19) "2012-01-16 08:59:46" ["post_content"]=> string(0) "" ["post_title"]=> string(12) "Skating Rink" ["post_excerpt"]=> string(12) "Skating Rink" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(4) "open" ["ping_status"]=> string(4) "open" ["post_password"]=> string(0) "" ["post_name"]=> string(12) "skating-rink" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2012-01-16 04:01:52" ["post_modified_gmt"]=> string(19) "2012-01-16 09:01:52" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(49) "http://psnyusa.org/?post_type=picture&p=1086" ["menu_order"]=> int(0) ["post_type"]=> string(7) "picture" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [1]=> object(stdClass)#351 (24) { ["ID"]=> int(1083) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2012-01-16 03:58:49" ["post_date_gmt"]=> string(19) "2012-01-16 08:58:49" ["post_content"]=> string(0) "" ["post_title"]=> string(9) "Dirty Boy" ["post_excerpt"]=> string(23) "Profile of a Dirty Boy." ["post_status"]=> string(7) "publish" ["comment_status"]=> string(4) "open" ["ping_status"]=> string(4) "open" ["post_password"]=> string(0) "" ["post_name"]=> string(9) "dirty-boy" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2012-01-16 04:03:10" ["post_modified_gmt"]=> string(19) "2012-01-16 09:03:10" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(49) "http://psnyusa.org/?post_type=picture&p=1083" ["menu_order"]=> int(0) ["post_type"]=> string(7) "picture" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [2]=> object(stdClass)#352 (24) { ["ID"]=> int(1080) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2012-01-16 03:57:45" ["post_date_gmt"]=> string(19) "2012-01-16 08:57:45" ["post_content"]=> string(0) "" ["post_title"]=> string(10) "Night Glow" ["post_excerpt"]=> string(163) "Just another experiment at capturing the northern lights. 2 exposures here. One for the sky, and a little longer one for the water and foreground. I always forget " ["post_status"]=> string(7) "publish" ["comment_status"]=> string(4) "open" ["ping_status"]=> string(4) "open" ["post_password"]=> string(0) "" ["post_name"]=> string(10) "night-glow" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2012-01-16 03:57:45" ["post_modified_gmt"]=> string(19) "2012-01-16 08:57:45" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(49) "http://psnyusa.org/?post_type=picture&p=1080" ["menu_order"]=> int(0) ["post_type"]=> string(7) "picture" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [3]=> object(stdClass)#353 (24) { ["ID"]=> int(1077) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2012-01-16 03:56:07" ["post_date_gmt"]=> string(19) "2012-01-16 08:56:07" ["post_content"]=> string(0) "" ["post_title"]=> string(14) "Cool Landscape" ["post_excerpt"]=> string(14) "Cool Landscape" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(4) "open" ["ping_status"]=> string(4) "open" ["post_password"]=> string(0) "" ["post_name"]=> string(14) "cool-landscape" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2012-01-16 03:56:07" ["post_modified_gmt"]=> string(19) "2012-01-16 08:56:07" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(49) "http://psnyusa.org/?post_type=picture&p=1077" ["menu_order"]=> int(0) ["post_type"]=> string(7) "picture" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [4]=> object(stdClass)#354 (24) { ["ID"]=> int(1074) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2012-01-16 03:54:40" ["post_date_gmt"]=> string(19) "2012-01-16 08:54:40" ["post_content"]=> string(0) "" ["post_title"]=> string(20) "Waterfalls Landscape" ["post_excerpt"]=> string(43) "Waterfalls Landscape and the flowing river." ["post_status"]=> string(7) "publish" ["comment_status"]=> string(4) "open" ["ping_status"]=> string(4) "open" ["post_password"]=> string(0) "" ["post_name"]=> string(20) "waterfalls-landscape" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2012-01-18 21:54:33" ["post_modified_gmt"]=> string(19) "2012-01-19 02:54:33" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(49) "http://psnyusa.org/?post_type=picture&p=1074" ["menu_order"]=> int(0) ["post_type"]=> string(7) "picture" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [5]=> object(stdClass)#355 (24) { ["ID"]=> int(1071) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2012-01-16 03:52:10" ["post_date_gmt"]=> string(19) "2012-01-16 08:52:10" ["post_content"]=> string(0) "" ["post_title"]=> string(16) "Tajmahal Sunrise" ["post_excerpt"]=> string(33) "Tajmahal Sunrise and morning fog." ["post_status"]=> string(7) "publish" ["comment_status"]=> string(4) "open" ["ping_status"]=> string(4) "open" ["post_password"]=> string(0) "" ["post_name"]=> string(16) "tajmahal-sunrise" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2012-01-16 03:52:10" ["post_modified_gmt"]=> string(19) "2012-01-16 08:52:10" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(49) "http://psnyusa.org/?post_type=picture&p=1071" ["menu_order"]=> int(0) ["post_type"]=> string(7) "picture" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [6]=> object(stdClass)#356 (24) { ["ID"]=> int(1068) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2012-01-16 03:51:19" ["post_date_gmt"]=> string(19) "2012-01-16 08:51:19" ["post_content"]=> string(0) "" ["post_title"]=> string(19) "Side Road Landscape" ["post_excerpt"]=> string(52) "Side Road Landscape of a beautiful highway in Tiwan." ["post_status"]=> string(7) "publish" ["comment_status"]=> string(4) "open" ["ping_status"]=> string(4) "open" ["post_password"]=> string(0) "" ["post_name"]=> string(19) "side-road-landscape" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2012-01-16 03:51:19" ["post_modified_gmt"]=> string(19) "2012-01-16 08:51:19" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(49) "http://psnyusa.org/?post_type=picture&p=1068" ["menu_order"]=> int(0) ["post_type"]=> string(7) "picture" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [7]=> object(stdClass)#357 (24) { ["ID"]=> int(1065) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2012-01-16 03:50:16" ["post_date_gmt"]=> string(19) "2012-01-16 08:50:16" ["post_content"]=> string(0) "" ["post_title"]=> string(13) "Beautiful Sky" ["post_excerpt"]=> string(40) "Beautiful Sky and beautiful green grass." ["post_status"]=> string(7) "publish" ["comment_status"]=> string(4) "open" ["ping_status"]=> string(4) "open" ["post_password"]=> string(0) "" ["post_name"]=> string(13) "beautiful-sky" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2012-01-16 03:50:16" ["post_modified_gmt"]=> string(19) "2012-01-16 08:50:16" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(49) "http://psnyusa.org/?post_type=picture&p=1065" ["menu_order"]=> int(0) ["post_type"]=> string(7) "picture" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [8]=> object(stdClass)#358 (24) { ["ID"]=> int(1062) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2012-01-16 03:48:31" ["post_date_gmt"]=> string(19) "2012-01-16 08:48:31" ["post_content"]=> string(0) "" ["post_title"]=> string(20) "Portrait Photography" ["post_excerpt"]=> string(36) "Portrait Photography of a lonly boy." ["post_status"]=> string(7) "publish" ["comment_status"]=> string(4) "open" ["ping_status"]=> string(4) "open" ["post_password"]=> string(0) "" ["post_name"]=> string(20) "portrait-photography" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2012-01-16 03:48:31" ["post_modified_gmt"]=> string(19) "2012-01-16 08:48:31" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(49) "http://psnyusa.org/?post_type=picture&p=1062" ["menu_order"]=> int(0) ["post_type"]=> string(7) "picture" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [9]=> object(stdClass)#359 (24) { ["ID"]=> int(1057) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2012-01-16 03:45:55" ["post_date_gmt"]=> string(19) "2012-01-16 08:45:55" ["post_content"]=> string(0) "" ["post_title"]=> string(17) "Paint photography" ["post_excerpt"]=> string(36) "Paint phtography of a wonderful day." ["post_status"]=> string(7) "publish" ["comment_status"]=> string(4) "open" ["ping_status"]=> string(4) "open" ["post_password"]=> string(0) "" ["post_name"]=> string(16) "paint-phtography" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2012-01-16 03:47:24" ["post_modified_gmt"]=> string(19) "2012-01-16 08:47:24" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(49) "http://psnyusa.org/?post_type=picture&p=1057" ["menu_order"]=> int(0) ["post_type"]=> string(7) "picture" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [10]=> object(stdClass)#360 (24) { ["ID"]=> int(1054) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2012-01-16 03:44:28" ["post_date_gmt"]=> string(19) "2012-01-16 08:44:28" ["post_content"]=> string(0) "" ["post_title"]=> string(17) "Statue of Liberty" ["post_excerpt"]=> string(29) "Statue of Liberty silhouette " ["post_status"]=> string(7) "publish" ["comment_status"]=> string(4) "open" ["ping_status"]=> string(4) "open" ["post_password"]=> string(0) "" ["post_name"]=> string(17) "statue-of-liberty" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2012-01-16 03:44:28" ["post_modified_gmt"]=> string(19) "2012-01-16 08:44:28" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(49) "http://psnyusa.org/?post_type=picture&p=1054" ["menu_order"]=> int(0) ["post_type"]=> string(7) "picture" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [11]=> object(stdClass)#361 (24) { ["ID"]=> int(1050) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2012-01-16 03:43:20" ["post_date_gmt"]=> string(19) "2012-01-16 08:43:20" ["post_content"]=> string(0) "" ["post_title"]=> string(16) "New York Skyline" ["post_excerpt"]=> string(43) "New York Skyline looking west at night sky." ["post_status"]=> string(7) "publish" ["comment_status"]=> string(4) "open" ["ping_status"]=> string(4) "open" ["post_password"]=> string(0) "" ["post_name"]=> string(16) "new-york-skyline" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2012-01-16 03:43:20" ["post_modified_gmt"]=> string(19) "2012-01-16 08:43:20" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(49) "http://psnyusa.org/?post_type=picture&p=1050" ["menu_order"]=> int(0) ["post_type"]=> string(7) "picture" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [12]=> object(stdClass)#362 (24) { ["ID"]=> int(1047) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2012-01-16 03:41:16" ["post_date_gmt"]=> string(19) "2012-01-16 08:41:16" ["post_content"]=> string(0) "" ["post_title"]=> string(30) "Infrared Photography Fisherman" ["post_excerpt"]=> string(50) "Infrared Photography Fisherman fishing by himself." ["post_status"]=> string(7) "publish" ["comment_status"]=> string(4) "open" ["ping_status"]=> string(4) "open" ["post_password"]=> string(0) "" ["post_name"]=> string(30) "infrared-photography-fisherman" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2012-01-16 03:41:16" ["post_modified_gmt"]=> string(19) "2012-01-16 08:41:16" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(49) "http://psnyusa.org/?post_type=picture&p=1047" ["menu_order"]=> int(0) ["post_type"]=> string(7) "picture" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [13]=> object(stdClass)#363 (24) { ["ID"]=> int(1044) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2012-01-16 03:38:14" ["post_date_gmt"]=> string(19) "2012-01-16 08:38:14" ["post_content"]=> string(0) "" ["post_title"]=> string(17) "High Speed Bullet" ["post_excerpt"]=> string(40) "High Speed Bullet going through crayons." ["post_status"]=> string(7) "publish" ["comment_status"]=> string(4) "open" ["ping_status"]=> string(4) "open" ["post_password"]=> string(0) "" ["post_name"]=> string(17) "high-speed-bullet" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2012-01-16 03:38:14" ["post_modified_gmt"]=> string(19) "2012-01-16 08:38:14" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(49) "http://psnyusa.org/?post_type=picture&p=1044" ["menu_order"]=> int(0) ["post_type"]=> string(7) "picture" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } [14]=> object(stdClass)#364 (24) { ["ID"]=> int(1041) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2012-01-16 03:35:55" ["post_date_gmt"]=> string(19) "2012-01-16 08:35:55" ["post_content"]=> string(0) "" ["post_title"]=> string(22) "Grand Central Entrance" ["post_excerpt"]=> string(30) "Grand Central Entrance statue." ["post_status"]=> string(7) "publish" ["comment_status"]=> string(4) "open" ["ping_status"]=> string(4) "open" ["post_password"]=> string(0) "" ["post_name"]=> string(22) "grand-central-entrance" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2012-01-17 13:14:52" ["post_modified_gmt"]=> string(19) "2012-01-17 18:14:52" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(49) "http://psnyusa.org/?post_type=picture&p=1041" ["menu_order"]=> int(0) ["post_type"]=> string(7) "picture" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } } ["post"]=> object(stdClass)#350 (24) { ["ID"]=> int(1086) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2012-01-16 03:59:46" ["post_date_gmt"]=> string(19) "2012-01-16 08:59:46" ["post_content"]=> string(0) "" ["post_title"]=> string(12) "Skating Rink" ["post_excerpt"]=> string(12) "Skating Rink" ["post_status"]=> string(7) "publish" ["comment_status"]=> string(4) "open" ["ping_status"]=> string(4) "open" ["post_password"]=> string(0) "" ["post_name"]=> string(12) "skating-rink" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2012-01-16 04:01:52" ["post_modified_gmt"]=> string(19) "2012-01-16 09:01:52" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> int(0) ["guid"]=> string(49) "http://psnyusa.org/?post_type=picture&p=1086" ["menu_order"]=> int(0) ["post_type"]=> string(7) "picture" ["post_mime_type"]=> string(0) "" ["comment_count"]=> string(1) "0" ["filter"]=> string(3) "raw" } }


title: Javascript WP Object Documentation?

text: I was working on implementing the media library within one of my plugins/themes. I found a nice tutorial (http://mikejolley.com/2012/12/using- the-new-wordpress-3-5-media-uploader-in-plugins/) that showed me how to do this using the JS object 'wp' I can't seem to find any documentation on this in the codex or when Googling. How does one learn this object and its methods?


title: "Static" Child Menu with Accordian

text: I'm looking to create a child menu and none of the examples in the Wordpress codex seem to do what I'm trying to create. I have a main horizontal nav bar, which is fine. When clicking on a top-level page, I want a side-bar menu to show up with an accordion effect to browse through the child pages; however, when visiting a child page, I don't want the sidebar menu to reset to show the next tier as the top page... if that makes sense: Here is a JSFiddle to demonstrate what I mean: http://jsfiddle.net/DY8Fk/ If you were to click main nav link in the top nav bar, it shows that page with a sub-menu. **No matter what page you visit within that sub menu, the sub menu doesn't change.** I would want to use CSS to highlight the current page within the nav menu, and possibly add an accordion effect. Any help would be greatly appreciated!


title: Can't remove a widget from admin

text: I've just updated to WP 3.6, and I have also just turned off network mode on a Wordpress website. I cannot remove a widget I created. It is a text widget. I can't remove a search widget either. I am logged into WP with the same username that create the widget. Any ideas?


title: Blog pagination WITHOUT using max_num_pages

text: WP 3.2.1 I'm in a bit of a bind. I have to create some pagination for the blog, but I believe I'm running into the bug described here, and I don't have authorization to fiddle with the server's `php.ini` file. So, I need to find a way to create pagination for the blog without having max_num_pages. Is that possible? I don't want to re-engineer the blog loop if I don't have to. EDIT: max_num_pages isn't even in the list of query_vars when I print them with `print_r($wp_query->query_vars);` EDIT 2: Similarly, found_posts isn't in $wp_query, either. If it helps, I'm using a modified version of Avia as the theme.


title: Changing max number of blog posts per page doesn't work

text: WP 3.2.1 Changing the max number of posts to show on each page via Settings->Reading isn't working. Could this reported bug be the culprit?


title: External URL Link as Featured Images

text: How do set post thumbnail (featured image) from an external URL without uploading the image to WordPress media library.


title: Set terms programmatically

text: I would like to use `wp_set_post_terms()` or `wp_set_object_terms()`. I think I read all the codex and all forum post about these functions and I still can't make them work. I've a taxonomy named `store` with a lot of stores (ex : Adobe, Nike, etc.). So, I'm getting the Id with:               $myvar = term_exists( 'Adobe', 'store');      which gives me this result:               array(2) { ["term_id"]=> string(5) "32771" ["term_taxonomy_id"]=> string(5) "32802" }      Now I've tried everything:               wp_set_post_terms($POSTID, 32802, 'store');     wp_set_post_terms($POSTID, 32802, 32771);     wp_set_post_terms($POSTID, 32771, 32802);     wp_set_post_terms($POSTID, 'Amazon', 'store');     wp_set_post_terms($POSTID, 32771, 'store');     wp_set_post_terms($POSTID, array( 32802 ), 'store');     wp_set_post_terms($POSTID, array( 32802 ), array( 32771 ));     wp_set_post_terms($POSTID, array( 32771 ), 'store');     wp_set_post_terms($POSTID, array( 32771 ), array ( 32802 ));      I've tried to put these into variables too, in lowercase, in uppercase, with first letter uppercase … everything keeps returning me "invalid taxonomy".               object(WP_Error)#5342 (2) { ["errors"]=> array(1) { ["invalid_taxonomy"]=> array(1) { [0]=> string(25) "La taxinomie est invalide" } } ["error_data"]=> array(0) { }      What should I do?


title: WordPress 3.6 generating empty database

text: I wanted to migrate my local WordPress i use for theme development to 3.6, but the generated tables in the database are empty. WordPress creates all tables, but only `wp_options` is being filled, but not with the content i entered into the setup. When i run the setup, i get a blank screen with just the WordPress-Logo on `/wp-admin/install.php?step=2`. (screenshot) At first i thought this was a problem with the german version, but i get the same error with the "official" version from wordpress.org. I am using PHP 5.5.1 and MySQL 5.6.11.


title: W3 Total Cache plugin integration

text: I am working on a plugin (widget) that is using some transients that are updated from time to time. That said, when these transients are updated, I think I will need to flush the cache to display the new data properly. Thus, I wonder if have some way to flush the cache only for widget instead of entire cache. Do you guys have some advice?