title: How to split the Wordpress database?

text: I have a site that is used to log client and meal information. It is based on Wordpress, but has quite a bit of custom code. We have custom taxonomies set for the client and meal data. Our problem is that the database has gotten quite large and it's causing the site to operate very slow. I would like to essentially archive out the different years of the database into separate databases so that we could still refer back to some of the data if we needed to, but decrease the size of the database for the active year. I've searched for an archival tool or plugin that could do this, but haven't been able to find anything (most of the results are for Wordpress archives - not the actual process of archiving out data from the Wordpress database). For example, in my database, the "postmeta" table currently has 2,656,529 rows, the "posts" table has 241,725 rows, and the "term_relationships" table has 1,164,119 rows. The entire size of the database is 356.7 MB. We have custom reports created for the front-end admins to be able to generate meal & client reports, but they now will break if you select a date range longer than 1 month. FYI - I've ran the WP Optimize plugin and have removed all post revisions already (which were very few to begin with). What I need to do is actually split these tables of the database up so that all of the meals that have been logged for 2012 are separate from 2013 which neesd to be separate from 2014. Does anyone have any suggestions as to what we can do to get the database under control?


title: Revealing 'code' hidden button in TinyMCE4 and Wordpress 3.9.x

text: Please, I need help with Wordpress 3.9.1 and TinyMCE4. Before, with Wordpress 3.8.x and TinyMCE3, I have used this code in my _functions.php_ theme file to reveal the hidden 'code' button in TinyMCE3:               function my_mce_buttons_2($buttons) {     $buttons[] = 'code';     return $buttons;     }     add_filter('mce_buttons_2', 'my_mce_buttons_2’);      The 'code' button is used to open a little window in TinyMCE which shows the real HTML code. The before code is from a Wordpress Codex page. Well, now, with Wordpress 3.9 and TinyMCE4, this do NOT work anymore. I can't reveal this button. But, instead, if I follow the Wordpress Codex instructions linked before, and use 'superscript' or 'subscript' instead of 'code'... IT WORKS!! But don't know why, because 'code' is one of the buttons listed in the TinyMCE site as available. Please, help me, I don't have the programing knowledge to solve this on my own. THANKS. \-- Please, excuse my poor english, it's not my mother language.


title: When using javascript to dynamically add a textarea, how can I render it as a tinyMCE editor (in wordpress)?

text: I have a plugin that allows the user to dynamically add sections that need to have the tinyMCE editor in them. The jQuery clones a `div` and places it into a container. One of the input boxes is a textarea set up like so: `<textarea name="sectionContent_1" id="sectionContent_1"></textarea>` I need to replace the textarea with the tinyMCE editor. I've looked at: How to load wp_editor() through AJAX/jQuery and use wordpress wp_editor in dynamic/ajax html Neither of these seem to work for us I've tried this inside the trigger that calls to add the textarea section:               $(this).parent().find('.sectionOptions').html(ctHolder);          var textAreaID = 'sectionContent_'+sectionID;          tinyMCE.execCommand('mceRemoveEditor', true, textAreaID);     tinyMCE.execCommand('mceAddControl', false, textAreaID);      In this, I'm adding the cloned data (ctHolder) to the `.sectionOptions` setting the textarea's ID, resetting the editor on the ID, then adding control to the ID... this doesn't work but seems to be most commons suggestion.


title: Implementing Pillar Posts; Long Posts yet with Some Page-Like Handling?

text: One of the best blogging practices is that of writing "pillar posts" - featured content that's longer than a typical post and will likely generate a high volume of traffic to your site. Extensive tutorials, comprehensive user guides, and in-depth product reviews mostly fall into this category. They're the 1500-word behemoths that sit alongside your daily 300-word "update" articles. Most of the times, pillar posts can be thrown to the top of your site with stickies. This makes them visible, directs the user's attention, and keeps timeless content relevant. After a while, though, you might want to promote these posts to static pages - still searchable and useful, but with their own special spot on the blog. I have a series of articles I plan to write over the next month or so regarding the XML-RPC API built in to WordPress. It's a great system, but scantily documented ... so I'm going to put together some comprehensive method documentation. The thing is, my docs will cover roughly 5-6 different pillar posts. I want this content to be featured on my blog when it's published (once per week), but I'd also like the entire series to be repeated as a static page on the site. The static page would be broken up into individual pages (using `<!-- nextpage-->` to divide sections) so that each post is contained in a different section. How can I have my featured content be both individual posts on the blog and a separate static page? I'm looking at both usability and SEO here ... having the content duplicated is a huge negative, so a simple copy-paste job with both versions on the site isn't my goal. My first inkling would be to develop a custom post type for features like this with its own custom taxonomy. Each "post" would be an individual feature (custom post type) and would be owned by a series (custom taxonomy). Then each post could be included in the loop when published but also on the archive page for the series. So my question (and the reason I'm marking this as a wiki), is how would you approach this situation?


title: Large size image breaks template layout

text: If I upload a large size image inn my wordpress, the image breaks my template width. I have seen some templates which scale the large image's width to the maximum width of the post div. What CSS or code I need to change for that purpose? Thanks.


title: Allow WordPress users to 'follow' RSS feeds from blog authors

text: I have a WordPress blog that allows users to register. Each user will have their own profile page that has their picture and various information. I'd like users to be able to subscribe to RSS feeds in the WordPress blog such as feeds from categories and tags by clicking a "follow" button. Then the feeds would automatically appear on the User's Profile page. Then I'd like the option for the users to be able to unsubscribe to the feeds (unfollow) so it stops appearing on their profile page if they want. Is that possible? Can someone help me out with some code or a plugin? I looked everywhere and can't seem to figure out how to do this.


title: Could not create directory /wp-content/upgrade/

text: When I try to automatically install updates to Wordpress or plugins, I receive an error: > An error occurred while updating... Could not create directory .../wp- > content/upgrade/... My web host runs an Apache environment, and other Wordpress websites I own don't have this problem. I have CHMOD the /wp-content/upgrade folder to both 777 and 2777, without any change in the error message. I have installed the Core Control plugin, and the Filesystem Access module says the only error is that SSH2 is not available, but this is not required for automatic updates. How do I perform the command:               chown www-data:www-data /path/to/wp-content/ -R      from a Windows machine? Is it telnet, or putty? What commands do I use to login? Thanks.


title: Get most recent media upload

text: Wordpress sites this as an example of how to get the thumbnail: ` <?php echo get_the_post_thumbnail( $post_id, $size, $attr ); ?> ` I want to know how can I use the same basic function but just have it automatically get the latest media upload's ID number instead of having to specify the post_id.


title: 404 on Pages for Custom Post Type & Query_Posts

text: It took me quite a while to find a good solution for ordering a custom post type by two custom meta keys. When I finally got it working, I found out the pagination no longer works. I've tried dozens of different code snippets found online but nothing has fixed my unique. I would appreciate any help I can get, or if you think rewriting would work, please provide me examples of a better way to do this. I have a custom post type named Episodes. These have season and episode numbers that I wish to sort by. archive-episodes.php               if ( get_query_var('page') ) { $paged = get_query_var('page'); }     else { $paged = 1; }     $args = array(       'post_type' => 'episodes',       'paged' => $paged,       'posts_per_page' => 10,       'orderby' => 'meta_value',       'meta_key' => 'season_number',       'meta_query' => array(             array(                 'key' => 'season_number',                 'value' => '',                 'compare' => 'LIKE'             ),             array(                 'key' => 'episode_number',                 'value' => '',                 'compare' => 'LIKE'             )         ));     query_posts($args);     if ( have_posts() ) : ?>              <?php /* Start the Loop */ ?>         <?php while ( have_posts() ) : the_post(); ?>         [...]      functions.php               add_filter('posts_orderby', 'edit_posts_orderby');     function edit_posts_orderby($orderby_statement) {         if(is_post_type_archive('episodes')) {             $orderby_statement = "mt1.meta_value, mt2.meta_value DESC";             return $orderby_statement;         }     }      I am aware that Query_Posts on an archive page is NOT best of practices, but I couldn't make the ordering work using pre_get_posts. If someone knows how to rewrite it to work in pre_get_posts I'm willing to try it. I understand my pagination may work again just by switching but I'm just not sure how to. Thanks!


title: Need Header slider plugin recommendation

text: i want the plugin to show header image slider with pagination and the images are **capable to change threw the admin panel**.* _integrating via theme_ *(template part) is very important. I tried wp-nivo and nivo jquery slider but it doesn't support to change the images threw admin panel. am diggingmy head for past 2 days.any one help me to get rid of this problem. thanks in advance


title: Two Search Boxes: one all content, one only titles

text: I would like to have two separate search functions. The first is fine how it is, the second, I would like to only search titles. I have tried the code suggested [here]( Two Search boxes: One only searches Titles, the other searches all content?), but do not know how to make the function conditional on the hidden value `('by-ref')` in my search form.               <form method="get" id="searchform" action="<?php bloginfo('home'); ?>/">     <input type="text" value="" name="s" id="search-text" />     <input type="hidden" name="search-type" value="by-ref" />     <input name="submit" type="submit" value="Go" />     </form>


