title: How to make CSS load live based on options clicked in the theme customizer?

text: I have a problem. I am trying get the theme customizer load a different CSS file based on what radio input in clicked, **live!** It works so far right now that option is saved when I click "Save & Publish" it only loads up when manually reload the entire customizer page. The preview panel is refreshed on select but not loads the selected CSS up and I don't know what actually makes Twenty Eleven do this but I like to have it this say too. I have looked at the Twentyeleven theme to code this. The differences are:   * The theme uses `option` for the settings and not `theme_mod` for it    * It has some settings handling but I think that's for its separate theme options page, I do not want that.   * It uses `enqueue scripts` to add its 'dark' theme on top of the normal theme and it's actually applied live if one clicks it, this is what I like to have too. How would I do this? Not sure how this actually works, it seems to store the option temporary only for the customizer and refresh it with the enqueued dark theme. I would be glad if you could help me figure out how to apply the CSS on the Customizer preview. For reference: Twentyeleven theme-options.php Here is the slimmed down version of of my plugin.               <?php     /**      * Plugin Name: S Skins      * Plugin URI:       * Description:       * Version: 1.0      * Author:       * Author URI:       * License: GPLv3+      */          add_action( 'plugins_loaded', array( 'S_Color_Themes', 'get_instance' ) );          class S_Color_Themes {              /**          * Plugin version, used for cache-busting of style and script file references.          *          * @since   2.6.0          *          * @var     string          */         const VERSION = '1.0.0';              /**          * Unique identifier for your plugin.          *          *          * The variable name is used as the text domain when internationalizing strings          * of text. Its value should match the Text Domain file header in the main          * plugin file.          *          * @since    1.0.0          *          * @var      string          */         protected $plugin_slug = 's-color-themes';              public $color_themes = array();              /**          * Instance of this class.          *          * @since    1.0.0          *          * @var      object          */         protected static $instance = null;              /**          * Initialize the plugin by setting localization and loading public scripts          * and styles.          *          * @since    2.6.0          */         private function __construct() {                  $this->get_color_themes();                  if ( is_admin () ) {                 add_action( 'customize_register', array( $this, 'wp_customize_register' ) );             }                  add_filter( 'stylesheet_uri', array( $this, 'stylesheet_uri' ), 10, 2 );         }              /**          * Return the plugin slug.          *          * @since    1.0.0          *          *@return    Plugin slug variable.          */         public function get_plugin_slug() {             return $this->plugin_slug;         }              /**          * Return an instance of this class.          *          * @since     1.0.0          *          * @return    object    A single instance of this class.          */         public static function get_instance() {                  // If the single instance hasn't been set, set it now.             if ( null == self::$instance ) {                 self::$instance = new self;             }                  return self::$instance;         }              public function stylesheet_uri( $stylesheet, $dir_uri ) {                  $color_theme = apply_filters( 's_color_theme', get_theme_mod( 's_skin' ) );                  if ( empty( $color_theme ) || 'default' == $color_theme || ! is_file( get_stylesheet_directory() . "/style-$color_theme.css" ) ) {                 return $stylesheet;             }                  return "$dir_uri/style-$color_theme.css";         }              public function wp_customize_register( $wp_customize ) {                  #remove_theme_mod( 's_skin' );                  $wp_customize->add_setting(                  's_skin',                  array(                     'default'    => '',                     'type'       => 'theme_mod',                     'capability' => 'edit_theme_options',                 )             );                  #show($color_theme_names);                  $schemes = array();             $choices = array();             foreach ( $this->color_themes as $color_theme ) {                      $schemes[$color_theme] = array(                     'value' => $color_theme,                     'label' => ucfirst( $color_theme ),                     'thumbnail' => get_template_directory_uri() . '/images/color-theme-thumbnails/' . $color_theme . '.png'                 );                      $choices[ $color_theme ] = ucfirst( $color_theme );             }                  $wp_customize->add_section(                 's-color-themes',                 array(                     'title'     => 'Color Themes',                     'priority'  => 1,                 )             );                  $wp_customize->add_control( 's_skin', array(                 #'label'    => __( 'Color Scheme', $this->plugin_slug ),                 'section'  => 's-color-themes',                 'settings' => 's_skin',                 'type'     => 'radio',                 'choices'  => $choices,                 #'priority' => 5,             ) );              }              public function get_color_themes() {                  $color_theme_files = glob( get_stylesheet_directory() . "/style-*.css" );                  if ( empty( $color_theme_files ) ) {                 return false;             }                  $this->color_themes = array( 'default' );                  foreach ( $color_theme_files as $file ) {                 $this->color_themes[] = str_replace( array( get_stylesheet_directory() . '/style-', '.css' ), '', $file );             }         }     }


title: WP Super Cache separate cache for mobile

text: I'm using the WP Super Cache plugin and inside my theme I have code that executes differently if the site is viewed on a mobile device (iOS, Android) than a desktop browser. How do make WP Super Cache create a separate cache for each, most likely via the user agent? Right now, I have use mod_rewrite to serve cache, which I believe WP Super Cache will cache the pages as html files to be served. Since the cache is saved from the desktop browser, the mobile browser is seeing that as well. I'd like WP Super Cache to generate two separate caches, one of mobile devices and another for desktop browser. Is this something WP Super Cache can handle or is there a better cache plugin I should be using to make this work? Thanks!


title: Modify the array of selected images in media modal

text: I'm creating a plugin which checks for duplicate media items on upload. If a file is uploaded, and it already exists in the media library, I'm presenting the user with the option to delete the uploaded file and insert the existing file instead. In the modal media window (the one that appears when clicking "Add Media" above the post editor) I've got everything working to detect the duplicate file, and offer a checkbox the user can click to delete the duplicate (via 'wp_ajax_save-attachment-compat'). After the user has deleted the new file, I need to find a way to modify the JavaScript array of currently selected media items, to replace the post ID of the deleted file with the post ID of the duplicate, so when the user clicks "Insert Into Post", the correct image will get inserted. Here's the scratch code I'm currently using. This is firing whenever a new selection is made in the default media modal.               ( function( $ ) {              var _AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay;         wp.media.view.Settings.AttachmentDisplay = _AttachmentDisplay.extend({             render: function() {                 _AttachmentDisplay.prototype.render.apply(this, arguments);                 selection = this.controller.state().get('selection').first().toJSON();                 //selection = this.controller.state().get('selection');                      filename = selection.filename;                      attachment = wp.media.attachment(id);  // get attachment with id                      console.dir(filename);                 console.dir(selection);             }         });          } )( jQuery );


title: Getting post-thumbnails from another WP site

text: I have two WordPress installations, one at http://inversekarma.in and the other at http://inversekarma.in/photos. The latter is a photoblog, and its theme uses the standard WP post thumbnails ( **EDIT:** featured images, to be precise!). Is there a way to show the most recent thumbnails from the second site on my first site's sidebar?


title: Infinite loop problem with the WordPress MU Domain Mapping plug-in

text: When I'm logged out, everything works fine. When I'm logged in, I'm unable to visit the front-end of my site. My main page is actually located in a sub-folder of my multisite installation: http://beta.eamann.com/mindshare/. I'm mapping a domain to this installation: http://mindsharestrategy.com/. When I'm logged in, the front-end of my site keeps bouncing back and forth between these two domains. I can still get to the admin side just fine ... but not the front-end. If I log out, I can view the front-end of things just fine. I'm using the development version of the plug-in, as I was instructed to do by several conversations with the developers. Ideas? I should also note that the other sites on this network are not having this issue. They are working properly:   * http://eamann.com -> http://beta.eamann.com/portfolio/   * http://prosepainting.com -> http://beta.eamann.com/creative/ There is no infinite redirect loop here. What can I check to fix the problem?


title: How to use pagination in category list?

text:
Use pagination in function ?                function get_posts_for_cat_ordered( $cats = array(), $posts_per_cat = 2 ) {           if ( empty($cats) ) return false;           $q = new WP_Query( array('posts_per_page' => 99, 'category__in' => $cats) );           $posts_ordered = array();           $done = 0;           while ( $q->have_posts() ) : $q->the_post();             global $post;             $cats = get_the_category();             $cat = array_shift( $cats );             if ( ! isset($posts_ordered[$cat->slug]) )               $posts_ordered[$cat->slug] = array('term' => $cat);             if ( ! isset($posts_ordered[$cat->slug]['posts']) )               $posts_ordered[$cat->slug]['posts'] = array();             if ( count($posts_ordered[$cat->slug]['posts']) == $posts_per_cat ) {                $done++;                if ( $done == count($cats) ) return $posts_ordered;                continue;             }             $posts_ordered[$cat->slug]['posts'][] = $post;           endwhile;           wp_reset_postdata();           return $posts_ordered;         }      use               $cats = array(12, 13, 14);     $posts_per_category = 2;     $posts_ordered = get_posts_for_cat_ordered( $cats, $posts_per_category );          if ( ! empty($posts_ordered) ) { foreach ( $posts_ordered as $loop_data) {          // Example category heading       echo '
' . $loop_data['term']->name . '
';       global $post;       foreach ( $loop_data['posts'] as $post) {         setup_postdata($post);     ?>                   <?php the_title(); ?>
       <?php the_content(); ?>
          <?php       }       wp_reset_postdata();          } }


title: Widget checkbox array empty on update function