title: Stopping WordPress' WYSIWYG Editor from Converting "didn't" into "didn'''''''''t"?

text: **didn't becomes didn''''''''''''''''''t** in Wordpress WYSIWYG editor. I searched a lot in google then found this solution   * http://www.lancebledsoe.com/how-to-turn-off-wordpress-smart-quotes/ I followed the steps of this article but when I activated the plugin I got this error at the top of dashboard: > The plugin generated 3 characters of unexpected output during activation. If > you notice “headers already sent” messages, problems with syndication feeds > or other issues, try deactivating or removing this plugin. Without checking, it solved the problem or not I deactivated the plugin, thought it can break the site. Is there any other solution to solved this problem? **WordPress Version is 3.0.1**


title: Displaying Posts Depending on Number of Comments and Latest Comments?

text: I would like to be able to display a list of posts on a page depending on when and how many comments they've got. Something similar to how it is here on stackexchange. To be more specific, I want:   * A page with the most commented posts.   * A page with the most recently commented posts.    * A page with all the uncommented posts. Help with this would be very appreciated, thanks in advance.


title: qTranslate in functions.php

text: I have a function which redirects user to certain page:               wp_redirect('http://address/page');      Usually I would just use:               <?php _e("<!--:en-->english permalink<!--:--><!--:de-->german permalink<!--:-->"); ?>      But this is specific situation and I can't use it this way... Any idea how to do this? Thanks!


title: single.php error

text: writingyourwaytosuccess.com/blog Attempting to view a single post returns the following error:               Fatal error: Call to undefined function atmosphere_posted_on() in     /home/content/46/7460046/html/wp-content/themes/atmosphere-2010/single.php on line 17      Thanks!


title: register_taxonomy - show in admin menu, but not on post type (edit) screen

text: I've been trying a lot of things so far and investigated core inside out, but couldn't find a way that allows me to **add the submenu item** , but **doesn't add the meta box** for a custom taxonomy. ## The Menu item               // From: ~/wp-admin/menu.php     // That is the file that builds the menu and submenu entries.     // This is the part, where it adds the submenu items for taxonomies.     // This gets repeated for every (custom) post type menu entry.     $i = 15;     foreach ( get_taxonomies( array(), 'objects' ) as $tax ) {         if ( ! $tax->show_ui || ! in_array('post', (array) $tax->object_type, true) )             continue;              $submenu['edit.php'][$i++] = array( esc_attr( $tax->labels->menu_name ), $tax->cap->manage_terms, 'edit-tags.php?taxonomy=' . $tax->name );     }     unset($tax);      ## The Meta Box               // From: ~/wp-admin/edit-form-advanced.php     // That is the file, that shows the content of a post type "edit" screen     // all taxonomies. Here it adds some meta boxes for taxonomies     foreach ( get_object_taxonomies($post_type) as $tax_name ) {         $taxonomy = get_taxonomy($tax_name);         if ( ! $taxonomy->show_ui )             continue;              $label = $taxonomy->labels->name;              if ( !is_taxonomy_hierarchical($tax_name) )             add_meta_box('tagsdiv-' . $tax_name, $label, 'post_tags_meta_box', null, 'side', 'core', array( 'taxonomy' => $tax_name ));         else             add_meta_box($tax_name . 'div', $label, 'post_categories_meta_box', null, 'side', 'core', array( 'taxonomy' => $tax_name ));     }      The `public` argument seems to only affect the query. The only factor, that I can see being responsible for both, adding the menu entry, as well as the meta box, is the `show_ui` argument. Please proof me wrong. Thanks.


title: Safe to throw 404 error in request filter?

text: I am working on a plug-in for my personal site and I would like it have a certain permalink structure (/projects/project-type/sub-type/project). To achieve this, I am using the `request` filter. Inside my hook method, I am checking to make sure that the taxonom(y|ies) (project_type) exists before I load the post type (project). If it does not, the filter throws a 404 error and loads the theme's error template instead of just showing the project. Is it safe to do this?               public function request( $request ) {         $dummy_query = new \WP_Query();         $dummy_query->parse_query( $request );              if ( ! $dummy_query->is_admin && isset( $request['project_type'] ) ) {             $last_segment = basename( $request['project_type'] );                  if ( false === get_term_by( 'slug', $last_segment, 'project_type' ) ) {                 $types = explode( '/', substr( $request['project_type'], 0, strrpos( $request['project_type'], '/' ) ) );                      foreach( $types as $type ) {                     if ( false === get_term_by( 'slug', $type, 'project_type' ) ) {                         header( 'HTTP/1.0 404 Not Found' );                         locate_template( array( '404.php' ), true, true );                         exit;                     }                 }                      $request['post_type'] = 'project';                 $request['project'] = $last_segment;                 $request['name'] = $last_segment;             }         }              return $request;     }      This code was modified from this answer.


title: Simple Data Table Update and Page Integration

text: There are a variety of tables (page-level, not database) in a website I manage that need to be regularly updated. The difficult issue is that this information is often only one or two data columns, so I usually snake the data into multiple columns. Here is an example. This reduces scrolling and fills the page much better, but it is very tedious to update by hand! I currently create the table in the editor using TinyMCE Advanced and then shift the cells by hand whenever new data is entered. For another example, I have a list of about 200 corporate members, which would be great to display in a table (even sortable and paged), but I only have two columns, the company name and logo. I would really like to be able to snake this into four columns to fill the page and avoid scrolling. That said, I also need a solution that is not time consuming to update! I looked into WP-Tables Reloaded, but this does not seem to have the ability to snake columns. Any suggestions would be greatly appreciated!


title: Add blogs to "Blogs i Follow" sidebar

text: We've been reading through the documentation and watched a video, and gone through all the options in the Dashboard, but whenever we try adding links to the Blog Roll or 'Blogs I follow' section, they never appear on my blog. How do you add favorite links/links to blogs to the side of the blog?


title: issue displaying variations in custom template using WPeC 3.8.9.2

text:
I’m having trouble displaying variations in a custom built template, each time i call the wpsc function have_variation_groups() within my loop i get the following php error commerce/wpsc-includes/product-template.php on line 1419 [22-Nov-2012 23:27:39] PHP Fatal error: Call to a member function have_variation_groups() on a non-object in /home/tofapost/public_html/sandbox/wp/wp- content/plugins/wp-e-commerce/wpsc-includes/product-template.php on line 1419. have_variation_groups() is being called inside a WP_Query loop like so;               $args = array('post_type' => 'wpsc-product', 'posts_per_page' => -1);     $loop = new WP_Query($args);     while ($loop->have_posts()) : $loop->the_post();             ...           <?php if (wpsc_have_variation_groups()) { ?>     <fieldset>         <legend>             <?php _e( 'Product Options', 'wpsc'); ?>         </legend>

                 <?php while (wpsc_have_variation_groups()) : wpsc_the_variation_group();                 ?>
                                              <label for="<?php echo wpsc_vargrp_form_id(); ?>">                             <?php echo wpsc_the_vargrp_name(); ?>:                     	                     <?php /** the variation HTML and loop */?>                                              <select class="wpsc_select_variation" name="variation[<?php echo wpsc_vargrp_id(); ?>]"                         id="<?php echo wpsc_vargrp_form_id(); ?>" <?php while (wpsc_have_variations())                         : wpsc_the_variation(); ?>                             <option value="<?php echo wpsc_the_variation_id(); ?>" <?php echo wpsc_the_variation_out_of_stock();                             ?>>                                 <?php echo wpsc_the_variation_name(); ?>                             </option>                             <?php endwhile; ?>                         </select>
                 <?php endwhile; ?>

              </fieldset>     <?php } ?>               ...          endwhile;      Whats strange is other wpsc functions like, wpsc_the_product_id() and wpsc_product_has_stock() work while no functions related to variations do... Any help appreciated Thanks


title: Custom post type single-{custom}.php not working

text: I made a custom post type with the machine name special_media_post and wordpress is simply not seeing the single-special_media_post.php. I am at a complete lose. It keeps defaulting to the index.php Here is my code for my custom post type and its taxonomies:               //Post and Taxonomy stuff     //Register Custom Post Type     function special_media_post() {     $labels = array(         'name'                => _x( 'Media Posts', 'Post Type General Name', 'text_domain' ),         'singular_name'       => _x( 'Media Post', 'Post Type Singular Name', 'text_domain' ),         'menu_name'           => __( 'Media Post', 'text_domain' ),         'parent_item_colon'   => __( 'Media Post:', 'text_domain' ),         'all_items'           => __( 'All Media Posts', 'text_domain' ),         'view_item'           => __( 'View Media Post', 'text_domain' ),         'add_new_item'        => __( 'Add New Media Post', 'text_domain' ),         'add_new'             => __( 'New Media Post', 'text_domain' ),         'edit_item'           => __( 'Edit Media Post', 'text_domain' ),         'update_item'         => __( 'Update Media Post', 'text_domain' ),         'search_items'        => __( 'Search Media Posts', 'text_domain' ),         'not_found'           => __( 'No media posts found', 'text_domain' ),         'not_found_in_trash'  => __( 'No media posts found in Trash', 'text_domain' ),     );          $rewrite = array(         'slug'                => 'mediapost',         'with_front'          => true,         'pages'               => true,         'feeds'               => true,     );          $args = array(         'label'               => __( 'mediapost', 'text_domain' ),         'description'         => __( 'Post Type for Media', 'text_domain' ),         'labels'              => $labels,         'supports'            => array( 'title', 'editor', 'custom-fields', ),         'taxonomies'          => array( 'year', 'type' ),         'hierarchical'        => false,         'public'              => true,         'show_ui'             => true,         'show_in_menu'        => true,         'show_in_nav_menus'   => true,         'show_in_admin_bar'   => true,         'menu_position'       => 5,         'can_export'          => true,         'has_archive'         => true,         'exclude_from_search' => false,         'publicly_queryable'  => true,         'query_var'           => 'mediapost',         'rewrite'             => $rewrite,         'capability_type'     => 'page',     );          register_post_type( 'special_media_post', $args );     }          // Register Custom Taxonomy     function media_year()  {     $labels = array(         'name'                       => _x( 'Years', 'Taxonomy General Name', 'text_domain' ),         'singular_name'              => _x( 'Year', 'Taxonomy Singular Name', 'text_domain' ),         'menu_name'                  => __( 'Year', 'text_domain' ),         'all_items'                  => __( 'All Years', 'text_domain' ),         'parent_item'                => __( 'Parent Year', 'text_domain' ),         'parent_item_colon'          => __( 'Parent Year:', 'text_domain' ),         'new_item_name'              => __( 'New Year Name', 'text_domain' ),         'add_new_item'               => __( 'Add New Year', 'text_domain' ),         'edit_item'                  => __( 'Edit Year', 'text_domain' ),         'update_item'                => __( 'Update Year', 'text_domain' ),         'separate_items_with_commas' => __( 'Separate years with commas', 'text_domain' ),         'search_items'               => __( 'Search years', 'text_domain' ),         'add_or_remove_items'        => __( 'Add or remove years', 'text_domain' ),         'choose_from_most_used'      => __( 'Choose from the most used yearss', 'text_domain' ),     );          $rewrite = array(         'slug'                       => 'year',         'with_front'                 => true,         'hierarchical'               => true,     );          $capabilities = array(         'manage_terms'               => 'manage_categories',         'edit_terms'                 => 'manage_categories',         'delete_terms'               => 'manage_categories',         'assign_terms'               => 'edit_posts',     );          $args = array(         'labels'                     => $labels,         'hierarchical'               => true,         'public'                     => true,         'show_ui'                    => true,         'show_admin_column'          => true,         'show_in_nav_menus'          => true,         'show_tagcloud'              => true,         'query_var'                  => 'year',         'rewrite'                    => $rewrite,         'capabilities'               => $capabilities,     );          register_taxonomy( 'year', 'special_media_post', $args );     }          // Register Custom Taxonomy     function media_type()  {     $labels = array(         'name'                       => _x( 'Types', 'Taxonomy General Name', 'text_domain' ),         'singular_name'              => _x( 'Type', 'Taxonomy Singular Name', 'text_domain' ),         'menu_name'                  => __( 'Type', 'text_domain' ),         'all_items'                  => __( 'All Types', 'text_domain' ),         'parent_item'                => __( 'Parent Type', 'text_domain' ),         'parent_item_colon'          => __( 'Parent Type:', 'text_domain' ),         'new_item_name'              => __( 'New Type Name', 'text_domain' ),         'add_new_item'               => __( 'Add New Type', 'text_domain' ),         'edit_item'                  => __( 'Edit Type', 'text_domain' ),         'update_item'                => __( 'Update Type', 'text_domain' ),         'separate_items_with_commas' => __( 'Separate types with commas', 'text_domain' ),         'search_items'               => __( 'Search types', 'text_domain' ),         'add_or_remove_items'        => __( 'Add or remove types', 'text_domain' ),         'choose_from_most_used'      => __( 'Choose from the most used types', 'text_domain' ),     );          $rewrite = array(         'slug'                       => 'type',         'with_front'                 => true,         'hierarchical'               => true,     );          $capabilities = array(         'manage_terms'               => 'manage_categories',         'edit_terms'                 => 'manage_categories',         'delete_terms'               => 'manage_categories',         'assign_terms'               => 'edit_posts',     );          $args = array(         'labels'                     => $labels,         'hierarchical'               => true,         'public'                     => true,         'show_ui'                    => true,         'show_admin_column'          => true,         'show_in_nav_menus'          => true,         'show_tagcloud'              => true,         'query_var'                  => 'media_type',         'rewrite'                    => $rewrite,         'capabilities'               => $capabilities,     );          register_taxonomy( 'type', 'special_media_post', $args );     }          // Hook into the 'init' action     add_action( 'init', 'special_media_post', 0 );          // Hook into the 'init' action     add_action( 'init', 'media_year', 0 );          // Hook into the 'init' action     add_action( 'init', 'media_type', 0 );      If there is something else you need to see, I can put it up, but it doesn't even see it if I put an echo 'Hello World' in there. So it is simply not seeing either the single-special_media_post.php or the archive- special_media_post.php


title: Best way to automate the page/post publication process?

text: I'm working on a spreadsheet that has the contact information for thousands of training programs related to my niche. I'm wondering if any of you know a way to automate the process of creating a landing page for each entry. Each page will contain:   1. School name    2. School address   3. School phone number   4. School website   5. School accreditation date Since this is a very routine process, there must be a way to automate it all instead of posting 3,000+ landing pages. Let me know if you have any suggestions. Thank you.


title: How can I use AJAX with check-box categories?

text: How can I build a search filter (something like this) with WordPress? I have a custom post type name: "Locatii". It is a custom post type with categories. Ex: Cat 1 , Cat 2 ... and so on. How can I implement AJAX so that when I click Cat 1 ( checkbox) and Cat 2 I should retrieve the posts that are in that categories, without having a search button.


title: Article source link for posts

text: Is there a way to add a source link at the end of an article like TechnoBuffalo (scroll down to end of post) with a plugin? If someone could find a plugin or quickly make one for me that would be great.


title: How to preload the entire site with javascript?

text: I don't know if I'm in the right place because is not strictly for Wordpress, I think someone can get some benifit of this question without using Wordpress but in this case I'm using it. So, I'm using a modified theme with some plugin enabled, carousel, and other fancy things. There is a problem with some graphics, when I call the site from a remote host, and it's not cached, it's not quick as it's in localhost so all the images are preload in the same place one above the other and when the JS is ready all go in place, but you see a mess while the site is reading... This is not very nice as you thinking... My intention is to achive a "site is loading" pulsating or a progress bar while the site is ready in background. How to do this?


title: How should I set up a Tumblr blog at a WordPress Page?

text: I am developing a site for a client, let's call it `whatever.com`. He wants to have his Tumblr blog at `whatever.com/blog`. (Tumblr lets you name the URL at which your Tumblr page will be served, and if it's a site root, you adjust your domain's A-Record, which obviously I can't do here.) Right now I have a blank page called `blog` so that it shows up in the nav using `wp_list_pages()`, but I'm guessing this won't work unless I do some fiddling elsewhere. Anyone know how to do this?


title: How to Detect if I am on a bbpress 'plugin' page?

text: How can I check if I am on a forum page or forum post inside my theme. I am using the bbpress plugin (not standalone bbpress). There should be some conditional like is_bbpress() or something?


title: Refine search results using WP_Query

text: I am trying to modify (refine?) Worpress search results by using WP_Query, just as it's explained in the Codex. The snippet featured in that article is on the top of the Search Template PHP file, and all results are displaying accordingly. When I try to append the WP_Query array with arguments of my choice, to create a modified query (for example: posts containing term user searches for, not included in a certain taxonomy), WP_Query completely ignores the appended arguments and gives me the original search results all over again. Code below:               $search = new WP_Query(array( 'taxonomy' => 'media', 'field' => 'image', 'operator' => 'NOT IN'));      I also tried it this way, but I have a feeling it's completely wrong:               <?php     global $query_string;     $query_args = explode("&", $query_string);     $search_query = array();     foreach($query_args as $key => $string) {         $query_split = explode("=", $string);         $search_query[$query_split[0]] = urldecode($query_split[1]);     } // foreach     $args = array(             'tax_query' => array(             array(                 'taxonomy' => 'media',                 'field' => 'slug',                 'terms' => 'media',                 'operator' => 'NOT IN'             )         ),         $search_query     );      What follows is the usual:               if ( $search->have_posts() ) :         while ($search->have_posts() ) : $search->the_post(); ?>      I am not very fluent when it comes to coding, but trying to teach myself the quirks of Wordpress as a CMS. I read through replies on this site, none of the methods used did it for me, though. Can you see what I'm doing wrong? Thanks!


title: Should I change these content meta types before building complex archive page?

text: Hi and thanks in advance for reading this long question. I'm about halfway through building a site for a NYT bestselling author, and have hit a point where I realize I may not have organized myself in the best way in terms of data management. Before I go back and rebuild, I figured I should ask the experts their opinions. My stumbling block is how do I code the main Books archive page. I'd like it organized like this: Genre (organized in specific order, can be hard-coded) \-- Series (organized by which series contains the most recently published book OR by custom post order set by admin - either is acceptable) \--- Books (organized by custom field "Book in Series") \-- Series \--- Books Genre \-- Series \--- Books ... etc. I would also like each Genre and Series to have its own archive page. For the Genre archive it should again be organized by Series and then books within each series. **Here's what I'm set up now:** Books (Custom Post Type)   * Original Publication Date (custom field)   * ISBN (custom field)   * Featured Characters (custom taxonomy)   * Secondary Characters (custom taxonomy)   * Series name (custom taxonomy)   * Book in Series (#) (custom field)   * Synopsis (custom field)   * Additional freeform content (default content of post type Books) Book Excerpts (Custom Post Type)   * sets Parent ID for related book via dropdown list of books / custom field Book Praise (Custom Post Type)   * sets Parent ID for related book via dropdown list of books / custom field **My concerns**   1. What is the best way to code the Books archive page? Would it more efficient/easier to code if I made Series and Genre custom post types with parent/child relationships between themselves and the books, instead of custom taxonomies? **EDIT:** I ask because when I went to code this page I realized I would need to do multiple nested loops (I think, though maybe I could use something like the solution suggested here?).   2. Should I make Book Excerpts and Book Praise custom fields instead of separate custom post types? I need the content for each to display on a separate page from the single Book page to which it is attached, as it can be quite long.   3. Is there anything else I'm doing in a needlessly complicated way?  If it makes any difference, I have been using the Verve Meta Boxes and Custom Post UI plugins to create my various custom post types / taxonomies / custom fields. Thank you again for taking the time to read this and also for any advice you can throw my way! :-)


title: Wordpress Pagination is not shown

text:
i am using onioneye, Ying yang theme and for pagination, i am using wordpress visual pagination plugin but where i am pasting the pagination code, it shows nothing :( template is:                   <?php         /*         Template Name: Home         */         ?>     <?php get_header(); ?>              <?php             //function wp_paginate($args = false) {         //global $wp_paginate;         //$wp_paginate->type = 'posts';         //return $wp_paginate->paginate($args);         //}             //echo "hello";             $count = 0;             $id_suffix = 1;             $items_per_row = 4;             $quality = 90;                                   $my_query = new WP_Query( array( 'posts_per_page' => '-1', 'post_type' => 'portfolio' ) );             $grid_class = 'grid_3';             $desired_width = 220;             $desired_height = 190;             $terms = get_terms( 'portfolio_categories' );              $count_terms = count( $terms );                           //echo "
";                     //print_r($my_query);                     //echo "
";         ?>

                                <div id="portfolio-header" class="grid_12 alpha omega group <?php if( ! $intro_text     ) echo 'no-intro'; ?>">
<?php _e( 'Portfolio', 'onioneye' ); ?>

                     <a href="#" class="all" title="<?php _e( 'View all items',  'onioneye' ); ?>">                              <?php _e( 'All', 'onioneye'  ); ?>                                                                                <?php echo wp_count_posts( 'portfolio' )->publish; ?>
                                       <?php if ( $count_terms > 0 ) { ?>                          <?php foreach ( $terms as $term ) { ?>
                             <a class="<?php echo $term->slug; ?>" href="#" title="<?php printf ( __( 'View all items filed under %s', 'onioneye' ), $term->name ); ?>">                                      <?php echo $term->name; ?>                                                                       <?php echo $term->count; ?>
                          <?php } ?>                      <?php } ?>

              <?php while ( $my_query -> have_posts()) : $my_query -> the_post(); //query the "portfolio" custom post type for portfolio items ?>                  <?php $preview_img_url = eq_get_the_preview_img_url(); ?>             <?php $count++; ?>                               <li data-id="id-<?php echo $id_suffix; ?>" <?php $terms = get_the_terms( $post -> ID, 'portfolio_categories' ); if ( !empty( $terms ) ) { echo 'data-group="'; foreach( $terms as $term ) { echo $term -> slug . ' '; } echo '"'; } ?> class="portfolio-item <?php echo $grid_class; ?> <?php if( $count === 1 ) { echo 'alpha'; } elseif( $count === $items_per_row ) { echo 'omega'; } ?>">
                             <?php echo $nonce = wp_create_nonce("portfolio_item_nonce"); ?>                                               <a class="project-link" href="<?php the_permalink(); ?>" data-post_id="<?php echo $post->ID; ?>" data-nonce="<?php echo $nonce; ?>">                              <?php if ( $preview_img_url ) { ?>                              <?php                             $image_details = wp_get_attachment_image_src( eq_get_attachment_id_from_src( $preview_img_url ), 'full');                             $image_full_width = $image_details[1];                             $image_full_height = $image_details[2];                                  // If the original width of the thumbnail doesn't match the width of the slider, resize it; otherwise, display it in original size                             if( $image_full_width > $desired_width || $image_full_height > $desired_height ) {                          ?>                                 <img width="<?php echo $desired_width; ?>" height="<?php echo $desired_height; ?>" src="<?php echo get_template_directory_uri() . '/timthumb.php?src=' . $image_details[0]; ?>&h=<?php echo $desired_height; ?>&w=<?php echo $desired_width; ?>&q=<?php echo $quality; ?>" alt="<?php the_title(); ?>" />                              <?php                              } else {                          ?>                                                           <img width="<?php echo $desired_width; ?>" height="<?php echo $desired_height; ?>" src="<?php echo $preview_img_url; ?>" alt="<?php the_title(); ?>" />                                                        <?php                              }                          ?>                                  View Details

<?php the_title(); ?>
                                  <img class="view-button" src="<?php echo get_template_directory_uri(); ?>/images/layout/view-details.png" />

                                           <?php } ?>
                                 <?php if( $count === $items_per_row ) { // if the current row is filled out with columns, reset the count variable ?>                      <?php  $count = 0; ?>                   <?php } ?>             <?php  $id_suffix++; ?>              <?php endwhile;                  ?>
             <?php  $id_suffix;                wp_paginate();                  ?>                       <?php if( of_get_option( 'client_logos' ) ) { // display the client logos if defined in the theme options panel ?>

<?php _e( 'Clients', 'onioneye' ); ?>
                      <img class="client-logos" src="<?php echo of_get_option( 'client_logos' ); ?>" alt="client logos" />
                <?php } ?>          <?php get_footer(); ?>      and my function is included here                   <?php         /*          Plugin Name: WP-Paginate                   Plugin URI: http://www.ericmmartin.com/projects/wp-paginate/         Description: A simple and flexible pagination plugin for WordPress posts and comments.         Author: Eric Martin         Version: 1.2.4         Author URI: http://www.ericmmartin.com         Revision: $Id: wp-paginate.php 467949 2011-11-26 20:03:29Z emartin24 $         */              /*  Copyright 2011 Eric Martin (eric@ericmmartin.com)              This program is free software; you can redistribute it and/or modify         it under the terms of the GNU General Public License as published by         the Free Software Foundation; either version 2 of the License, or         (at your option) any later version.              This program is distributed in the hope that it will be useful,         but WITHOUT ANY WARRANTY; without even the implied warranty of         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the         GNU General Public License for more details.              You should have received a copy of the GNU General Public License         along with this program; if not, write to the Free Software         Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA              */              /**          * Set the wp-content and plugin urls/paths          */         if (!defined('WP_CONTENT_URL'))             define('WP_CONTENT_URL', get_option('siteurl') . '/wp-content');         if (!defined('WP_CONTENT_DIR'))             define('WP_CONTENT_DIR', ABSPATH . 'wp-content');         if (!defined('WP_PLUGIN_URL') )             define('WP_PLUGIN_URL', WP_CONTENT_URL. '/plugins');         if (!defined('WP_PLUGIN_DIR') )             define('WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins');              if (!class_exists('WPPaginate')) {              class WPPaginate {             /**              * @var string The plugin version              */             var $version = '1.2.4';                  /**              * @var string The options string name for this plugin              */             var $optionsName = 'wp_paginate_options';                  /**              * @var string $localizationDomain Domain used for localization              */             var $localizationDomain = 'wp-paginate';                  /**              * @var string $pluginurl The url to this plugin              */             var $pluginurl = '';             /**              * @var string $pluginpath The path to this plugin              */             var $pluginpath = '';                  /**              * @var array $options Stores the options for this plugin              */             var $options = array();                  var $type = 'posts';                  /**              * PHP 4 Compatible Constructor              */             function WPPaginate() {$this->__construct();}                  /**              * PHP 5 Constructor              */             function __construct() {                 $name = dirname(plugin_basename(__FILE__));                      //Language Setup                 load_plugin_textdomain($this->localizationDomain, false, "$name/I18n/");                      //"Constants" setup                 $this->pluginurl = plugins_url($name) . "/";                 $this->pluginpath = WP_PLUGIN_DIR . "/$name/";                      //Initialize the options                 $this->get_options();                      //Actions                 add_action('admin_menu', array(&$this, 'admin_menu_link'));                      if ($this->options['css'])                     add_action('wp_print_styles', array(&$this, 'wp_paginate_css'));             }                  /**              * Pagination based on options/args              */             function paginate($args = false) {                      if ($this->type === 'comments' && !get_option('page_comments'))                     return;                      $r = wp_parse_args($args, $this->options);                 extract($r, EXTR_SKIP);                      if (!isset($page) && !isset($pages)) {                     global $wp_query;                                     $paged = get_query_var('paged') ? get_query_var('paged') : 1;                                          //$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;             //                        $wp_query = new WP_Query();                                          //$wp_query = new WP_Query( 'post_type=portfolio&showposts=12' );                                     $wp_query->query('post_type=portfolio&posts_per_page=16&paged=' . $paged);                                     //echo "
";                                     //print_r($wp_query);                                     //echo "
";                                     echo $wp_query->found_posts."
";                     if ($this->type === 'posts') {                         $page = get_query_var('paged');                         echo $posts_per_page =    intval(get_query_var('posts_per_page'))."
";                         echo $pages = intval(ceil($wp_query->found_posts / $posts_per_page))."
";                     }                     else {                         $page = get_query_var('cpage');                         $comments_per_page = get_option('comments_per_page');                         $pages = get_comment_pages_count();                     }                      $page = !empty($page) ? intval($page) : 1;                 }                       $prevlink = ($this->type === 'posts')                     ? esc_url(get_pagenum_link($page - 1))                     : get_comments_pagenum_link($page - 1);                 $nextlink = ($this->type === 'posts')                     ? esc_url(get_pagenum_link($page + 1))                     : get_comments_pagenum_link($page + 1);                      $output = stripslashes($before);                 if ($pages > 1) {                                 echo "hello
";                                 echo wp-paginate-comments;                     $output .= sprintf('
', ($this->type === 'posts') ? '' : ' wp-paginate-comments');                     $output .= sprintf('
%s
', stripslashes($title));                     $ellipsis = "
...
";                          if ($page > 1 && !empty($previouspage)) {                                         echo "lpc";                         $output .= sprintf('
%s
', $prevlink, stripslashes($previouspage));                     }                          $min_links = $range * 2 + 1;                     $block_min = min($page - $range, $pages - $min_links);                     $block_high = max($page + $range, $min_links);                     $left_gap = (($block_min - $anchor - $gap) > 0) ? true : false;                     $right_gap = (($block_high + $anchor + $gap) < $pages) ? true : false;                          if ($left_gap && !$right_gap) {                         $output .= sprintf('%s%s%s',                             $this->paginate_loop(1, $anchor),                             $ellipsis,                             $this->paginate_loop($block_min, $pages, $page)                         );                     }                     else if ($left_gap && $right_gap) {                         $output .= sprintf('%s%s%s%s%s',                             $this->paginate_loop(1, $anchor),                             $ellipsis,                             $this->paginate_loop($block_min, $block_high, $page),                             $ellipsis,                             $this->paginate_loop(($pages - $anchor + 1), $pages)                         );                     }                     else if ($right_gap && !$left_gap) {                         $output .= sprintf('%s%s%s',                             $this->paginate_loop(1, $block_high, $page),                             $ellipsis,                             $this->paginate_loop(($pages - $anchor + 1), $pages)                         );                     }                     else {                         $output .= $this->paginate_loop(1, $pages, $page);                     }                          if ($page < $pages && !empty($nextpage)) {                         $output .= sprintf('
%s
', $nextlink, stripslashes($nextpage));                     }                     $output .= "
";                 }                 $output .= stripslashes($after);                      if ($pages > 1 || $empty) {                     echo $output;                 }                  }                  /**              * Helper function for pagination which builds the page links.              */             function paginate_loop($start, $max, $page = 0) {                 $output = "";                 for ($i = $start; $i <= $max; $i++) {                     $p = ($this->type === 'posts') ? esc_url(get_pagenum_link($i)) : get_comments_pagenum_link($i);                     $output .= ($page == intval($i))                         ? "
$i
"                         : "
$i
";                 }                 return $output;             }                  function wp_paginate_css() {                 $name = "wp-paginate.css";                 if (false !== @file_exists(TEMPLATEPATH . "/$name")) {                     $css = get_template_directory_uri() . "/$name";                 }                 else {                     $css = $this->pluginurl . $name;                 }                 wp_enqueue_style('wp-paginate', $css, false, $this->version, 'screen');                      if (function_exists('is_rtl') && is_rtl()) {                     $name = "wp-paginate-rtl.css";                     if (false !== @file_exists(TEMPLATEPATH . "/$name")) {                         $css = get_template_directory_uri() . "/$name";                     }                     else {                         $css = $this->pluginurl . $name;                     }                     wp_enqueue_style('wp-paginate-rtl', $css, false, $this->version, 'screen');                 }             }                  /**              * Retrieves the plugin options from the database.              * @return array              */             function get_options() {                 if (!$options = get_option($this->optionsName)) {                     $options = array(                         'title' => 'Pages:',                         'nextpage' => '»',                         'previouspage' => '«',                         'css' => true,                         'before' => '
',                         'after' => '
',                         'empty' => true,                         'range' => 3,                         'anchor' => 1,                         'gap' => 3                     );                     update_option($this->optionsName, $options);                 }                 $this->options = $options;             }             /**              * Saves the admin options to the database.              */             function save_admin_options(){                 return update_option($this->optionsName, $this->options);             }                  /**              * @desc Adds the options subpanel              */             function admin_menu_link() {                 add_options_page('WP-Paginate', 'WP-Paginate', 'manage_options', basename(__FILE__), array(&$this, 'admin_options_page'));                 add_filter('plugin_action_links_' . plugin_basename(__FILE__), array(&$this, 'filter_plugin_actions'), 10, 2 );             }                  /**              * @desc Adds the Settings link to the plugin activate/deactivate page              */             function filter_plugin_actions($links, $file) {                 $settings_link = '' . __('Settings', $this->localizationDomain) . '';                 array_unshift($links, $settings_link); // before other links                      return $links;             }                  /**              * Adds settings/options page              */             function admin_options_page() {                 if (isset($_POST['wp_paginate_save'])) {                     if (wp_verify_nonce($_POST['_wpnonce'], 'wp-paginate-update-options')) {                         $this->options['title'] = $_POST['title'];                         $this->options['previouspage'] = $_POST['previouspage'];                         $this->options['nextpage'] = $_POST['nextpage'];                         $this->options['before'] = $_POST['before'];                         $this->options['after'] = $_POST['after'];                         $this->options['empty'] = (isset($_POST['empty']) && $_POST['empty'] === 'on') ? true : false;                         $this->options['css'] = (isset($_POST['css']) && $_POST['css'] === 'on') ? true : false;                         $this->options['range'] = intval($_POST['range']);                         $this->options['anchor'] = intval($_POST['anchor']);                         $this->options['gap'] = intval($_POST['gap']);                              $this->save_admin_options();                              echo '

' . __('Success! Your changes were successfully saved!', $this->localizationDomain) . '

';                     }                     else {                         echo '

' . __('Whoops! There was a problem with the data you posted. Please try again.', $this->localizationDomain) . '

';                     }                 }     ?>

WP-Paginate
     <form method="post" id="wp_paginate_options">     <?php wp_nonce_field('wp-paginate-update-options'); ?>

                 <?php _e('Pagination Label:', $this->localizationDomain); ?>	                 <input name="title" type="text" id="title" size="40" value="<?php echo stripslashes(htmlspecialchars($this->options['title'])); ?>"/>                 <?php _e('The text/HTML to display before the list of pages.', $this->localizationDomain); ?>

                 <?php _e('Previous Page:', $this->localizationDomain); ?>	                 <input name="previouspage" type="text" id="previouspage" size="40" value="<?php echo stripslashes(htmlspecialchars($this->options['previouspage'])); ?>"/>                 <?php _e('The text/HTML to display for the previous page link.', $this->localizationDomain); ?>

                 <?php _e('Next Page:', $this->localizationDomain); ?>	                 <input name="nextpage" type="text" id="nextpage" size="40" value="<?php echo stripslashes(htmlspecialchars($this->options['nextpage'])); ?>"/>                 <?php _e('The text/HTML to display for the next page link.', $this->localizationDomain); ?>

<?php _e('Advanced Settings', $this->localizationDomain); ?>

                 <?php _e('Before Markup:', $this->localizationDomain); ?>	                 <input name="before" type="text" id="before" size="40" value="<?php echo stripslashes(htmlspecialchars($this->options['before'])); ?>"/>                 <?php _e('The HTML markup to display before the pagination code.', $this->localizationDomain); ?>

                 <?php _e('After Markup:', $this->localizationDomain); ?>	                 <input name="after" type="text" id="after" size="40" value="<?php echo stripslashes(htmlspecialchars($this->options['after'])); ?>"/>                 <?php _e('The HTML markup to display after the pagination code.', $this->localizationDomain); ?>

                 <?php _e('Markup Display:', $this->localizationDomain); ?>	                                      <input type="checkbox" id="empty" name="empty" <?php echo ($this->options['empty'] === true) ? "checked='checked'" : ""; ?>/> <?php _e('Show Before Markup and After Markup, even if the page list is empty?', $this->localizationDomain); ?>

                 <?php _e('WP-Paginate CSS File:', $this->localizationDomain); ?>	                                      <input type="checkbox" id="css" name="css" <?php echo ($this->options['css'] === true) ? "checked='checked'" : ""; ?>/> <?php printf(__('Include the default stylesheet wp-paginate.css? WP-Paginate will first look for wp-paginate.css in your theme directory (themes/%s).', $this->localizationDomain), get_template()); ?>

                 <?php _e('Page Range:', $this->localizationDomain); ?>	                                      <select name="range" id="range">                     <?php for ($i=1; $i<=10; $i++) : ?>                         <option value="<?php echo $i; ?>" <?php echo ($i == $this->options['range']) ? "selected='selected'" : ""; ?>><?php echo $i; ?></option>                     <?php endfor; ?>                     </select>                     <?php _e('The number of page links to show before and after the current page. Recommended value: 3', $this->localizationDomain); ?>

                 <?php _e('Page Anchors:', $this->localizationDomain); ?>	                                      <select name="anchor" id="anchor">                     <?php for ($i=0; $i<=10; $i++) : ?>                         <option value="<?php echo $i; ?>" <?php echo ($i == $this->options['anchor']) ? "selected='selected'" : ""; ?>><?php echo $i; ?></option>                     <?php endfor; ?>                     </select>                     <?php _e('The number of links to always show at beginning and end of pagination. Recommended value: 1', $this->localizationDomain); ?>

                 <?php _e('Page Gap:', $this->localizationDomain); ?>	                                      <select name="gap" id="gap">                     <?php for ($i=1; $i<=10; $i++) : ?>                         <option value="<?php echo $i; ?>" <?php echo ($i == $this->options['gap']) ? "selected='selected'" : ""; ?>><?php echo $i; ?></option>                     <?php endfor; ?>                     </select>                     <?php _e('The minimum number of pages in a gap before an ellipsis (...) is added. Recommended value: 3', $this->localizationDomain); ?>

             <input type="submit" value="Save Changes" name="wp_paginate_save" class="button-primary" />
     </form>
<?php _e('Need Support?', $this->localizationDomain); ?>

<?php printf(__('For questions, issues or feature requests, please post them in the %s and make sure to tag the post with wp-paginate.', $this->localizationDomain), 'WordPress Forum'); ?>

<?php _e('Like To Contribute?', $this->localizationDomain); ?>

<?php _e('If you would like to contribute, the following is a list of ways you can help:', $this->localizationDomain); ?>

» <?php _e('Translate WP-Paginate into your language', $this->localizationDomain); ?>

» <?php _e('Blog about or link to WP-Paginate so others can find out about it', $this->localizationDomain); ?>

» <?php _e('Report issues, provide feedback, request features, etc.', $this->localizationDomain); ?>

» <?php _e('Rate WP-Paginate on the WordPress Plugins Page', $this->localizationDomain); ?>

» <?php _e('Make a donation', $this->localizationDomain); ?>

<?php _e('Other Links', $this->localizationDomain); ?>

» @ericmmartin on Twitter

» EricMMartin.com

» SimpleModal Contact Form (SMCF) - WordPress Plugin

» SimpleModal Login - WordPress Plugin

          <?php             }         }     }          //instantiate the class     if (class_exists('WPPaginate')) {         $wp_paginate = new WPPaginate();     }          /**      * Pagination function to use for posts      */     function wp_paginate($args = false) {         //echo "hello";         global $wp_paginate;         $wp_paginate->type = 'posts';         return $wp_paginate->paginate($args);     }          /**      * Pagination function to use for post comments      */     function wp_paginate_comments($args = false) {         global $wp_paginate;         $wp_paginate->type = 'comments';         return $wp_paginate->paginate($args);     }          /*      * The format of this plugin is based on the following plugin template:      * http://pressography.com/plugins/wordpress-plugin-template/      */     ?>


title: Valid Connection Information is Getting Denied

text: I'm getting prompted to enter my FTP information (in this case, SFTP) for installing plugins/themes in Wordpress. Problem is, I keep getting denied with valid SFTP credentials. I have root access to my server as well. RedHat 6.3, MySQL 5.1, PHP 5.3.3 For troubleshooting sake, all of Wordpress's directories are currently `chmod 777` Every time I enter the login credentials that I'm SFTP'ing into the server with, I'm met with the error -               ERROR: There was an error connecting to the server, Please verify the settings are correct.      I've tried regular FTP, SFTP, creating new FTP users, using localhost, using the static address, about everything I could think of. I've even gone as far as editing `wp-config.php` to include FTP info like so               /** FTP SETTINGS FOR AUTO-UPDATE */     define('FTP_HOST', 'Tried both static IP and localhost');     define('FTP_USER', 'user');     define('FTP_PASS', 'pass');      I can upload plugins and files manually through Filezilla or another client (using the SFTP credentials it is currently denying), but I'd like the ability to do one-click upgrades and installs. I wouldn't think there is a firewall issue because Wordpress is installed on a localhost MySQL. Pretty sure I didn't say that right.... but you get the idea. I'm not leaving the box I'm on.


title: Hook for fail and successful login actions

text: I need to log **fail** and **successful login** actions. What hook is better to use for this?


title: Custom post types not using archive structure

text: I've been banging my head against my iMac trying to figure out what's wrong. I've also trolled these archives and have tried the following things to fix:   * flush permalinks   * remove possibly conflicting categories/slugs   * `flush_rewrite_rules( false );`   * `'has_archive' => true`, `'has_archive' => false` (as well as many similar `$args` variations   * `archive-{CPT}.php`, `archive-{CPTSlug}.php`   * `category-{CPT}.php`, `category-{CPTSlug}.php`   * `content-{CPT}.php`, `content-{CPTSlug}.php`   * `{CPT}-archive.php`, `{CPTSlug}-archive.php`   * change the slugs of the CPT and taxonomies and flushed permalinks ALL attempts return a 404 page when visiting `www.site.com/CPTSlug` or `www.site.com/CPT`. The individual posts of the CPT however, display correctly at the URL `www.site.com/CPTSlug/post_title`. When I had these set as categories instead of custom post types it worked perfectly. If anyone out there can spot the problem I would be most grateful.               function register_artists_post_type() {         register_post_type('artists',array(             'labels' => array(                     'name' => __( 'Artists' ),                     'singular_name' => __( 'Artist' ),                     'add_new' => __( 'Add Artist','Artist' ),                     'add_new_item' => __( 'Add New Artist' ),                     'edit_item' => __( 'Edit Artist' ),                     'new_item' => __( 'New Artist' ),                     'view_item' => __( 'View Artist' ),                     'search_items' => __( 'Search Artists' ),                     'not_found' => __( 'No Artists Found' ),                     'not_found_in_trash' => __( 'No Artists In Trash' ),                     'parent_item_colon' => ''                 ),             'public' => true,             'publicly_queryable' => true,             'show_ui' => true,             'query_var' => true,             'has_archive' => true,             'supports' => array( 'title','editor','excerpt','custom-fields','thumbnail' ),             'rewrite' => array('slug' => 'artists'),             'taxonomies' => array('large_feature','small_feature'),             'capability_type' => 'post',             'hierarchical' => false,         ));     }     add_action('init','register_artists_post_type');      There were previously categories called "Artists" (slug = `artists`) as well as child categories with slugs of `large_feature` and `small_feature`. Those have all been deleted from the database and have been replaced with the custom post type below and the slugs you see in the registration. The theme files are as follows (though I don't think this is the problem since it's a 404 page displayed, but in the interest of giving as much relevant information as possible...) `archive.php` `archive_{cpt}.php` `category.php` `single.php` `single_{cpt}.php` The single posts are correctly posting using `single_{cpt}.php`. Archives however, are not.


title: Permalinks Won't Work

text: Permanents won't work for some reason. I click on the radio button for option 3, and click save, but it reverts back to option 1. What's going on? (It shouldn't be a FTP problem - it has localhost access to the database, and I can download plugins within Wordpress fine.)


title: Export a wordpress blog to a wiki

text: I have a wordpress blog and the posts would better suit a wiki format becuase I want to make them open to editing. Is there a way to conveniently export my posts so they can be imported by MediaWiki or another common Wiki application?


title: How to display different widgets on specific pages, hide from other pages

text: I want to display a dynamic sidebar on all pages, and a different sidebar on the homepage. There are also particular pages where I don't want to display either of them. This code is not hiding the unwanted sidebar off of the Homepage; both sidebars show. How can I hide 'multipackage' from the homepage and only display 'singlepackage'? (I guess I thought that the elseif would take care of that. I have also tried just 'else' but I get a syntax error).               <?php         if(!function_exists('dynamic_sidebar')              || !dynamic_sidebar('multipackage'));              elseif (is_page_template('page-homepage.php')) {             dynamic_sidebar('singlepackage');                  // also need to hide both sidebars from Page IDs 4 and 5                  }              ?>      FWIW I have read up on the codex http://codex.wordpress.org/Function_Reference/dynamic_sidebar , this site, and other resources such as http://dreamwhisperdesigns.com/genesis-tutorials/load- sidebar-specific-pages/ (I am not an experienced php developer and syntax is where I often fail, if that's not already obvious!) I would really like to avoid using a plugin for this. Thanks everyone in advance.


title: Word Count Function Preventing Permalink Editing

text: This code counts the number of words in an excerpt and adds it to the excerpt meta box in the post edit screen: http://snippi.com/s/sn3hk5p However, something about this code is preventing the editing of permalinks in the post edit screen and I am unable to identify the problem. Any ideas?


title: Attach images to posts using custom fields (just paths to images already upld)

text: I'm setting up a real estate website, which i make listings using a custom post type 'listings' in which I have multiples metaboxes for beds, baths, and all other informations. I use a plugin to import these posts because listings are generated from a 3d party software, (XML file with Xpaths), as far everything when ok importing listings. The BUT is that the theme inserts images 'attached to the post' '_wp_attach_file ... file'. The XML makes easy to get the paths to images, but I can't figured out how to make them 'be attached' to the post to load up. Is it possible to attach them using custom fields? (i need to do this for almost 500 posts through WP ALL IMPORT - XML XPath importer plugin - which i can insert custom_fields and metaboxes lines) If someone knows how to do the trick, please share your secret Many thanks


title: How Can the Users Make a "Playlist" of Posts?

text: I have an audio website and I want to allow users to make custom playlists from posts. I am using posts as Albums which contains the Tracks. I thought of creating a custom post type and using it to hold a user select playlist based on the default posts. Is this a good idea or is there a better way to allow users to create custom playlist. Notes:   * I had a look at this tutorial. It is what I'm looking for but for individual tracks in the post.   * The audio is stored in arrays in custom fields, i.e `custom_audio{ audio=>"name", url=>"www.text.com"}`


title: Make WordPress site secure through HTTPS and SSL

text: I want to make my worpress site secure through HTTPS. In fact I did install the SSL certificate, but my site is still not secured (it doesn't show the green button, but a yellow one. Problem at the moment seems to be 1 HTTP link in the header of the pages (besides the statcounter plugin, which I will deactivate once all the other problems are solved to make my site secure. This problem is the second line in the source code in the header;               <html xmlns="https://www.w3.org/1999/xhtml" lang="en-US" prefix="og: http://ogp.me/ns#">      Does anybody know how I can edit this line, and change the HTTP link into a HTTPS, or delete the line?


title: How to create wordpress page that shows posts with specific tags?

text: Like the title says, what code would I use on a wordpress page so that it will only show posts that have a specific tag?


title: Exclude all sticky posts front page twenty twelve

text: I am attempting to exclude all sticky posts from my front page in twenty twelve theme. I have attempted the following. I am making all changes to the child theme.   1. To remove the following code from content.php              <?php if ( is_sticky() && is_home() && ! is_paged() ) : ?>     <div class="featured-post">         <?php _e( 'Featured post', 'twentytwelve' ); ?>     </div>     <?php endif; ?>        2. Add following code to index.php before the loop(this removed sticky posts but broke pagination)              <?php query_posts( array( 'post__not_in' => get_option( 'sticky_posts' ) ) ); ?>      This is the loop in index.php (pretty much standard index.php for twenty twelve.                       <?php while ( have_posts() ) : the_post(); ?>                 <?php get_template_part( 'content', get_post_format() ); ?>                            <?php endwhile; ?>                       <?php twentytwelve_content_nav( 'nav-below' ); ?>      Could someone please advise me on what I should exactly put into this loop to not show any sticky posts on index.php? Thank you for your time.


title: Two "the_excerpt" questions

text: In case there's more than one function the exact one is: php the_excerpt(); I want to decrease the character length to X amount and I want to remove the [...] and replace it with an image that users can click to take them to the article. How do I accomplish this (preferably without plugins)?


title: favicon and multi site

text: what about if you are on a multi site install, where would you put the favicon to have it automaticallly recognized by the browser (and no blot the code with link tag)cause there is no real root per se? Thank you in advance for your help on this


title: Use a different domain for SSL

text: long time lurker - first time poster. A client of mine has a website developed in CakePHP, and a wordpress blog installed in the /blog/ directory. Let's say the url of the main domain is `http://www.realdomain.com`, with the blog being `http://www.realdomain.com/blog/`. They don't have their own SSL certificate so they use my companies. Let's say the secure URL is `https://realdomain.maindomain.net/blog/` I have the following code in my wp-config.php file:               define('WP_SITEURL', 'https://realdomain.maindomain.net/blog');     define('WP_CONTENT_URL', 'http://www.realdomain.com/blog/wp-content');     define('FORCE_SSL_LOGIN', true);     define('FORCE_SSL_ADMIN', true);      When I go to the /wp-login.php, it redirects me to the secure URL which is perfect. However, when I log in to the secure site, WordPress tries to loads JavaScripts and styles from               `http**s**://realdomain.com`      Which causes problems because the main site doesn't have a SSL certificate and as a result doesn't load anything from `https://realdomain.com` Is there anything else I'm missing? Is the solution a .htaccess rule? A rule which routed all "`https://realdomain.com`" to `"https://realdomain.maindomain.com`"? I'll pay anyone $20 who can help me fix it. I've Google'd until my hearts content and I don't know what else I can do. Thanks so much!


title: Plugin for an author bio popup box?

text: Looking at the below article, I took a liking to the way the author included his bio (as a clickable little bio box that pops up). http://saveyourself.ca/articles/why-does-pain-hurt-so-much.php Does anybody know where I could find a plugin to do such a thing? All the plugins I've found are for sticking bios at the end of posts, in widgets, hovering over the name, etc...


title: How to prevent custom walker from creating sub navigation for pages that are not relatives of the current page?

text: I have a custom walker that extends the Walker class. My code uses the Walker_Page class as it's base as it does pretty much everything else I want but I need to modify it a bit so that it behaves a little differently. Essentially, I want to prevent the walker from creating new levels of navigation for menu items that are not related to the current page -- that is I only want it to walk deeper levels when the current page is either the current page, or an ancestor of it. The key to this seems to be the `$current_page` (current_object_id) argument that is passed to the `start_el` method. If this were also passed to the `start_lvl` method, I think this would be easy to code, but `start_el` seems to be the only method that gets it. Any help/direction would be much appreciated. I would paste my code here, but it's basically the same as Walker_Page


title: Show terms in archive page

text: I am trying to show terms of specific post type on archive page. I don't understand how to "echo" term name. Here is my code:               <?php $terms = get_terms("event_cat"); ?>     <?php while (have_posts()) : the_post(); ?>           print term->name here     <?php endwhile; ?>


title: Rand post related question

text: I've used that code in my function file to randomise posts in a category and keep the order in the pagination...               session_start();          add_filter('posts_orderby', 'edit_posts_orderby');          function edit_posts_orderby($orderby_statement) {              $seed = $_SESSION['seed'];         if (empty($seed)) {           $seed = rand();           $_SESSION['seed'] = $seed;         }              $orderby_statement = 'RAND('.$seed.')';         return $orderby_statement;     }      The problem is that every time the user comes back to the website, he sees the same order. Is there a way to add a time component to the session? like 30 mins or so to reset itself?


title: How do I create a meta box for dates?

text: I am creating a custom events page and I want to know how to create a custom meta box to save event dates. I don't want it to be a regular meta box because I will be using this to make a custom search bar so I am guessing I have to save it to MySQL no? I am lost, as to how I have to go about this. Any ideas? Thanks in advance.


title: 404 for index.php

text: I've recently switched from linux to windows hosting on IIS7. I have permalinks working fine, but for some reason when I try to view the site index (index.php) I get an internal wordpress 404. I can only assume this has something to do with the migration but am baffled as to the cause. My web.config contains this:               <?xml version="1.0" encoding="UTF-8"?>     <configuration>         <system.webServer>             <httpErrors errorMode="Detailed" />             <rewrite>                 <rules>                     <rule name="Main Rule" stopProcessing="true">                         <match url=".*" />                         <conditions logicalGrouping="MatchAll">                             <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />                             <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />                         </conditions>                         <action type="Rewrite" url="index.php" />                     </rule>                 </rules>             </rewrite>         </system.webServer>     </configuration>      The site in question is http://www.lime49.com/ . Is there something in Wordpress which could cause this?


title: On IIS 8.0 wp-admin returns 404, wordpress/wp-admin does not

text: **Settings:**   we have a WordPress website running on IIS 8.0 in a shared hosting environment. Permalinks are set on `Post name`. `Web.config` has been edited on purpose (please find that below). Site root contains `wp-config.php`, `index.php`, `Web.config` files, the rest has been moved in `wordpress` subdirectory. **Problem:**   We just found out recently that `www.domain.com/wp-admin` does not work. It redirects to `www.domain.com/wp-admin/` and returns a 404.0 IIS error page.   1. Public site pages are all accessible.   2. `www.domain.com/wordpress/wp-admin` redirects to `www.domain.com/wordpress/wp-admin/` and shows login page fine   3. `www.domain.com/login` redirects to `www.domain.com/wordpress/wp-login.php` and shows login page fine   4. This hosted environment is for staging. On our development machine site runs on Apache and all is fine, also `localhost/siteroot/wp-admin`. So we guess it should be a matter of `Web.config` Here is current `Web.config` for completeness. We got it from some source on the web, don't remember where. We tried both with and without `defaultDocument` node, with no effect. We also search here on StackExchange for similar issue, with no luck.               <?xml version="1.0" encoding="UTF-8"?>     <configuration>         <system.webServer>             <!--             <defaultDocument>                 <files>                     <remove value="index.php" />                     <add value="index.php" />                 </files>             </defaultDocument>             -->             <rewrite>                 <rules>                     <rule name="WordPress Rule 1" stopProcessing="true">                         <match url="^index\.php$" ignoreCase="false" />                         <action type="None" />                     </rule>                     <rule name="WordPress Rule 2" stopProcessing="true">                         <match url="^([_0-9a-zA-Z-]+/)?files/(.+)" ignoreCase="false" />                         <action type="Rewrite" url="wp-includes/ms-files.php?file={R:2}" appendQueryString="false" />                     </rule>                     <rule name="WordPress Rule 3" stopProcessing="true">                         <match url="^([_0-9a-zA-Z-]+/)?wp-admin$" ignoreCase="false" />                         <action type="Redirect" url="{R:1}wp-admin/" redirectType="Permanent" />                     </rule>                     <rule name="WordPress Rule 4" stopProcessing="true">                         <match url="^" ignoreCase="false" />                         <conditions logicalGrouping="MatchAny">                             <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" />                             <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" />                         </conditions>                         <action type="None" />                     </rule>                     <rule name="WordPress Rule 5" stopProcessing="true">                         <match url="(^[_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*)" ignoreCase="false" />                         <action type="Rewrite" url="{R:2}" />                     </rule>                     <rule name="WordPress Rule 6" stopProcessing="true">                         <match url="^([_0-9a-zA-Z-]+/)?(.*\.php)$" ignoreCase="false" />                         <action type="Rewrite" url="{R:2}" />                     </rule>                     <rule name="WordPress Rule 7" stopProcessing="true">                         <match url="." ignoreCase="false" />                         <action type="Rewrite" url="index.php" />                     </rule>                 </rules>             </rewrite>         </system.webServer>     </configuration>


title: Have multiple local wordpress installs share a wp-content folder and database

text: On my local machine, I have multiple wordpress versions installed so I can test the themes and plugins I develop. I was wondering if I could somehow create a central wp-content folder and database, which are linked to each version of wordpress, so I don't have to continually copy my projects between the them? Thank you!


title: Best way to specify "article type" in URL

text: I'm helping a small blog out that posts a few different "types" of articles. These article types are shared across categories. We want to put the article type in the URL. So the structure would look like this: www.example.com/category/sub-category/article-type/article-name I'm unsure of the best way to attribute these article types. Should they be sub-categories (so each category would have a subcategory of "how-to", "interview", "News", etc... Should I use tags? Can I specify a specific tag to be in a URL (rather than all tags?) Should I use a custom attribute? Any guidance is good guidance, i'm at starting point zero...


title: custom permalink's rewrite rule for page id

text: I am using WP 3.2.1. I try to do permalink like: /en/1/some-string. Structure is: %lang%/%pageID%/%some random string% So I add a rewrite rule:               function  nw_lang_addRewrite($aRules) {         $_aRules["(en|lt|ru)/(\d+)(/.*)?$"] = 'index.php?p=$matches[2]&lang=$matches[1]';              $aRules = $_aRules + $aRules;         return $aRules;     }      add a lang tag:               function nw_lang_addQuery($vars) {         $aVars[] = "lang";         return $aVars;     }      Buf if user go to http://www.somesite.com/en/17/2-Pork.html he dont see page with ID = 17. $wp_query is:               WP_Query Object (         [query_vars] => Array             (                 [lang] => en                 [error] =>                  [m] => 0                 [p] => 0                      .....                      [static] =>                  [pagename] =>                  [page_id] => 0                 [paged] => 0                 ....              [is_single] =>          [is_preview] =>          [is_page] =>          [is_paged] =>               ...              [queried_object] =>          [queried_object_id] => 0     )


title: Automated posting to wordpress from commandline or XMLRPC API on Dreamhost

text: I operate several wordpress sites on Dreamhost. I have some automated scripts that I want to be able to automatically post to the wordpress blogs. I can do this via a command-line tool or via the XML-RPC. Unfortunately:   1. I can't find a command line tool that will reliably post. (I have shell access on the computer on which the wordpress site is running.)   2. I can't get the XML-RPC API to work. I get an error that I need to use the RPC via POST. I'm told that this is a result of dreamhost running an out-of-date PHP version, but I've tried to use the mods to wordpress and it hasn't been successful. So is there an easy way (or even a hard way) to post to a wordpress blog? Thanks.


title: Custom Permalinks for Posts only

text: I'm using a page as my blog archive, ie http://mysite.com/blog I'd like to list the posts under that url: http://mysite.com/blog/untitled/hello-world/ I've added Category base "blog" and now my categories appear correctly (http://mysite.com/blog/untitled/), but posts do not. The thing is that I have other custom post types and I don't want the /blog/ part to appear there too. Any suggestions will be highly appreciated.


title: Add filter problems

text: I am confused about filters, why does this work:               function get_the_author_description2() {         return 'test';     }     add_filter('get_the_author_description', 'get_the_author_description2');      but this one does not:               function get_the_author_firstname2() {         return 'test';     }     add_filter('get_the_author_firstname', 'get_the_author_firstname2');      Confusing! [I know these are depreciated functions, but the plugin I am trying to override is using them.] Thanks


title: Where (what direcory) are the default Wordpress Widget Codes stored?

text: Of course we all know there are a few widgets ready by default to drag into a sidebar, but where are these stored? I'd like the copy the code of the Categories and modify it slightly to show my Theme's "Portfolio Categories" ....which are Gallery Item Categories. I see these by default: Calendar Categories Custom Menu Links Meta Log in/out Pages Recent Comments Recent Posts RSS Search Tag Cloud Text


title: Secure Pages Best Practice

text: I am in process of writing a plugin that has front-end shortcodes that display a user's information/data. If the user is not logged in, I need to redirect to a front-end login page/form. What would be the best practice here? My plugin creates the pages that I use as well as add the shortcodes to those pages. So, if there is a way to "protect" those pages I would love to know.


title: What is the advantage of using home.php over index.php for the front page

text: I am building a theme and wondering whether or not to include a home.php file or not. The theme (which will not be available to the public) will be mainly used with a static home page and separate blog posts page. My understanding is that including a front-page.php file means that the static home page would be served by that file; and that if I was to include a home.php file then the blog posts would be served by that. My question is this: If I was happy to use index.php as my blog posts layout instead of home.php then is there any advantage in having a home.php file ? Or to ask it another way: Is the only purpose of home.php that of allowing separate styling/layout of the blog posts page as compared to that of the index.php template (ie the fallback template). I should add that I have included in the theme most of the other templates ( single, archive, page etc) so I really only expect index.php to be used as a fallback and it will only operate in that regard If I've missed something so hopefully not that often.


title: stripping default wordpress code out of a page

text: I am trying to make a page in wordpress with my own unique html code, so my own head, html, body tags etc... I cant get it to work but then wordpress chucks in its own head , html tags etc so it adds spaces on the page, is there a way to strip the wordpress code out of one page, and use the code you want? Possible some how?


title: WP Query conflict on tag.php and category.php template

text: My WP_query in the header menu fails to pull any posts on tag and category pages only. Error occurs even with the Loop removed from those template pages. The menu in the header lists the parents. Then for each parent, it then queries for their child posts and image. Interestingly, (ALL) the posts appear when 'post_parent' condition is removed from $group_nav. I'm relatively new to php so any help is much appreciated. This issue has been giving me grief for the last 3 days! drop-down menu canbe viewed here: http://d1079691-5522.myweb.westnethosting.com.au/wsp- ie.com.au/?industry=construction and mis-behaving here: http://d1079691-5522.myweb.westnethosting.com.au/wsp- ie.com.au/?tag=synthetic-leather Coding in header.php               <?php $temp_query = clone $wp_query; ?>          <?php $group_nav_ids = array(916,917,918,919,920,921); //custom post type parent ids     foreach ($group_nav_ids as $group_nav_id): ?>                        *do stuff                 <?php $group_nav = new WP_Query(array( //get children posts     'post_type'         => 'pgroup',     'post_parent'       => $group_nav_id,                                    'order'             => 'ASC',     'orderby'           => 'menu_order',     'posts_per_page'    => -1     ));          if ($group_nav->have_posts()) : ?>            <?php while ($group_nav->have_posts()) : $group_nav->the_post(); ?>          *do stuff          <?php endwhile; ?>     <?php endif; ?>     <?php endforeach; ?>          <?php wp_reset_query(); wp_reset_postdata(); rewind_posts(); ?>          <?php $wp_query = clone $temp_query; ?>


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

text: Is there some way to get the $handle for each script that has been enqueued? Is there some array that holds all the handles so that I can loop through it and do something using each $handle?


title: Is there a plugin or simple way to add a multiple images metabox to a post?

text: I am looking for a way to create a custom field/metabox that allow to attach **multiple** and **infinite** images to a post. This would allow to create a custom post type for a portfolio and allow to attach images **without pasting them inside the post textarea**. Most plugins I've seen allow for only 1 image. I've got the inspiration from the awesome ProcessWire CMS, that allows for this functionality right out of the box. It would be awesome to have this in Wordpress too! Is there a plugin I'm missing? Could this be done?


title: What filters are applied to the_content function?

text: How does WordPress convert raw data from the database to a readable format in the_content function? I've noticed that it applies the_content filter, but what does the_content filter do?


title: Filter For Featured Image

text: Is there a filter for when a Featured Image is set/unset or changed. I need to delete transient data when the above occurs.


title: Optimizing Jetpack for Wordpress

text: Yslow reports following issues with Jetpack: 1) Compress http://stats.wordpress.com/e-201219.js using gzip 2) Configure etags for http://stats.wordpress.com/g.gif?... Modified the format so that it is easier to understand. How can I take action against these items. I am already using latest version of W3 Total cache plugin. Pls advise.


title: How to create a second index.php?

text: I need a duplicate of `index.php`, but slightly modified. I added a "vote it up" plugin. So, I want the user to select how to display posts - by new or by popular. I know what to add to second `index.php`, but how to create a second `index.php`, thats the problem.


title: Update entry in WP database through backend form

text: I'm trying to find a way to UPDATE a entry in my WP DB via a form. My idea is to grab the current entry values, link to another page with another form and display them there inside containers. That would prevent the user from needing to select the entry and copy paste each time he needs to change it. Now he just changes what he wants, press submit en wallah. Make sense? Problem is I have no idea how to go about this in WP! I was thinking of using action="some_php_file_here.php" or using functions. But does WP have a specific way of linking between pages in the backend? How do I call up those pages. They don't really exist as menu items, so where are they? Also, for updating a entry. If anyone has a better suggestion please let me know. Thanks for your time.


title: Order query using custom meta data

text:
I have created a custom post type called `Events` with the name of `events`               function add_events_post_type() {         register_post_type("events", array(             "label"             => __("Events"),             "singular_label"    => __("events"),             "public"        => true,             "capability_type"       => "post",             "hierarchical"      => false,             "rewrite"       => array("slug" => "event"),             "query_var"     => false,             "show_ui"       => true,             "supports"      => array("title", "editor", "author")         ));     }     add_action('init', 'add_events_post_type');      I use the following to create my custom meta box               define('MY_WORDPRESS_FOLDER',$_SERVER['DOCUMENT_ROOT']);     define('MY_THEME_FOLDER',str_replace("\\",'/',dirname(__FILE__)));     define('MY_THEME_PATH','/' . substr(MY_THEME_FOLDER,stripos(MY_THEME_FOLDER,'wp-content')));          add_action('admin_init','my_meta_init');          function my_meta_init()     {         // review the function reference for parameter details         // http://codex.wordpress.org/Function_Reference/wp_enqueue_script         // http://codex.wordpress.org/Function_Reference/wp_enqueue_style              //wp_enqueue_script('my_meta_js', MY_THEME_PATH . '/custom/meta.js', array('jquery'));         wp_enqueue_style('my_meta_css', MY_THEME_PATH . '/custom/meta.css');              // review the function reference for parameter details         // http://codex.wordpress.org/Function_Reference/add_meta_box              // add a meta box for each of the wordpress page types: posts and pages         foreach (array('events') as $type)         {             add_meta_box('my_all_meta', 'Event Info', 'my_meta_setup', $type, 'normal', 'high');         }              // add a callback function to save any data a user enters in         add_action('save_post','my_meta_save');     }          function my_meta_setup()     {         global $post;              // using an underscore, prevents the meta variable         // from showing up in the custom fields section         $meta = get_post_meta($post->ID,'_my_meta',TRUE);              // instead of writing HTML here, lets do an include         include(MY_THEME_FOLDER . '/custom/events.php');              // create a custom nonce for submit verification later         echo '<input type="hidden" name="my_meta_noncename" value="' . wp_create_nonce(__FILE__) . '" />';     }          function my_meta_save($post_id)     {         // authentication checks              // make sure data came from our meta box         if (!wp_verify_nonce($_POST['my_meta_noncename'],__FILE__)) return $post_id;              // check user permissions         if ($_POST['post_type'] == 'page')         {             if (!current_user_can('edit_page', $post_id)) return $post_id;         }         else         {             if (!current_user_can('edit_post', $post_id)) return $post_id;         }              // authentication passed, save data              // var types         // single: _my_meta[var]         // array: _my_meta[var][]         // grouped array: _my_meta[var_group][0][var_1], _my_meta[var_group][0][var_2]              $current_data = get_post_meta($post_id, '_my_meta', TRUE);                $new_data = $_POST['_my_meta'];              my_meta_clean($new_data);              if ($current_data)         {             if (is_null($new_data)) delete_post_meta($post_id,'_my_meta');             else update_post_meta($post_id,'_my_meta',$new_data);         }         elseif (!is_null($new_data))         {             add_post_meta($post_id,'_my_meta',$new_data,TRUE);         }              return $post_id;     }          function my_meta_clean(&$arr)     {         if (is_array($arr))         {             foreach ($arr as $i => $v)             {                 if (is_array($arr[$i]))                 {                     my_meta_clean($arr[$i]);                          if (!count($arr[$i]))                     {                         unset($arr[$i]);                     }                 }                 else                 {                     if (trim($arr[$i]) == '')                     {                         unset($arr[$i]);                     }                 }             }                  if (!count($arr))             {                 $arr = NULL;             }         }     }      and my custom box looks like below

Fill out this information so that events will post show.
     Event Start Date
<input type="text" name="_my_meta[eventstartdate]" class="date-pick" value="<?php if(!empty($meta['eventstartdate'])) echo $meta['eventstartdate']; ?>"/>
     Event End Date
<input type="text" name="_my_meta[eventenddate]" class="date-pick" value="<?php if(!empty($meta['eventenddate'])) echo $meta['eventenddate']; ?>"/>
     Publish Date
<input type="text" name="_my_meta[publish]" class="date-pick" value="<?php if(!empty($meta['publish'])) echo $meta['publish']; ?>"/>
     Hide Date
<input type="text" name="_my_meta[hide]" class="date-pick" value="<?php if(!empty($meta['hide'])) echo $meta['hide']; ?>"/>
     Sticky
<input type="checkbox" name="_my_meta[sticky]" value="sticky" <?php if($meta['sticky'] == 'sticky') { echo 'checked="checked"'; } ?>/>

      I am querying the posts in the custom post type on the homepage of the site using this query.               <?php         $args = array( 'post_type' => 'events', 'posts_per_page' => 3 );         $loop = new WP_Query( $args );         while ( $loop->have_posts() ) : $loop->the_post();             $data = get_post_custom(get_the_ID());             $data2 = $data['_my_meta'];             $data3 = unserialize($data2[0]);             if($data3['sticky'] == 'sticky')             {                 echo ''.get_the_title().'
';             } else {                 echo ''.get_the_title().'
';             }         endwhile;     ?>      I would like to order the query using the Event Start Date from the custom meta box. I have tried this with no luck. Can someone help me with this?


title: Snippet for own (gr)avatars

text: Following snippet used(and works great) but generates a redirect chain :(.               If (function_excists('basicgravatar')            function basicgravatar ($avatar_defaults) {        $myavatar = get_stylesheet_directory_uri() . '/images/gravatar.png'; //Child theme        //$myavatar = get_bloginfo('template_directory') . '/images/gravatar.png';  //Main theme        $avatar_defaults[$myavatar] = "New default avatar";        return $avatar_defaults; }          add_filter( 'avatar_defaults', 'basicgravatar' );      Using GTmetrix which shows following: > Remove the following redirect chain if possible: > http://0.gravatar.com/avatar/?d=http://oursite.com/media/wp- > content/themes/our-child-theme/images/gravatar.png&s=40 _and 2 more lines > with almost identical msg._ Also this is shown as result after using code above: > The following resources have identical contents, but are served from > different URLs. Serve these resources from a consistent URL to save 2 > request(s) and 20.2KiB. The more comments the more redirects.   (The quotes above show results after only two(2) comments and 1 author box, imagine 50 or more comments...)..how to solve this, without editing any core file. Thanks in advance for time and effort.