text:
I have a widget that is not passing checkbox state to $new_instance, specifically $instance[ 'posts' ]; if I dump $new_instance in the update function it is empty? All the other instance variables are fine and as expected?                 /**          * Ouputs the options form on admin          *          * @param array $instance The widget options          */         public function form( $instance ) {                  if ( isset( $instance[ 'type' ] ) ) {                 $type = $instance[ 'type' ];             }             else {                 $type = __( 'Select Type', 'text_domain' );             }                  if ( isset( $instance[ 'icon' ] ) ) {                 $icon = $instance[ 'icon' ];             } else {                 $icon = __( 'Select Icon', 'text_domain' );             }                  if ( isset( $instance[ 'title' ] ) ) {                 $title = $instance[ 'title' ];             } else {                 $title = __( 'New title', 'text_domain' );             }                  if ( isset( $instance[ 'posts' ] ) ) {                 $theposts['posts'] = $instance[ 'posts' ];             }                  ?>
             <label for="<?php echo $this->get_field_id( 'type' ); ?>"><?php _e( 'Type:' ); ?>              <select id="<?php echo $this->get_field_id('type'); ?>" name="<?php echo $this->get_field_name('type'); ?>" class="widefat" style="width:100%;">                 <?php                $types = array('Select Type', 'rental' => 'Rental', 'cloud' => 'Cloud', 'konnect' => 'Connect', 'support' => 'Support');                 foreach($types as $type => $v) { ?>                      <?php if ( isset( $instance[ 'type' ] ) ) { ?>                     <option <?php if ( $instance['type'] == $type ) echo 'selected="selected"'; ?> value="<?php echo $type; ?>"><?php echo $v; ?></option>                 <?php } else { ?>                     <option  value="<?php echo $type; ?>"><?php echo $v; ?></option>                 <?php } ?>                  <?php } ?>                   </select>

             <label for="<?php echo $this->get_field_id( 'icon' ); ?>"><?php _e( 'icon:' ); ?>              <select id="<?php echo $this->get_field_id('icon'); ?>" name="<?php echo $this->get_field_name('icon'); ?>" class="widefat" style="width:100%;">                 <?php             $icons = array('Select Icon', 'monitor', 'users', 'switch', 'cloud', 'arrows-ccw', 'user', 'user-add', 'link', 'lock', 'thumbs-up', 'upload-cloud','login','database','install','lifebuoy','signal','network');                 foreach($icons as $ico) { ?>                      <?php if ( isset( $instance[ 'icon' ] ) ) { ?>                     <option <?php if ( $instance['icon'] == $ico ) echo 'selected="selected"'; ?> value="<?php echo $ico; ?>"><?php echo $ico; ?></option>                 <?php } else { ?>                     <option  value="<?php echo $ico; ?>"><?php echo $ico; ?></option>                 <?php } ?>                      <?php } ?>                   </select>

             <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?>              <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />

                 <label for="<?php echo $this->get_field_id( 'posts' ); ?>"><?php _e( 'Post to show:' ); ?>
                      <?php                 if ($instance ['type'] == 'konnect') {$instance ['type'] == 'konect';}                 $newargs = array('posts_per_page' => -1, 'post_type' => $instance[ 'type' ], 'post_parent' => 0,);                 $specificposts = get_posts( $newargs ); ?>                      <?php foreach($specificposts as $name => $specificpost) {  ?>                               <?php if ( in_array( $specificpost->ID, $instance[ 'posts' ] ) ) { ?>                         <p class="<?php echo $specificpost->ID; ?>"><input type="checkbox" name="<?php echo $instance[ 'posts' ][$specificpost->ID]; ?>" value="<?php echo $specificpost->ID; ?>" checked="checked" /> <?php echo $specificpost->post_title; ?>
                     <?php  } else { ?>                         <p class="<?php echo $specificpost->ID; ?>"><input type="checkbox" name="<?php echo $this->get_field_name('posts'). '['.$specificpost->ID.']'; ?>" value="<?php echo $specificpost->ID; ?>" /> <?php echo $specificpost->post_title; ?>
                     <?php }  ?>               <?php } ?>
                          <?php }


title: A include_template Question

text: Right now I am building virtual pages on a wordpress install. I use the include_template hook to add some logic that checks for a 404 page & some regex to look for a specific pattern. This seems horribly inefficient. If my plugin is doing this, and other plugins are doing this, arn't we all just adding tons of code to be parsed every single time a page loads on the website? What happens when my plugins grows enormously. This system of hooks is terrible. Am I doing this right?


I'm loading some posts using this argument:               $args = array(      'category__in' => $catID,      'category__not_in' => 1,      'posts_per_page'=>10,      'date_query' => array( array( 'before' => get_the_date() ) )     );      The problem I'm having is that I want to include the actual post I'm on, this carries on after the current post. I've tried adding `'offset'=>-1` but that doesn't seem to work. How can I load posts starting from, and including, the current post? **Edit: I've tried using`inclusive` but it didn't seem to work.**               <? php     $args = array(         'category__in' = > $catID,         'category__not_in' = > 1,         'posts_per_page' = > 10,         'date_query' = > array('before' = > get_the_date(), 'inclusive' = > true));     $loop = new WP_Query($args);     while ($loop - > have_posts()) {         $loop - > the_post();         get_template_part('sidebar-posts-template');     }     wp_reset_postdata(); ?>


title: How d0 i get the number of attachments in the post

text: Is there a function that allows me to get the number of photo's attached to a post and that also grabs the url of the first attachment to go to the attachment page for each post? Here is an example of what i want to accomplish, that i did in photoshop ![enter image description here](http://i.stack.imgur.com/nP6PI.jpg) Do you see the number sixteen next to the thumbnails, thats what i want to accomplish, a code that allows the users to know how many photo's are attached to the current post they are reading and also have the number work as a link. I want the link to grab the first photo attachment url. My attachment are set up like this > /year-month-day/post-title/attachment Is this even possible?


title: Restoring from a Backup after Update

text: I recently updated a WP site from 3.0.1 to 3.3.1. The site has been having a lot of problems since the update. I want to restore the site to a version I backed up right before updating. I used the EZPZ OCB plugin to backup the site. Is restoring it as simple as deleting the current server files and then uploading the backup via FTP? Thanks


title: qTranslate slows down my website

text: When the qTranslate plugin is activated, my website is very slow. If the plugin is deactivated, the website opens faster. How can I speed up the website with the plugin activated?


what's the best way to add a class to the div with a class of post every 4 seconds using jquery?

Headline News Part 2

testing new content

Headline News Part 2

testing new content

Headline News Part 2

testing new content

      so i want the first to have a class of "display" then after 4 seconds, i want to remove the class on that one and add it to the second one. and then after 4 more seconds, remove it from the second and add it to the third. when it gets to the end it loops back around.


title: Permalink Structure not updating .htaccess

text: I am trying to update the permalink structure using the back-end and Settings -> Permalinks. The `.htaccess` file is not updating. I have given `.htaccess` full access with `chmod -R 777 .htaccess` and still, Wordpress says that the permalinks are updating, yet they aren't coming through. When I click, I'm still getting 404s from `apache2`.


title: Trying to only display 1 category using get_posts

text: I'm trying to only display posts from a certain category in a widget. I've tried it in a few different ways but it is still showing posts from all categories. Here's my code at the moment:               $posts = get_posts(array ('category'=>6, 'numberposts'=>$number, 'order'=>'DESC', 'orderby'=>'date'));             foreach ($posts as $post){                 setup_postdata($post);....      Thanks.


title: wordpress get_post_meta / the_meta to output custom field value

text:
What I'm trying to do is quite simple: I want to add a custom field named 'Button' to each post that will show a button (image) on the page with the value as its link. It's basically a button that will show on every post, the link that the button points to will be entered in the value field of the custom field. This is the code I used in single.php:
       <a href="<?php get_post_meta($post->ID, 'Button', true); ?>">         <img src="<?php echo get_template_directory_uri() . '/images/button.png'; ?>" alt="link" />
       The problem is that the output of the value field doesn't appear. The link that supposed to be on the button image is not in place. Instead the button links to the post. This is the website in question: http://digitalmediaboard.com


title: Selecting a post in Dashboard

text: How to make in the admin's dashboard a <select> with the list of all posts of specified post type? I need this in order to save a post ID with `set_option()` call. How to do this?


title: How can I create a "Read More" link using the_excerpt() on a static front page?

text:
I'm working on a website that uses a static front page. It also shows the single most recent blog post. This was achieved by creating a page and using a custom page template. Sometimes, the blog post is too long, so I want to use the_excerpt to automatically shorten it without the need for a more tag. So far so good. But, the_excerpt doesn't actually create a "read more" link. This is a pretty common problem, so I added:               <?php     function new_excerpt_more($more) {         global $post;         return '... ID) . '">continue reading.';     }     add_filter('excerpt_more', 'new_excerpt_more');     ?>      to my functions.php file. I've actually used this code without issue on another site, but for whatever reason, it's not working in this case. My initial guess was that it was because it's being called on a static page. The website is http://stuandjessproductions.com. The theme is Central by QODE, and I'm using a custom child theme. **EDIT** Adding code from the template page, as per request. This isn't the whole page, but rather just the relevant bit for the news post:               <?php $query = "showposts=1&orderby='date'"; query_posts($query);?>     <?php if(have_posts()) : while ( have_posts() ) : the_post(); ?>         <a href="<?php the_permalink();?>"><?php the_post_thumbnail('home'); ?>
Latest News

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


title: Email notification of new post includes code

text: One of my subscribers gets the following words at the beginning of the email of my latest post. Then part way through the post there is another string of code and further along there is another string of code. I signed up also via the link on my blog to get email notification of my own new posts and my email doesn't show this code??? > **The Company Header**   >  by Company Owner >   >   >     Normal >     0 >     false >     false >     false >     EN-CA >     X-NONE >     X-NONE >     /* Style Definitions */ >     table.MsoNormalTable >     {mso-style-name:"Table Normal"; >     mso-tstyle-rowband-size:0; >     mso-tstyle-colband-size:0; >     mso-style-noshow:yes; >     mso-style-priority:99; >     mso-style-qformat:yes; >     mso-style-parent:""; >     mso-padding-alt:0cm 5.4pt 0cm 5.4pt; >     mso-para-margin:0cm; >     mso-para-margin-bottom:.0001pt; >     mso-pagination:widow-orphan; >     font-size:11.0pt; >     font-family:"Calibri","sans-serif"; >     mso-ascii-font-family:Calibri; >     mso-ascii-theme-font:minor-latin; >     mso-fareast-font-family:"Times New Roman"; >     mso-fareast-theme-font:minor-fareast; >     mso-hansi-font-family:Calibri; >     mso-hansi-theme-font:minor-latin; >     mso-bidi-font-family:"Times New Roman"; >     mso-bidi-theme-font:minor-bidi;}


title: anchor tag in header not working on other pages except the home page

text: I have a anchor tag that wraps around my logo image that takes you back to the home page using the following `<a href="<?php bloginfo('url'); ?>"><img src="<?php bloginfo('template_directory'); ?>/images/logo.png" alt="Good Morning Moon"/></a>` It is inside my header.php file. On my home page which is a staid page set to custom template with the following code it works               <?php     /*     Template Name:Home Page     */     ?>     <?php get_header(); ?>          <?php get_footer(); ?>      However on any of my other pages which are using the default template which I assume is the index.php file I have setup based on looking at the http://codex.wordpress.org/Template_Hierarchy the anchor tag does not show up, my index.php file looks like so               <?php get_header(); ?>     <?php get_footer(); ?>      What could be causing this?


title: wp_update_post not working

text: I have the following code in a single script to be run one time to fix post names which are empty.               // WP_Query arguments     $args = array (             'post_type'              => 'books',             'name'                                   => '',             'post_status'            => 'publish',             'posts_per_page'                 => -1,     );     add_filter( 'posts_where', 'custom_posts_where' );     echo "1";     // The Query     $query = new WP_Query( $args );     echo "2";     $germanizer = new Germanizer();     // The Loop     if ( $query->have_posts() ) {             while ( $query->have_posts() ) {                     $query->the_post();                     // do something                     $seo_slug   = seo_slugs( $germanizer->sanitize_title_filter( $post->post_title ) );                     // check the slug and run an update if necessary                     if ( $post->post_name != $seo_slug ) {                             wp_update_post(                             array (                                     'ID'        => $post->ID,                                     'post_name' => $seo_slug                             )                             );                     }             }     }          function custom_posts_where( $where ) {         remove_filter( current_filter(), __FUNCTION__ );         if( FALSE === strpos( $where, 'post_name' ) ) {             $where .= sprintf( " AND %s.post_name = '' ", $GLOBALS['wpdb']->posts );         }         return $where;     }          // Restore original Post Data     wp_reset_postdata();      I have included `wp-config.php` so that is not the problem. In fact the script executes without any error on my local development environment (MAMP) and prints `2` but does not update the `post_name`. But on my test env, it echoes only `1` without any error and it naturally does not update the `post_name`. The total number of posts on my test env is around 5k, so I wonder if that is the reason. This code uses Germanix Plugin by @toscho and might be relevant information.


title: Shortcode attributes don't appear?

text: I'm working on my first shortcode, examples in Shortcode API are not suitable for starters, so I'm almost sure I'm doing it wrong! My shortcode:               function hello( $atts ) {             extract( shortcode_atts( array(             'foo' => 'something',             'bar' => 'something else',             ), $atts ) );                 return 'Hello, World!';            return $foo;        }          add_shortcode('hw', 'hello');      And I want [hw foo=HEHEHE] to output: Hello, World! HEHEHE. But it displays only Hello, World! How to access & echo shortcode attributes and eventually how to set the default value (I guess I've already set the default values to "something" and "something else" but I'm not sure since I have no idea how to output them.


title: Forcing Wordpress Administration onto a separate SSL Host

text: I've inherited a half-dozen or so wordpress sites. In a perfect world I would just put every one of them behind SSL throughout but I don't quite have enough IP addresses to go around and SNI will cut off windows XP users which is a non-starter. The next best thing would be to at least centralize the admin functions behind a SSL-only site. So, what I'd like to do is something like:   * front-end site is http://www.example.com   * back-end sites end up at https://ssl.example-secured.com/wordpress/$SITE There is a plugin which would let you force https for admin (http://wordpress.org/plugins/wordpress-https/) but it seems to require you stay in the same URL depth which won't work as I want to do this for a half- dozen or more wordpress sites and they can't all be at https://ssl.example.com/wp-admin Any ideas how to make this happen? I'll add we are moderately comfortable with hacking things in PHP, including the wordpress core, if need be. And we've got kooky CI / versioning schemes going on that make said hacks less painful. While I understand the general "wp-way" would be to use multi-site here we really don't want to go down that path. Is there a way to do this that does not involve multi-site?


title: Moving blog and maintaining current permalinks

text: I currently have a blog at http://thinkfuture.com/cfs . Its running WP 3.1 on IIS on a dedicated Windows 2003 server. I have the domain freedombunker.com redirecting to the blog at that URL. According to my SEO company, I would like to move my blog so that: 1. You can reach the home page if you use http://freedombunker.com 2. The permalinks which pointed to thinkfuture.com/cfs continue to work For example, a post at this current permalink http ://thinkfuture.com/cfs/index.php/2011/02/23/obama-welcomes-high-gas- prices/ should remain available as well as at the new permalink http ://freedombunker.com/index.php/2011/02/23/obama-welcomes-high-gas-prices/ so either permalink can work. Is this doable? Possible? A pipe dream? Can you run the same blog at two different permalinks with no pain and suffering? Can I just create a new virtual server on the Windows box and point to the wp directory on the first server? Thanks...Chris


title: Custom Widget function in Plugin not working?

text: I took a code straight out of one of my themes I created, and it's a list of all 50 states in an unordered list packed into a widget you can just drag and drop on the sidebar. The problem is, when I try using this code in a PLUGIN file, I get the following error: `Fatal error: Call to a member function register() on a non-object in C:\xampp\htdocs\wordpress\wp-includes\widgets.php on line 431` Why would it work in the theme, but not in the plugin? By the way, the active theme is NOT the theme I took the code out of. Here's my code: http://pastebin.com/ZeRWW3yb Thanks.


title: Wordpress Custom Post Type Filter not Working

text: I am pretty new to Wordpress and I have a problem with a filter in custom Post types.. See screenshot here of what I mean: ![enter image description here](http://i.stack.imgur.com/SvE1P.png) Here is the code I am using for the filter               public function jobs_by_codes( $show_counts = 1, $hierarchical = 1, $show_uncategorized = 1, $orderby = '' ) {         global $typenow, $wp_query,$wpdb;              if ( $typenow != 'job_listing')             return;              $r = array();         $r['pad_counts']    = 1;         $r['hierarchical'] = $hierarchical;         $r['hide_empty']    = 1;         $r['show_count']    = $show_counts;         $r['selected']     = ( isset( $wp_query->query['job_code'] ) ) ? $wp_query->query['job_code'] : '';              $r['menu_order'] = false;              if ( $orderby == 'order' )             $r['menu_order'] = 'asc';         elseif ( $orderby )             $r['orderby'] = $orderby;              $terms = get_terms( 'job_code', $r );              if ( ! $terms )             return;              $output  = "<input type='text' name='job_code' id='input_job_code' value='' placeholder='Jobk Code'/>";              echo $output;     }      Please is there anything I can doing wrong?


title: Users uploaded image and matching an id or taxonomy

text: I have many posts with a unique reference for a custom field [123456], over time I would like an administrator to upload a single image that matches the custom field ie > 123456.jpg I would then like to use a condition in the loop that says if file exists (123456.jpg) that matches the custom field (123456) then use that image for all posts with that custom field... I cant use the Media library because the folder structure is chronological, is there another way?


title: Content not showing up when using custom template + sidebar

text:
I am working on a user dashboard for my site using wp user front end and Mingle. I decided the best way to integrate this is by creating a custom sidebar and using that in a new template, which I did. However.. None of my content is showing up and it's driving me nuts. sidebar-dashboard.php * * *               <?php     /*** The Sidebar containing the dashboard links **/     ?>          <?php     if ( is_active_sidebar( 'dashboard-sidebar' ) ) : ?>

                    <?php dynamic_sidebar( 'dashboard-sidebar' ); ?>

     <?php endif; ?>      * * * dashboard.php * * *               <?php     /*     Template Name: User Dashboard     */     ?>               <?php get_header(); ?>

                    <?php get_sidebar( 'dashboard' );?>     <?php get_footer(); ?>      * * * functions.php... * * *                   // Area 7, the sidebar for the dashboard panel     register_sidebar( array(         'name' => __( 'Dashboard Sidebar', 'twentyten' ),         'id' => 'dashboard-sidebar',         'description' => __( 'The dashboard sidebar', 'twentyten' ),         'before_widget' => '
',         'after_widget' => '
',         'before_title' => '
',         'after_title' => '
',     ) );      * * * So then I go and make all the dashboard pages have the "User Dashboard" template expecting that the sidebar would be on the left and the content would be on the right, but that's not the case. The sidebar shows up but no content whatsoever. What am I doing wrong? * * * Edit: Also, if someone knows any PHP hooks for Mingle that I can use in template pages that would be great, I can't find any documentation on it and they haven't answered me. It's not really a fix to the core issue, but it's a cheap way around it. For WP User Frontend I can just use the do_shortcode function, but Mingle doesn't even seem to have any shortcodes.


title: Query_posts works when appending via AJAX call wp_query doesn't?

text: I'm appending some posts on a click event to a twentyeleven child theme. For some reason though it only works when I use the query_posts loop and not a wp_query loop. For instance here's my wp_query loop:               $args = array('year' => $year,'monthnum' => $month);     $loop = new WP_Query($args);     if($loop->have_posts()) {      while($loop->have_posts()) {      the_post();     echo get_template_part( 'content');     }      } wp_reset_query(); //doesn't work      Then here's the query_posts:               query_posts(array(            'year' => $year,            'monthnum' => $month     ));          // our loop     if (have_posts()) {     while (have_posts()){     the_post();     get_template_part( 'content');            }     }     wp_reset_query();      I've been told to avoid query posts like the plague so I'd rather use wp_query. Any thoughts on why this is happening?


title: How can I create an "excerpt" with text that won't be displayed in the post itself?

text: I'm currently creating a new theme for my blog and I intend to make it in a magazine style manner. So, to clarify the question in the title: what I want to do is to create a text assigned to the post, but not displayed in the post itself. Lets say that the user Tom writes a review of the movie Black Swan - what I want to be able to do is summarize that review in a sentence or two - and use that text as an "excerpt" on the front page. Any ideas? It's probably a lot harder than I think it is.


title: Custom field values repeating

text:
I'm at a loss. I've got a custom meta box with the 'multicheck' code that Jan created. It's working great. My issue now is getting the data to return properly. Scenario: there are 5 possible values, each with the same meta_key. What I am trying to do is display specific content if a value is stored with one of the 5 possible values. What is happening is that the content is repeating. Current site: http://dev.andrewnorcross.com/yoga/locations/tampa/ Current code:                   <?php         global $post;     $offerings = get_post_meta($post->ID, "evol_offerings_select", false);     if ($offerings[0]=="") { ?>                    <?php } else { ?>

offerings:
                 <?php                  foreach ($offerings as $offering) {                     if ($offering["hot"]==true) {                         echo "
";                         echo "
Hot 90
";                         echo "
temp: 105°   time: 90 min
";                         echo '
';                     }                     if ($offering["flow"]==true) {                     echo "
";                     echo "
Flow 75
";                     echo "
temp: 80°   time: 75 min
";                     echo '
';                     }                     if ($offering["warm"]==true) {                     echo "
";                     echo "
Warm 60
";                     echo "
temp: 90°   time: 60 min
";                     echo '
';                     }                     if ($offering["chill"]==true) {                     echo "
";                     echo "
Chill 30
";                     echo "
temp: 75-80°   time: 30 min
";                                         echo '
';                     }                     if ($offering["kids"]==true) {                     echo "
";                     echo "
Kids Class
";                     echo "
temp: comfy   time: 60 min
";                     echo '
';                     }                     } ?>


title: Custom permalink structure for custom post type

text: I´m using the following code to create a new post type:               /* Create custom post type: "Tilbud" */     register_post_type('tilbud', array(     'label' => __('Tilbud'),     'public' => true,     'show_ui' => true,     'capability_type' => 'post',     'hierarchical' => false,     'rewrite' => array('slug' => '???'),     'query_var' => false,     'taxonomies' => array('post_tag','category'),     'supports' => array('title'),     'register_meta_box_cb' => 'add_tilbud_metaboxes',     ));      I would like the premalink of these custom posts to contain the custom post type name followed by the post category: .../custom-post-type-name/post-category/post-title/ I´m aware that I use the rewrite argument to add a slug, but I don´t know what to write in order to insert the post type name and category name dynamically. Any ideas? Thanks!


title: Making pages also serve as taxonomies? Or give full pages to taxonomies?

text: I run a video game news blog. When my staff writes a news article or a review, I would like them to be able to "assign" that post to a game (if applicable), so then I could have the single.php template call information on that game (title, boxart, publisher, release date, etc.) and display it in the sidebar. I thought this might involve a custom taxonomy so that it could be assigned to a post just like tags are. But then I realized I also wanted those games to have full pages loaded with information. I initially thought to create a custom post type for pages, and using custom fields, I could call the game's box art, show its release date, display any posts or reviews on that game and displaying them with brief excerpts, and using custom taxonomies to display the game's publisher, developer, etc... And THEN I realized I also wanted those publishers and developers to have their own pages as well. Description, location, links to articles involving them, lists of any games attributed to them... and so on. None of these can be child pages of the other, since developers aren't always permanently tied to any particular publisher, games are sometimes co-developed by multiple parties, etc. I'm in a pickle, and can't figure out how to re-organize my site. I really want to use all the new toys in WordPress to make the site I want, rather than WP limiting what I can do. Any suggestions? I've been brainstorming for days trying to figure something out. Any suggestions would be appreciated.


title: Custom comment type based on thread level

text: I'd like to create a custom comment type based by thread level. The initial comment on a given post (top tier comment) would require the commenter to enter a title (I assume this would be a new database field since comments don't typically have titles) and then enter the comment in the typical comment body field. However, f someone were to reply directly to this comment (2nd tier comment) then they would be presented with the standard comment box that does not require a title. Would something like this be possible in WP via creating a custom plugin, etc? Much appreciated. Eddie


title: Custom post types with custom directories

text: I'd like to run a WordPress install with open registration so that anyone can sign up and post to a custom post type that would live at... domain.com/open/date/the-post-title I'd also like to run a blog on the same WP install that only I can post to that would live at... domain.com/blog/date/the-post-title Is something like this possible without running MultiSite (which I believe would force the blog to live at blog.domain.com)? Thanks. Eddie


title: How to verify this checkbox is checked?

text: Actually I want to include a file if the checkbox is checked               <?php     $checked = get_option('automatic') ? "checked='checked'" : "";     echo "<input type='checkbox' name='automatic' $checked />";     ?>          if(get_option('automatic') == 'checked')) ( require_once 'myfile.php'; )      This form is in a plugin option page


title: MultiPostThumbnail and the_post_thumbnail

text: I am using `built-in` Wordpress function to add (small) thumbnails to each post. In addition to the post thumbnail I am using **MultiPostThumbnail plugin** to add custom category (large) image. Since not all posts have thumbnails or "secondary image" (as it is called by MultiPostThumbnail plugin) I would like to display thumbnails (either large or small) in this order:   1. If I a post has large (MultiPostThumbnails) thumbnail and ( **small** ) thumbnail display only ( **large** ) thumbnail.   2. If a post doesn't have a ( **large** ) thumbnail display the ( **small** ) thumbnail. I hope now it makes more sense. It's a simple if statement but I can't get it to work. Here is a "pseudo-code".               <?php if (class_exists('MultiPostThumbnails')        && MultiPostThumbnails::has_post_thumbnail('post', 'secondary-image')) :           MultiPostThumbnails::the_post_thumbnail('post', 'secondary-image', NULL,  'post-secondary-image-thumbnail');     else {        the_post_thumbnail();     }     ?>


title: Try to run a function only on Home

text: I'm trying to run disable auto p filter on only my home page. In my functions.php file, I added this snippet:               function removeP(){         if ( is_page( 4 ) ) {             remove_filter('the_content', 'wpautop');         }     }          add_action( 'after_setup_theme', 'removeP' );      It does not remove the filter on the homepage.


title: Custom taxonomy or custom page templates?

text: I'm trying to decide whether it would be more appropriate to create two new custom taxonomies or if custom page templates would be easier. Here's the scenario:   * I have 2 custom posts types: "Cocktail Recipes" and "Distilleries"   * I have roughly 10 terms in the custom taxonomy "Alcohol Spirits Types" and both custom post types use this taxonomy. The number of these terms is unlikely to grow.   * I need 3 archive pages for each Alcohol Spirit Type term. One that displays results from both custom post types, one that displays results only from Cocktail Recipes and one that displays results only from Distilleries (e.g. Whiskey, Whiskey Cocktail Recipes and Whiskey Distilleries). Should I: 1. Create two new custom taxonomies. One would be specific to Cocktail Recipes and the other specific to Distilleries, but both would have identical terms to the already created Alcohol Spirit Types taxonomy. I could then use the taxonomy-custom_taxonomy_name.php template to create the pages. Or... 2. Create two custom page templates (one for Alcohol Spirits in Cocktail Recipes and the other for Alcohol Spirits in Distilleries) and two pages for each Spirit Type (roughly 20 pages total). To me, option 2 makes more sense because then I'm not duplicating terms in three different taxonomies. Also, a post editor would only need to tag a post twice. If the number of terms were larger this solution would be a huge task initially, but creating only 20 pages seems reasonable. What do you think? Is there an easier way I'm not thinking of?


title: Redirect URL Containing åäö

text: I'm moving my blog from Typepad to Wordpress but have a big problem. Among the urls that are exported from Typepad, many containing åäö. When they are imported WordPress changes all URLs and instead contains aao. I need help with how to redirect all urls that contains åäö to the new urls. It's a total of about 1300 urls. I am not a "hacker" and need a detailed description how I should do :)


title: Custom loop by url

text: So currently I have this working for 'search' ie: if I do www.domain.com/search/query, it returns everything it finds on the word 'query'. I would like to utilize that loop/template I created within that search.php but change it to posts. Then query a specific post category if possible ie: www.domain.com/posts/category1 I'm think it all stems off changing               <?php get_template_part('loop', 'search'); ?>      Fairly new to wordpress so any help or suggestions is greatly appreciated!


title: Where is dynamic_sidebar content defined?

text: A friend has asked me to edit a WordPress site that someone else has made for them. Part of it contains the following code:               dynamic_sidebar('footer4')      Which spews out a contact form. What I want to know is, is there an easy way for me to find out where the function that returns the HTML this contact form is defined? For example, if there was actually a function called 'footer4', I could do this:               // I've tried this and it doesn't exist;)     $reflFunc = new ReflectionFunction('footer4');     print $reflFunc->getFileName() . ':' . $reflFunc->getStartLine();      I've looked through all the template files and couldn't see anything. Any advice appreciated.


title: how to restrict posts_request filter to the main query only

text: I'm trying to run custom sql for search results, and I'm having trouble limiting the filter to the main query without running a redundant query. I'm successfully getting results via the following:               add_filter( 'posts_request', 'my_request_filter' );          function my_request_filter($sql) {         if(is_search()) {             $sql = 'some custom sql query'         }         return $sql;     }      The problem here is that this is affecting other things on the page running queries, like the recent posts widget. I can prevent this by adding 'suppress_filters' => true to the other queries, but that seems a bit backwards, and I'm not going to hack core to add that. the 'pre_get_posts' filter seems more appropriate, in that I can check for is_main_query, but I'm limited in how I can modify the query with this filter - I can't figure out how to entirely replace the query object with one created by a custom sql statement. The least ideal solution would be to simply ignore the main query, and run another one entirely; but the whole point of this exercise was to replace the main query with one optimized for this context.


title: Creating a full business website

text: I have a webservice and I want to sell it and allow the customer to set it up through a website. I'm thinking to use WordPress to make this website, but don't know if it is possible or how to do it. Basically, my webservice needs some information from the customer to work. I mean, after buying our service, the customer will have access to a page and he/she will input some information and submit them (to our server, that will set up the service for that customer). I need the WordPress to save these input information and display them later, whenever the customer access and log-in my website. In other words, I need any user can:   * Buy my service (public area) and then log-in to set it up (private area)   * Save, update and delete input personal information (that only he/she can see/create/update/delete) Can I do this through WordPress? Any idea on how?


title: mp3 audio metadata upload integration: can I autopopulate title, caption, description from id3 tags?

text: I'm using the native Wordpress.org Upload New Media subsystem pretty routinely to upload MP3 files. The MP3 file workflow we use populates the ID3 tags with some important user-friendly metadata. It would be good if the Upload New Media subsystem could populate the title, caption, and description fields for the file in the Media Library automatically. Has anyone created a Wordpress plugin for that specific purpose? If so, which one? If not, is it possible? Any suggestions on how I can proceed to do this?


title: Get newest created custom category (get_term_by and variables) (outside Loop)

text: I am wondering if there is any reason why the following code would not work? My situation: I have a custom category set up called 'Issue'. What I want to do is get the most newly created category (which is 'Volume 2 Issue 1') and get its ID so that I can run the plugin function `z_taxonomy_image_url($currentID);` which outputs a URL based on the category identified by `$currentID` I have a very hacky solution at the moment, but if anyone can figure out why the last 3 lines of the following bit of code doesn't work, it would be fantastic. Alternative and cleaner solutions would also be appreciated.               $taxonomy=wp_list_categories('taxonomy=issue&echo=0&number=1&orderby=ID&order=DESC&show_count=0&style=none&title_li=');     $tax = strip_tags($taxonomy);     $newtax = "'".trim($tax)."'";     $getID = get_term_by('name', $newtax, 'issue');     $currentID = $getID->term_id;      Doing a `var_dump` on `$getID` only results in `bool(false)` The interesting thing is that this code works (but I cannot use it because it would require manually changing the code each time I create a new category).               $getID = get_term_by('name', 'Volume 2 Issue 1', 'issue');     $currentID = $getID->term_id;      Is there something with `get_term_by` that it rejects using `$newtax` but accepts `'Volume 2 Issue 1'` ? If yes, is there a workaround or do I need to look for some other way of doing this? I am not very well versed in PHP and WP codes. I am not afraid of tinkering, but my knowledge is only basics :( Please bear with me. Thank you for your time.


title: How to change post format from Aside to Image for all posts?

text: I have a blog where all the posts had the post format **_Image_**. This morning I see that somehow they have all been changed to **_Aside_**. I'm still trying to figure out how this happened, but in the meantime, how do I go about changing them all back to Image? Is this something I can do with a SQL statement or do I need to write a custom script to loop through all the posts and save them with the Image post format? And if a SQL statement would work, any thoughts on what that might look like? Thanks much, Mark


title: Is there a way to import Blogger into bbPress?

text: I have a blog on Blogger that I would like to turn into a bbPress forum. This is a blog that has essentially been used as a forum, so bbPress is a better solution. Unfortunately, by default bbPress only seems to be able to import from phpBB and bbPress. I imported Blogger into WordPress as posts thinking I might be able to convert the posts to topics, with comments being the replies, but I can't seem to do that either. Is there any way to do this?


title: Redirect to 404.php from single.php

text: I have a situation where I want to redirect the user from single.php to my 404.php How can I do this? I did it like this inside single.php               header("HTTP/1.0 404 Not Found");     header("Location: ".bloginfo('template_url')."/404.php");     exit();      **But when I check the http responses I get a 302 response instead of the 404** **Important: it may not work because I have a post called "cars" which I use to custom generate pages like:**               http://www.mysite.com/cars/bwm     http://www.mysite.com/cars/crysler      The post is just:               http://www.mysite.com/cars/      The rest are just php query strings which were rewrited using add_rewrite_rule. So               http://www.mysite.com/cars/?bmw      is rewrited into:               http://www.mysite.com/cars/bmw      And sometimes the variable bmw is not inside my database, and I want this page to get a 404 response.


title: admin_print_styles incuding $_SERVER['DOCUMENT_ROOT']

text: All the Javascript isn't working in the admin area on my production server. Locally it works fine. I have narrowed it down to /wp-admin/wp-header.php line 72-78               do_action('admin_print_styles');      And all similar ones to these. The only difference on the production server is that I have set up a sym link:               ln -s /current/wp-content/plugins /shared/plugins      The symlink is working fine, I can access files by going to: httt://productionsite.co.uk/wp-content/plugins/pluginname/file.css However, when I view the console I get the following errors: "NetworkError: 404 Not Found - http://productionsite.co.uk/wp- content/plugins/var/www/vhosts/productionsite.co.uk/shared/plugins/wordpress- form-manager/css/style.css?ver=3.2.1" So it is trying to include the wrong file and seems to have something to do with the sym link. Any ideas are appreciated.


title: Custom Author Loop

text: Essentially what I'd like to do is have the same effect as the wp_list_authors tag, but instead of just listing the name or their post count, I want to be able to do a loop with the IDs. Ultimately I'd like have to a page with every author, with their name, description, avatar and link. I can figure out the specifics, I just need a way to do something like:               foreach $author as $author->ID      Thanks in advance, Pete


title: Working with post values in the admin panel

text:
I have this basic admin page functions.php > `<?php include('ui.php'); ?>` ui.php               <?php     function gui()     {         include('gui.php');     }     function add_page()     {         $themename = 'Cesaro';         $page_function = 'gui';         add_menu_page( $themename." Options", $themename, 'edit_themes', $page_function, 'gui' );     }     add_action( 'admin_menu', 'add_page' );     ?>      gui.php               <form name="input" action="post_options_from_form.php" method="post">
             Firstname<input type="text" class="x-input"/>

             Lastname<input type="text" class="x-input"/>

             City<input type="text" class="x-input"/>
         <input type="submit" value="Update Options" class="x-button"/>     </form>      When i click update options,i get the error               The requested URL /wp-admin/post_options_from_form.php was not found on this server.      How do i make sure that post values end up my php i specified in the post action?.My post php file is `post_options_from_form.php`


title: File access different with permalinks on and off

text: I have a page with a link to a file in a password protected folder. When I have permalinks turned off, clicking on the link starts the file download. When I have permalinks turned on, clicking on the link takes me to Page Not Found, however, if I then go to the address bar and press `Enter` the file starts downloading. How can I make it so when permalinks are turned on, the file starts downloading on link click?


title: Fourth page of custom post type archive page does not exist

text:
I recently developed a custom post type for my company's blog, so that we could have a separate press area. In the archive-presse.php page I make a query, thus :               $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;     //echo '
 paged :'. $paged . "
";     $press_articles = new WP_Query(         array(             'post_type' => 'presse', // Tell WordPress which post type we want             'paged' => $paged,             'orderby'   => 'post_date',             'posts_per_page' => '10'             )         );      and at the bottom, I create the navigation links :

<?php previous_posts_link('« Zurück',$press_articles->max_num_pages) ?>

<?php next_posts_link('Weiter »',$press_articles->max_num_pages) ?>

      (Austrian website, in case you were wondering) On the first page, this works fine; the posts appear and so does the navigation links, which points to the second page and so on. On the third page however, when I click on 'Weiter', I end up on the 404 page, although I am sure there are still articles to be shown. My only fix at the moment is to make sure that the posts per page is equal to a third of the total number of posts. Not much of a fix.


title: Make thumbnails in woocommerce replace the main image instead of opening fancybox

text: I would like the thumbnails underneath the main image on the single product page to replace the main image when they are either clicked or on hover, I prefer hover. Right now the thumbnails just open in their own fancybox. This is a very common feature on most big ecommerce sites and it's weird that it's not an option in woocommerce. Any help will be greatly appreciated.


title: Check if post is in draft or pending review?

text: Each of our posts are reviews for individual games and we occasionally have to 'pause' the game by changing it from published to pending review. The problem is if the page is indexed by search engines, anyone trying to visit the link will get a 404, which is obviously not desired. I'd like to instead redirect to a listing of all our games. I can think of a few options but I'm not sure which would be preferred. I could just do a temporary 302 redirect from that post to the game listing page. I'm not entirely sure how this will work for SEO however. I could also do a check to see if the post is pending review (in the 404 page?), and if it is, then display the game listing page. I'm not entirely sure how to go about this. I tried finding a function to check if it's in pending review but didn't have any luck.


title: Show newly added posts since last user login time /date

text: I'm looking for a solution to create a custom loop which will only display the last added/ modified posts since the last user login to the site. It shouldn't be that complicated doesnt it ?


title: Using default WP menu functionality to link to custom post-type listing?

text: I'm completely starting over with a wordpress project that began a couple of weeks ago, and basically i'm totally discovering wordpress, so please bare with me. I might be completely misunderstanding what has been coded until now, but I've been asked to generate a menu based on the "cutom-post-types" and their respective categories. When using the               <?php wp_nav_menu(); ?>      hook, I thought it would be enough. **BUT** : when editing the menu and it's content in the menu admin section it seems that I cannot have each category of a custom post-type to be listed UNDER each custom-post-type. All I can do is select each category, like so : Beauty Campaigns ... shops ... Wich leads to this on the public site : Beauty Campaigns ... Shops ... My only wisgh is to be able to avoid hacking wordpress as much as possible, while finally having : News Beauty Cmpaigns ... Trends shops ... in both the menu admin and the final public menu. What did I miss ? Thanks a lot.


title: How to remove administrator role in settings -> general -> New User Default Role?

text: I don't want to accidentally select Administrator role. So is there a way to remove it from `Settings -> General -> New User Default Role` ?


title: Shortcode to display the latest news article within a page

text:
Could someone help me write a custom shortcode to simply display the latest post anywhere in Wordpress? I've seen a lot of ways how to do this in pure PHP in a custom page template, but if I try to convert it, I always get problems (double display) or completely nothing. It should be just one post (not page) of any kind at all, as long as it's the most recent one. I just need it like this:
Title

Excerpt...
     Read more      I've also looked for some plugins, but that's also problematic. They break all shortcode functionality or they just display a list... Can anyone help me out and score some points? I would surely appreciate it.


title: WP Multisite - multilanguage - swich to other language by click, but "same" content

text: I want to run a WP-multisite for 4 languages (in development), and did it so, 4 blogs, each one got the same content but in a different language, same structure, same pages, same postings, same images. No translation plugin, cause we need and want native translations for out contents. If we publish articles, so we have the articles in 4 languages and post it parallel on this 4 blogs. Is it possible to swich the whole site-content by click? Now we linked to the index of each blog. Thank you. (Sorry for my "great" english)


title: how to get next record from database when wordpress schedule hook runs?

text: favorite I am working on plugin which will work automatically via wordpress schedule hooks. But to do that I need a single record from database and process it and next schedule run, I want to get next single record from database to process. I am using custom table for my data, the table have a primary key with auto increment value. So how can I get next record every time when wordpress schedule hook runs ? I have tried with sessions/php pagination and Its working outside of wordpress but wordpress does not provide session support so I can't use it. I can use $wpdb global class for single record retrieval but I don't have a idea about next record retrieval. I hope I have explained my problem clearly. here is the function which will execute on wp schedule hook:               function ACP_poster($n){             global $wpdb,$api_key;             $row = $wpdb->get_results('SELECT a,b,c FROM tbname ORDER BY id DESC LIMIT 1',ARRAY_A);                  $url = 'https://example.com';                  $headers = array( 'Authorization' => $api_key );             $request = new WP_Http;             $result = $request->request( $url , array( 'method' => 'GET', 'headers' => $headers, 'sslverify' => false ) );             $data = new SimpleXMLElement($result['body']);             $attributes = $data->p->attributes();                  foreach ($data->p[0] as $p)                      {                     // Sanitize data.                     $pr = number_format((float)$p->pr, 2, '.', ' ');                     $image = '{'url2'}.'">{'url3'}                            .'" style="float: right"/>';                     $pd =  $image.$p->description .'-- ='.$p->currency.' '.                            ' ,Retail Price ='.$p->{'retail-price'}.' , '.                            $p->{'sale-price'}.'{'url2'}.                             '">...';                     $v = $c[$no]->child;                     $ids = get_term_by('slug', $v, 'category');//wordpress function                          $id = (int)$ids->term_taxonomy_id;                     $p2 = array('post_title'    => $p->name,                         'post_content'  => $pd,                         'post_status'   => 'publish',                         'post_author'   => 1,                         'post_category'  =>array($id));                     $pr = wp_insert_post( $p2, $wp_error );                          wp_reset_query();  // Restore global post data stomped by the_post().                     }                 }     }


title: Cannot get local avatars to show

text: _See updates below._ I upgraded to 3.7.1 using svn. I did this on my localhost first to make sure everything is fine. Everything was, so I proceeded to do it on the server. However, on the server, the users' avatars are not showing up and instead everyone is getting Gravatar's mystery man. Here is the code I have in my functions.php:               <?php switch ( $comment->comment_type ) :     case '' :     ?>     <p <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">     <div id="comment-<?php comment_ID(); ?>">     <?php echo get_avatar( $comment, 40 ); ?>      When I look at the source of the generated page on my localhost for the above I get the following code:               <img src="http://localhost/[path]/wp-content/uploads/avatars/[a number]/[imagename.jpg]"      On the server when I view source I get the following code for the same user:               <img src="http://gravatar.com/avatar/[alphanumeric]=http://[mywebsite.com]/wp-content/plugins/buddypress/bp-core/images/mystery-man.jpg[code]"      I must be making a mistake somewhere but for the life of me I cannot figure it out. The only explanation I can come up with is that Gravatar is not accepting requests from localhost and that is why it is working the way I would like it to on my localhost. So what do I have to do to make their local avatars show up (the ones they uploaded themselves)? I should also add that I am using the BuddyPress plugin (both on localhost and server). Aside from that, is there a technique people use to compare the files on the server with those on the development machine? Something akin to vimdiff? **UPDATE:** I copied the localhost directory recursively using `cp -r` to another directory. I then rsynced that directory with the remote server making it a mirror of the server. Then I ran `diff -NbBiwr /path/to/localhost /path/to/localhostCopyThatWasRsynced` and received no major differences save for stuff in the `.svn` directories. When I view the copied version in a browser the local avatars show up. This is really starting to make no sense at all. I also updated the sql database to reflect the one on the remote server and the local avatars show up on localhost but not on the remote server. **UPDATE 2:** Here are all the things I attempted since the last update:   1. Toggle `wp-debug` to true. No errors of note.   2. Removed the entire directory, did a new `svn co`.   3. Deactived all other plugins besides BuddyPress.   4. Used the default BuddyPress theme.   5. Installed version 3.6.1 (the last good version I used).   6. Checked and rechecked directory permissions.   7. I removed the avatars directory and when someone tries to upload an avatar it creates the avatars directory and the userid subdirectory but the image does not upload. The subdirectory remains blank. This is the error that is returned on the front end `Upload Failed! Error was: Unable to create directory wp-content/uploads/avatars/1407/avatars/1407. Is its parent directory writable by the server?` As you can see it duplicates the avatars directory and the userid subdirectory for some reason. This happens on both the server and localhost. Localhost is displaying avatars properly however.   8. Tinkered with birgire's suggestions below. Nothing.


title: Number of External Links in Comments - Moderation Option

text: I just ran over a problem to properly use the count of external (meaning no relative or absolute links to my own blog) links on my blog for the _Comment Moderation_ count Option. It's labeled _Hold a comment in the queue if it contains [your number here] or more links. (A common characteristic of comment spam is a large number of hyperlinks.)_ on Settings -> Discussion in the Wordpress Back-end. Screenshot: ![alt text](http://i.stack.imgur.com/cd9Ok.png) I'm aware that currently it counts all links inkl. links to the blog and other comments (reported it here: #14681) but I can't imagine that there isn't a plugin or hack already available that properly corrects the count to only external links. So my question is: Is there a plugin / hack that makes Wordpress properly count only the external links in comments for it's Moderation Options?


title: How would implement StackExchange 'Questions with similar titles' for the FAQ on my wordpress site

text: I want to have a FAQ page on my site which has a search box. As the user types in their question, a field below the search box is populated with FAQ answers with similar titles. The exact same functionality as the StackExchange 'Questions with similar titles' feature: > Questions with similar titles > > 4 Open Source Forum for wordpress similar to stackexchange or stackoverflow > (1) > > 0 How to implement a WordPress comments function? (2) etc...


title: Registering jQuery kills admin functions

text: I recently added the following into my theme's `functions.php`, in order to load jQuery from the CDN:               function my_init_method() {         wp_deregister_script('jquery');         wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js');     }          add_action('init', 'my_init_method');      However, this causes problems with the admin screens, notably the WYSIWYG editor which then refuses to allow HTML mode (via the tab). I get an error:               jQuery is not defined      from the wp-admin/load_scripts.php file. What am I doing wrong?


title: Is it possible to switch the data layer within WordPress?

text: WordPress is undoubtely very customizable using plugins, but every customization possibility surely has limits defined by the underlying architecture. For those familiar with WP architecture and source code: What would be the effort required to customize the data layer used by WP to use another data store (e.g. files (or another database system) instead of MySQL?). Is WordPress architecture layered in the sense of having the possibility to switch layers? The UI layer is apparently very easy to switch (any theme does this), but how about other layers, namely the data layer?


title: Custom per-page sidebar widgets .. possible?

text: Let's say I'm doing a site about cars, and in the main content area of a Page (using a certain template), there are a few paragraphs about a particular car. In the sidebar, are several standard widgets. But I also want a widget with an 'info panel' about the particular car. So what's the sanest way of putting in a per-page widget in Wordpress? I guess ideally the info-panel could be entered via the standard page editing in Wordpress .. perhaps via the Custom Fields, so you could enter "Volvo" for the Manufacturer field and it would show up in the sidebar. (or is this something a plug-in already covers?)


title: Main Menu Theme Different Output Print

text:
I am currently developing a wordpress theme that has a tricky main navigation menu. The problem I am stuck with is that I am looking for a special print of the submenu. Here is the html I am trying to achieve in my theme:

Menu Item 1

Menu Item 2

Menu Item 3

Submenu Item 1.1

Submenu Item 1.2

Submenu Item 1.3

Submenu Item 2.1

Submenu Item 2.2

Submenu Item 2.3

Submenu Item 3.1

Submenu Item 3.2

Submenu Item 3.3

           What's the best approach to achieve that?


title: WooCommerce custom taxonomy as meta?

text: I have created two custom taxonomies: (slug) = language (slug) = location On the single product page I would like to display these two as meta below the "Categories" and "Tags." Example: ![screenshot](http://i.stack.imgur.com/ypZ76.jpg) I found that the meta is displayed by `/wp- content/plugins/woocommerce/templates/single-product/meta.php` I copied this files under my theme `/wp- content/themes/mytheme/woocommerce/single-product/meta.php` and added the following after the categories and tags, before the               <?php do_action( 'woocommerce_product_meta_end' ); ?>      It doesn't work because I think the "`echo $product->get_terms`" doesn't actually get the custom taxonomy.                    <?php         $size = sizeof( get_the_terms( $post->ID, 'language' ) );         echo $product->get_terms( ', ', '' . _n( 'Language:', 'Languages:', $size, 'woocommerce' ) . ' ', '.' );     ?>          <?php         $size = sizeof( get_the_terms( $post->ID, 'location' ) );         echo $product->get_terms( ', ', '' . _n( 'Location:', 'Locations:', $size, 'woocommerce' ) . ' ', '.' );     ?>      Is there a pre-made function to call a custom taxonomy, such as "get_taxonomyslug"? I tried but it didn't work. Or do I have to define them by myself? If someone could help with code or some pointers it would be great. Please include file location with each code snippet as I am still quite new to this and might not know where to put them.


title: Create custom template in plugin and display it into post template section?

text: Right now i am developing a plugin for one of my client according to their need. But I want the plugin hold all the functionality itself including the custom template. I mean my plugin holds the custom template but i don't know that if the template display on the admin post/page section. Is it possible to display custom template on admin post/page section through plugin? If yes then how? Your help is highly appreciated. ## UPDATE: I have achieved this with old method like create a separate custom template for my plugin so that admin can select the template for the desired plugin. I don't want to provide two separate files for my client, one for plugin and second for theme :(


title: How to detect that site is hosted on WPEngine?

text: Is there anyway to detect that WordPress is hosted on WPEngine? The reason why I need to know it in their approach to eliminate cookies. But my plugin relies on cookie and can't work without it. So I need to not run the plugin on WPEngine hosting. Any thoughts?


title: function wp_insert_post and wp update_post_meta

text: how combine wp_insert_post and wp update_post_meta? i need first insert post, then update post, let me know about example? i want sample for my future project Thanks


title: Importing Squarespace blog into Wordpress.org

text: I had a blog on Squarespace 6. I followed the instructions to Export the Squarespace journal into a `xml` file. I then followed the instructions to Import the `xml` file into WordPress.org as a movable type file. The Import appeared to complete correctly however, when I am looking at the WordPress.org dashboard, I cannot find anything that appears to be the imported text and photos from my Squarespace blog. Does anyone have any suggestions on how to find my Imported blog while I'm working in WordPress?


title: Add credit to get_custom_header in alt

text: Been hunting for a while and I can't figure out how to use `get_custom_header` to get the alt text associated with the media file, so that I can add photo credits to the headers on my site. Am I missing something? Code to add header image is:               <img src="<?php header_image(); ?>" height="<?php echo get_custom_header()->height; ?>" width="<?php echo get_custom_header()->width; ?>" alt="" />      The `get_custom_header` function doesn't seem to have a way to pull in the alt text.


title: I'm having a lot of trouble since upgrade to 3.0.1 with get_page_children() function

text: I use the get_page_children() function to create a sub_nav for a designer client I do work for. She uses the Spry Assets flyout JS that DreamWeaver creates, so I have to manually do the menus like this rather than use the new menus functionality in WordPress. I had them all set up and working perfectly, and then my client upgraded to 3.0.1 and somehow she says that broke them. I'm not sure if it happened then or if it was something else that caused the break. I've narrowed down the problem. The Codex says you need to get a list of all page objects to use for this function. You use a "query" function I've never seen before. http://codex.wordpress.org/Function_Reference/get_page_children               $my_wp_query = new WP_Query();     $all_wp_pages = $my_wp_query->query(array('post_type' => 'page'));      Those 2 lines should generate an array of all of your page objects that is usable by get_page_children() later. However, it's not working anymore because $all_wp_pages _ISN'T_ all of my pages. I have 38 pages on this site, and when I do an output of the $all_wp_pages array, I only get 10 pages. Anyone have any idea why that would be happening? The 10 pages that do show up all happen to be ONE page and its children. But they show up no matter what page you're on. It's really bizarre. Thanks!


title: How to display a shortcode caption somewhere other than the_content

text: I want to disable shortcode captions for posts in one of my themes, and display the content elsewhere, such as in a sidebar. The images aren't uploaded to wordpress, but they're linked-to using the post editor's add an image -> from URL functionality resulting in the following shortcode:               [caption id="" align="alignnone" width="300" caption="Leonard Nimoy has done far more thing than just play Mr. Spock"][/caption]      Any thoughts? I'm assuming using a filter on `img_caption_shortcode` somehow, but I don't know if that's the way to approach this.


title: Are captions stored anywhere?

text: In regards to my previous question about shortcode captions, it doesn't appear to me that the actual text of a caption is stored anywhere other than in the post content within the shortcode itself. I would have thought that `wp_get_attachment_metadata` would store the info for an attachment, but it doesn't. Am I wrong? Or does WordPress not store the actual caption anywhere?


title: How do I hide tags that have only been used once?

text: I'm looking to modify my theme so that only tags that have been used more than once show up on the site. Here's my logic, feel free to fault any (and all) of it:   1. There is no point in only using tags once. All the tag will do is link to a tag archive with one post.   2. However, I'd still like to tag my first post about unicorns with `unicorn`.   3. That way, when I post about unicorns for the second time, the tag will suddenly appear on both posts. I know a bit about WordPress and how it works, but not enough to do this. Should it be a plugin? Is there a function option/parameter/thing I've missed that does this? I seem to remember a database field that counts the number of times a tag is used, how does that help? Thanks!


title: show posts names and links in the sidebar list as categories child

text: i'm using this plugin to show an exapandable/collapsible widget-menu in my sidebar. http://wordpress.org/extend/plugins/folding-category-widget it works very well! the question, not directly connected with this plugin, is: how can i also show in the list, all posts related to a category (title + a href)? for example:               category A               post1              post2          category B              post3              post4          category C              post5      thanks a lot in advance.


title: Home page is redirecting to another page - no obvious reason

text: I added a page to my site, and suddenly the home page seems to be redirecting to that page (that is, if you go to jesseliberty.com, which should bring you to the home page, you are redirected to jesseliberty.com/newPage (the page I created). To combat this, I've added a 301 redirect from jesseliberty.com/foo to jesseliberty.com/2010 which shows all the posts from this year, but is not, by any means, the right thing, and will truly fail in January. Any ideas on what caused this or what I can do about it? There is nothing obvious in .htaccess


title: Form Submitting Error with get_template_part()

text: I have come across an interesting problem regarding the `get_template_part()` . I have created a theme options page (named sitewideSettings.php) normally I would include this in functions.php like so:               include(TEMPLATEPATH."sitewideSettings.php");      which works fine. But now I am trying to use `get_template_part();`               get_template_part('sitewideSettings');      which is also working fine except that when clicking 'update' to update the settings I get an error message: "Are you sure you want to do this? Please try again". "Please try again" links back to the theme options page and clicking update takes you back to the error message which takes you back to Theme options and round and round we go. Nothing else has changed other than the use of `get_template_part();` Anyone else come across this problem? How did you get around it? I am sure its something simple and obvious, but exactly what it is totally escapes me. (Its not a nonce issue as a nonce is created in both instances)


title: Admin config screen without menu

text: I want to create a sub config from some page on admin panel, eg: I've set config menu this way:               add_menu_page( 'E+', 'CRE+', 8, 'cr_e_plus_user_config', 'cr_e_plus_user_config');     add_submenu_page( 'cr_e_plus_user_config', 'E+', 'Configurations', 8, 'cr_e_plus_user_config', 'cr_e_plus_user_config');      From `Configurations` page, I need to load another page when I click certain link. Now, I don't want this new page to be listed on menu, because it will need certain parameter before I can show it.


title: SHORTINIT and sessions

text: Is it possible to use SHORTINIT for AJAX called php file and use a Wordpress shared $_SESSION global in it? I have this thus far:               ini_set('html_errors', 0);     define('SHORTINIT', true);          require 'wp-load.php';          $_SESSION...      ...and it really made that file load in a snap, but with SHORTINIT i can't seem to retrieve that file's $_SESSION variables in Wordpress. Commenting it out enables session sharing.


title: Using a custom field inside a shortocde

text: Im trying to use a custom field inside a shortocde for a nextgen gallery slider on a page. The goal is to change the gallery id by entering in the corresponding id on page creation with a custom field. This doesn't seem to be working how I have it setup though and is just calling all images which makes me thing no value for the gallery id is being called.               <?php       global $image_gallery;        $image_gallery = get_post_meta($post->ID, 'image_gallery', TRUE);      ?>     <?php echo do_shortcode('[jj-ngg-image-list html_id="about-image-list" gallery="return $image_gallery" max_pictures="4" width="160" height="150" orientation="horizontal"]'); ?>     <?php ?>


title: Changed permalink structure of CPT - should I redirect?

text: Following this answer, I recently changed the permalink structure of a custom post type called 'Literature' to include the taxonomy term: Old structure: `mysite.com/literature/books/post_name` New structure: `mysite.com/literature/fiction/post_name` However, when visiting the original permalink, Wordpress doesn't automatically redirect it and both pages are appearing as separate entries in Google search. Should I redirect the old literature permalinks? If so, what's the best way to do this? ## UPDATE Thanks Brian, I've amended your code as below and this is working as desired:               add_action('parse_request', 'redirect_books_to_fiction', 0);     function  redirect_books_to_fiction(){         global $wp;         if(preg_match('/literature\/books/', $wp->request)){             $redirect = get_bloginfo('siteurl').'/'.str_replace('books', get_the_term_list( $ID, 'literature_category', '', ' / ', '' ), $wp->request);             wp_redirect($redirect, 301);             exit;         }     }      However, how can I redirect **_everything_** and not just 'books'? On my literature permalinks I can type any word into the trail and it doesn't redirect. e.g. `mysite.com/literature/any_random_word/post_name` Just stays as that permalink. Whereas, if I visit other pages on my site and change any of the trail leading up to a post, it automatically redirects to the correct permalink. e.g. If I change: `mysite.com/food/recipes/post_name` to: `mysite.com/a_random_word/another_random_word/post_name` It redirects to the correct permalink. I assume this is because of the custom permalink structure I used in this answer Here is the site.


title: Show tags in post? Function not working

text: I'm using the first example from here: http://codex.wordpress.org/Function_Reference/get_the_tags but nothing is showing up. There's nothing about get_the_tags in my function.php... nor do I know what to put there (sorry, amateur to wordpress) Just trying to show the tags associated with the post. Could anyone help?


title: Add image URL automatically to custom field?

text: Does anyone know how I automatically add the URL of the uploaded image to a custom field? In other words, When I upload a image I want the url to the image to get a custom field variable automatically so I dont have to add the URL manually to the custom field all the time. I need a seamless integration to make is user-friendly. I want to use scripts like timthumb instead of the built in WP functionality. **-----UPDATE:** Here is some code I have. Just missing the thumbnail variable in the custom value field.               add_action('wp_insert_post', 'mk_set_default_custom_fields');          function mk_set_default_custom_fields($post_id)     {         if ( $_GET['post_type'] != 'post' ) {                  add_post_meta($post_id, 'Image', 'I WANT THE THUMBNAIL HERE', true);              }              return true;     }


title: Programming Wordpress to send a custom-built form to specified email address

text: I have built a custom html/javascript form that I would like to incorporate into my blog. I would like the submit button of the form to send the information to a specific email address. Is there a way I can add that into the html of the form, or is it going to require an outside php file? And if an outside file is needed, please let me know what I need to do. I have little experience with php, so very clear, basic answers would be much appreciated.


title: What is zinging my HTML commands? I don't think I can blame TinyMCE this time...

text: I'm creating some pretty involved websites where I insert the contents of a wordpress 'page' directly into a page display element. (example would be a custom entry in the footer...) Its absolutely essential that we can use html code within our pages without errors. This enables our admins to make minor upgrades without having to recode a template. Generally they add or edit links or images on the site, nothing more fancy than that. Unfortunately I'm having lots of issues with content being mangled upon delivery. (inspected in firebug or chrome dev tools.) Not sure what is going on. I'm very well aware of the TinyMCE Advanced Plugin from Andrew Ozz. Got that puppy plugged in and I'm using the HTML button as well as the setup checked for "Stop removing the `<p>` and `<br/>` tags when saving and show them in the html editor" The system still generates the `<p>` tags, but at least I can see where they are. I'm also familiar with https://codex.wordpress.org/TinyMCE#Customize_TinyMCE_with_Filters At first four glances it would appear that any customization mods done via the codex would interfere with the Ozz TinyMCE Advanced Plugin, so I've shut any custom work there. I've also verified that the theme I'm using isn't doing the mangling. In fact when I check what's stored in the page, it looks clean there. What's not clean is the output on the web page. Here is a simple example, a html comment symbol. The sample is `<!--` hide this link `\-->`. The html view button shows EXACTLY this code. When you go to the web page and look at the generated code you get `<!--` and `–>` The `\-->` is converted to garbage. Same thing happens to a lot of my characters, single quotes get changed to `‘` and `&#8217`, double quotes to `“` and `&#8221` Anybody know what is going on? Is this an ascii vs UTF issue? Is this a database setup error, perhaps using the wrong character storage type? I just checked the database and phpMyAdmin tells me that the "Server Connection Collation" is "utf8_general_ci". Is this correct? Ouch.. I just checked the data within the database, and the errors are not apparent there. `\-->` looks just like `\-->`. Many thanks for any insight you guys might provide.. Zip.


title: Not redirecting upon front-end post submission

text: I have been trying this code to submit front-end post: http://pastebin.com/B8LGhsGA It is not redirecting upon clicking the submit button the form works fine but its not redirecting. When the post is submitted it loads the same page again.


title: Convert attachment ID into url?

text:
I'm using the plugin advanced custom fields to create custom fields to create a relationship between two pages. The code below is looking at the relationship field and grabbing the page title and company logo of the linked page. The only problem is that instead of outputting the image url (so it displays the image), it's outputting the attachment ID. How can I convert the attachment ID into a url so the image displays?                       <?php foreach(get_field('connections') as $relationship): ?>                 <img src="<?php echo get_post_meta($relationship->ID, 'company_logo', true ); ?>" height="57" width="250" />                         <a href="<?php echo get_permalink($relationship->ID); ?>"><?php echo get_the_title($relationship->ID) ?>
             <?php endforeach; ?>


title: Can I stop images linking to themselves?

text: I have images on my website which I do not really want stolen, I have a no right click plugin which will help, and I would like to stop people clicking on the image to display it on it's own in a browser window. I understand that anyone can access the source code and find the URL, I just want to make it a little more difficult. How can I remove links from images, and just have the embedded image?


title: Increasing the the file upload size

text: I put these inside wp-admin/php.ini               upload_max_filesize = 75M     post_max_size = 75M     max_execution_time = 300      Still not working, please advice if i am doing the right way or not?


title: Adding widgets to header and footer from plugin

text: i created 4 header and 4 footer widgets using a site spesific plugin, the reason been that when i change themes, i keep all of my widgets. i created two files, one for the header widgets and one for the footer widgets. what i need to do now is to add these to the header and footer files. at this stage i'm putting the following code manually in my header at the bottom after my header closing tag:               <? if ( is_front_page() ) : ?>               <?php   get_sidebar( 'homepage' );  ?>             <?php endif ; ?>`      and the following code in my footer at the top:               <?php get_sidebar( 'footer1' ); ?>      How can i insert these codes automatically into my header and footer files from my plugin. many thanks


title: How to use Wordpress multisite with mixed HTTP and HTTPS sites?

text: I have a multi-wordpress installation (3.x) with 5 sites and only one of them is using SSL. All of these are running on their own domain, and the http://ssldomain.com forwards to https://ssldomain.com. Still, this seems to break wordpress upgrades. Now I get a message: Upgrade Network https://nonsecureddomain.com Warning! Problem updating https://nonsecureddomain.com. Your server may not be able to connect to sites running on it. Error message: SSL: no alternative certificate subject name matches target host name 'nonsecureddomain.com' It seems that at some point WP decides to go HTTPS for this domain, where it is not supposed to. The network itself is the one running on HTTPS(SSL), and what concerns me is that https://mydecureddomain.com/wp-admin/network/site-info.php?id=5 Is listing the site with a hardcoded HTTPS prefix which seems to to be configurable? ![enter image description here](http://i.stack.imgur.com/mvVdd.png)


title: Related posts by category not working right

text:
I have somehow managed to create this code to display Related Posts by category on single post page.

You might also like
           <?php             $orig_post = $post;             global $post;              $categories = get_the_category($post->ID);                  if ($categories) {                    $category_ids = array();               foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;                    $args=array(                 'category__in' => $category_ids,                 'post__not_in' => array($post->ID),                 'showposts'=> 4, // Number of related posts that will be shown.                 'caller_get_posts'=>1);                    $my_query = new wp_query( $args );               while( $my_query->have_posts() ) {                $my_query->the_post();           ?>
                   <a rel="external" href="<?php the_permalink(); ?>" alt="<?php the_title(); ?>" title ="<?php the_title(); ?>" ><?php the_post_thumbnail(); ?>
<?php the_title(); ?>
                <?php } // ending while loop            }          $post = $orig_post;     wp_reset_query();     ?>
      Problem is, this code doesn't displays related posts of the same category as on single post page. Even includes the same post displayed on single post page and also shows some recent posts. You can test yourself. Please suggest how can I resolve this or am I missing some thing in this code? Thanks


title: Wordpress json api taxonomy index method

text: In edition to this post below: wordpress json custom taxonomy problem How to write a method for getting categories withing a custom taxonomy, similar to Method: get_category_index in core json api controller? Scenario: I have a taxonomy called - books which has four categories and i need those categories to be outputted through get_taxonomy_index. Something like this http://example.com//api/get_taxonomy_index/?dev=1


title: how to create theme based widget that can be drop in sider bar or footer

text: I am developing a installable theme in wordpress I have created a contact form and called that form in footer but I want to create a widget that should be theme based mean i dont want any plugin.I can create a widget but for this i need to put the file in plugin folder that I don't want that should be completely theme based . I want this because if I want to change the position of contact form like from footer to sidebar so for this I need to make this contact form widget that can be drag and drop in footer and sidebar. I have searched this also on Internet but all are based on plugin directory so that Its not my requirement because it will activate whenever plugin will be activate but I need widget should activate whenever theme will be activate Please provide me help or your suggestion I shall be very thankful to you Thanks


title: Adding a Javascript slideshow to the home page

text: I'm trying to add a Javascript slide show to my WordPress home page. In my theme folder I have a js folder and then in that I have `jquery.cross- slide.min.js` and `jquery.min.js`. This is what I have and what I'm pasting into my post area:               <script type="text/javascript" src="js/jquery.min.js"></script>     <script type="text/javascript" src="js/jquery.cross-slide.min.js"></script>          <script type="text/javascript">     function() {     crossSlide({     sleep: 3,     fade: 1     }, [     { src: 'images/slideshows/block1.jpg' },     { src: 'images/slideshows/block2.jpg' },     { src: 'images/slideshows/block3.jpg' }     ])     });     </script>      If I paste this into a WordPress page throught the HTML editor it doesn't work. Please could you check for errors and advice.


title: move blog posts from one wordpress to another

text: I have a blog in the subdirectory. Last year I installed a new blog in the root basically about the same thing. I like to be able to transfer all my old posts from the blog in the sub directory to the root so I can close down the sub one what is the best way to do this?