Alphabetising a list of Meta Terms from Advanced Custom Fields

I'm struggling with this, but I'm hoping that I have just looked at it too long... I'm calling a list of custom post_type titles through into a drop down on another post. They have been associated with it via an Advanced Custom Field, but I can't seem to alphabetise the output... Am I just being thick and missing the obvious?               <select name="person"  tabindex="1" class="pretty dk">                                 <option value=""><?php echo $author; ?></option>                                 <?php                                     // Generate list of meta terms                                     $authors_raw = cn_get_meta_values( 'relevant_people', $post_type );                                     $authors_unserialized = array();                                     $authors = array();                                          foreach( $authors_raw as $a_r ) :                                         $authors_unserialized[] = maybe_unserialize($a_r);                                     endforeach;                                          foreach( $authors_unserialized as $i ) :                                         if( !empty($i) ) :                                             foreach( $i as $ii ) :                                                 if( !in_array($ii, $authors) ) :                                                     $authors[] = $ii;                                                 endif;                                             endforeach;                                         endif;                                     endforeach;                                          if( $refine === true ) :                                         global $post_list;                                         $authors = cn_refine_search_dropdown( $post_list, 'relevant_people' );                                     endif;                                          foreach( $authors as $a ) :                                         $person = get_post( $a );                                         if( is_null( $person ) ) continue;                                         if( (int) $_GET['person'] === $a ) :                                             $selected = ' selected="selected"';                                         else :                                             $selected = '';                                         endif;                                 ?>                                     <option value="<?php echo $a; ?>"<?php echo $selected; ?>><?php echo $person->post_title; ?></option>                                 <?php endforeach; ?>                             </select>      Still struggling with this one, just updated the code to add in an array...               $authors_raw = cn_get_meta_values( 'relevant_people', $post_type );                                          $authors_unserialized = array(                                     );                                     $authors = array(                                             'ID' => 'post_title',                                             'orderby' => 'title',                                             'order' => 'DESC',                                     );                                          foreach( $authors_raw as $a_r ) :                                         $authors_unserialized[] = maybe_unserialize($a_r);                                     endforeach;                                          foreach( $authors_unserialized as $i ) :                                         if( !empty($i) ) :                                             foreach( $i as $ii ) :                                                 if( !in_array($ii, $authors) ) :                                                     $authors[] = $ii;                                                 endif;                                             endforeach;                                         endif;                                     endforeach;                                          if( $refine === true ) :                                         global $post_list;                                         $authors = cn_refine_search_dropdown( $post_list, 'relevant_people' );                                     endif;                                          foreach( $authors as $a ) :                                         $person = get_post( $a );                                         if( is_null( $person ) ) continue;                                         if( (int) $_GET['person'] === $a ) :                                             $selected = ' selected="selected"';                                         else :                                             $selected = '';                                         endif;      Anyone got anymore thoughts? I'd really appreciate it! Thanks!


Leveled - Terms foreach

I need to build a php foreach that goes through all my terms in my custom taxonomy 'Section'. I know how to get a foreach of all the terms in 'Section', but what i cant do is build it with levels. I want the top parent term to be the heading, and its children will be displayed in a list. Heres an html example of the output i need.

 Term Parent

 Term Child

 Term Child

 Term Parent

 Term Child

 Term Child


Linking comments from registered users to their profile pages

I am trying to find a way to link the 'username' in comments from **registered** and **logged in** users to their profile pages instead of their website URL. And comments from unregistered users to their website URL as usual. Is this possible? My wordpress version is 3.5.1 and I am using the default theme Twenty Twelve. Here's the code to the function 'twentytwelve_comment':               <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">         <article id="comment-<?php comment_ID(); ?>" class="comment">                              <?php                     echo get_avatar( $comment, 44 );                     printf( '%1$s %2$s',                         get_comment_author_link(),                         // If current post author is also comment author, make it known visually.                         ( $comment->user_id === $post->post_author ) ? ' ' . __( 'Post author', 'twentytwelve' ) . '' : ''                     );                     printf( '<time datetime="%2$s">%3$s</time>',                         esc_url( get_comment_link( $comment->comment_ID ) ),                         get_comment_time( 'c' ),                         /* translators: 1: date, 2: time */                         sprintf( __( '%1$s at %2$s', 'twentytwelve' ), get_comment_date(), get_comment_time() )                     );                 ?>                               <?php if ( '0' == $comment->comment_approved ) : ?>
<?php _e( 'Your comment is awaiting moderation.', 'twentytwelve' ); ?>
             <?php endif; ?>
                 <?php comment_text(); ?>                 <?php edit_comment_link( __( 'Edit', 'twentytwelve' ), '
', '
' ); ?>

                 <?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'twentytwelve' ), 'after' => ' ↓', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>

     <?php         break;     endswitch; // end comment_type check     }     endif;


How to disable automatically insert linebreak in need?

I have install a plugin named `latex for wordpress`, which use mathjax to render the latex mathematical symbols. An matrix example > $$\mathbf{P} = \left[ \begin{matrix} x\ y\ \end{matrix} \right],\mathbf{P'} > = \left[ \begin{matrix} x\ y\ \end{matrix} \right],\mathbf{T} = \left[ > \begin{matrix} t_{x}\ t_{y}\ \end{matrix} \right] $$ The problem is I could not break the statement into multiple lines when the statement become too long in a single line. Because wordpress would automatically insert `<br>` to the equation. So I need to disable automatically generation of `<br>` in and only in this circumstances. Could I do this with some extra tags?


Insert custom content before widget title/after widget opening tag

I am trying to target a widget with a specific class, and place something directly after the opening tag or before the widget title. This:               <widget>
Title

Some content goes here...
     </widget>      Becomes:               <widget>
Title

Some content goes here...
     </widget>      I can't quite hook into it, I do not want to use css, this needs to be added with widget logic in order to be user-friendly.


How to use Download Manager with FTP

I need to have the email before download plugin so am using Download manager in conjunction, however as some files will need updating quite regularly, I am keen to use FTP so that I can just replace the file in there as opposed to creating entirely new links in DM. Does anybody know how to do this?


WordPress and bbPress Login conflicts?

For some reason, if I log into my WordPress dashboard, I get logged out of my bbPress forum. When I log into my bbPress forum, I get logged out of WordPress. I followed all of the instructions correctly, and the installation told me it validated my information and it's all correct, so why is it not letting me stay logged into both at the same time?


Remove Captions from Custom Gallery function.php

I like to prevent captions from being outputted in my custom gallery function. I could easily just hide it using CSS but it doesn't feel right. The caption is being sent from media.php this line.                       if ( $captiontag && trim($attachment->post_excerpt) ) {             $output .= "                 <{$captiontag} class='wp-caption-text gallery-caption'>                 " . wptexturize($attachment->post_excerpt) . "                 </{$captiontag}>";         }      I could just remove `. wptexturize($attachment->post_excerpt) .` but as soon as I update its gone. Id like to to this without copying the whole gallery function. Wordpress is generating the alt tag using the caption field, which is desired. Is there a way? My function code               function modified_gallery_shortcode( $attr ) {          $attr['size']   = "thumbnail";     $attr['link']   = "file";     $attr['itemtag']  = "";     $attr['icontag']  = "";     $attr['captiontag'] = "";     $output = gallery_shortcode( $attr );     $output = strip_tags( $output, '

' );     $from = array(               "class='gallery-item'",              "class='gallery-icon landscape'",              "a href=",             "class='wp-caption-text gallery-caption'"         );           $to = array(            "",           "",           "a class=\"swipebox\" rel=\"group\" href=",           "",     );     $output = str_replace( $from, $to, $output );     $output = sprintf( '
%s
', $output );     return $output;     }          add_shortcode( 'gallery', 'modified_gallery_shortcode' );


How do I set a featured image straight from the post text editor?

I'm dealing with a migration of 5,000 posts from a non-WordPress platform into a new WP install. I would like content managers to be able to open each past post in the admin, then merely click an INLINE image of their choosing to designate it as that post's featured image. The current method of clicking on the "Set featured image" box and then browsing through the entire media library for every single post seems far too labor-intensive. Any good plugins or direction for hooking into the admin to make this possible?


Add class to menu

I want to add a css class in menu list with this code:                   function my_special_nav_class( $classes, $item ) {              if ( has_nav_menu( 'socialmedia' ) ) {             $classes[] = 'btn-social btn-outline fa';         }              return $classes;     }     add_filter( 'nav_menu_css_class', 'my_special_nav_class', 10, 2 );      but this adds the css class to all the menus. Any idea how to add the class just to "socialmedia"?


Core framework/helpers for logging stuff?

I'm writing two plugins at the moment which need to (optionally) log stuff...lots of stuff...somewhere. Since i don't like the 'you need to have proper permissions in this and that folder' messages of some plugins, ideally, i'd like to do it in the database. But before i start creating my own db tables (which is also something i don't like for plugins to be doing), i'm wondering if WordPress has anything that could help with suchalike enterprise hidden in the dark deep of its codebase catacombs? Ta.


Fatal error: Allowed memory size exhausted error without www

> Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to > allocate 130968 bytes) in /home/ ** _**/ **_**/wp-includes/plugin.php on > line 607 I've looked up all of the similar topics about this but problem of mine is different than those: When I tried to enter my site without _www_ : > chemicalsubjects.com it gives me : > Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to > allocate 130968 bytes) in /home/ ** _**/ **_**/wp-includes/plugin.php on > line 607 When I tried to enter my site with _www_ : > www.chemicalsubjects.com There is no error... I tried to increase memory size by htacces and/or wp-settings.php but it doesn't work. I tried to step by step close/open plugins but don't work out! Why?


outputting posts' taxonomies: cant get 'get_the_taxonomies' working

I want to output the taxonomies associated with a post in a 'title' attribute, so it needs to be unformatted. I know about get_terms and get_terms_list, but the problem is that you need to provide which taxonomy you want to get on forehand. But what if you have an archive page which lists multiple different post_types... you don't know which taxonomies are associated with a certain post as you don't know which post-type it is. So I tried this:               $posttaxonomies = get_the_taxonomies();       if ($posttaxonomies) {         foreach($posttaxonomies as $taxonomy) {           $thetaxonomies .= $taxonomy->name . ' ';        }       }      which doesn't output anything. I know I must be doing something wrong, but am stumped with it.


Elegant way to include only published posts with get_objects_in_term()?

The obvious way is to iterate through the resulting array of IDs, get_post for each and test against `post_status == 'publish'`. But I wonder whether this could cause memory issues since `get_post` will attempt by default to cache each result? Short of a custom SQL join, are there any surprise args one can pass to `get_objects_in_term()` or is there some other tax function I'm not leveraging that I should be?


How can I restore admin capabilities?

So yeah, I'm a genius. I managed delete all my admin capabilities (thank you very much Membership plugin). I could restore them, ...if I had admin access, lol. Anywhoo, how can I give all my capabilities back to admin? I have access to the database via PHPMyAdmin but have no idea where or what to add back to the DB. Any help would be appreciated. Thanks!


Simple way to search custom-post types only

I'm just trying to find a way to narrow my current search bar so that it only searches within my 'events' custom post-type. I do not want the search to index any other post type, only 'events'. Here's the search bar:               <form id="searchform" action="http://localhost:8888/ltc" method="get">             <input class="inlineSearch" type="text" name="s" value="Enter a keyword" onblur="if (this.value == '') {this.value = 'Enter a keyword';}" onfocus="if (this.value == 'Enter a keyword') {this.value = '';}" />             <input class="inlineSubmit" id="searchsubmit" type="submit" alt="Search" value="Search" />         </form>      And the search.php:               <?php if ( have_posts() ) : ?>
<?php printf( __( 'Search Results for: %s', 'twentyten' ), '' . get_search_query() . '' ); ?>
                 <?php                 /* Run the loop for the search to output the results.                  * If you want to overload this in a child theme then include a file                  * called loop-search.php and that will be used instead.                  */                  get_template_part( 'loop', 'search' );                 ?>      ## (I haven't actually edited the default search.php page yet, as I just want to get the indexing correct first) Thanks


Dynamic menu with custom post types

I'd like to create a dynamic menu with a mix of static pages and custom post type archives that applies a class of "current" to the current tab. The example below uses 1) Static page set as Home 2) Static page 3) Custom post type archive 4) Static page for blog content. Tried to edit the code from my previous menu, but it's not working. I'd appreciate any assistance! Thanks.
     <li<?php if ( is_front_page() ) { echo ' class="current"'; } ?>>Home
     <li<?php if ( is_page('my-page') { echo ' class="current"'; } ?>>My Page
     <li<?php if ( is_post_type_archive('my-custom') && is_single()) { echo ' class="current"'; } ?>>My Custom Posts
     <li<?php if ( is_page('blog') { echo ' class="current"'; } ?>>Blog


Ignoring a category in WP_Query still shows the links in next_post_link()?

So I have a WP_Query like so:               $homepage = new WP_Query( 'posts_per_page=1&cat=-5' );      and in my while loop, I have a call to `next_post_link()` and `previous_post_link()`, which are both showing posts from the excluded category. Here is what my code looks like next:               <?php while ( $homepage->have_posts() ) : $homepage->the_post(); ?>      <?php next_post_link('« %link'); ?>       <?php previous_post_link('%link »'); ?>      <?php endwhile; ?>       According to the wordpress docs on next_posts_link & previous_posts_link, these functions are based on the current query: > Prints a link to the next set of posts within the current query. So does anybody have an idea of why `next_post_link()` and `previous_post_link()` would show posts that should be excluded while the rest of the loop works as expected?


What's the difference between Options & Settings?

And which one should I use? What's the difference between Options API and Setings API? I have a theme with over 100 admin options, how should I register & store them? At this moment I'm using Options API but I'm not too happy with it, every single option is being registered separately so they create a lot of database queries. I see three ways of storing WordPress options/settings at the moment: # 1. Options API - the old (the worst?) way. (I'm using this one already)               <form method="post" action="options.php">     <?php wp_nonce_field('update-options'); ?>                  // all the inputs          <input type="hidden" name="action" value="update" />     <input type="hidden" name="page_options" value="option1,option2,option3,..." />     <p class="submit">     <input type="submit" value="<?php _e('Save Changes') ?>" />     </p>     </form>      And then in the front end:               echo get_option('option1');       Looks ugly and I don't think that's the right way of storing big number of options (I'd love to group them somehow). # 2. Options API - 1 option as a big array. I'm not sure here how to update this array using html forms, anyone? I believe it should go like:               $opt['option1'] = foo     $opt['option2'] = foo     $opt['option3'] = bar          update_option('theme_settings',$opt);      And then in front end:               $settings = get_option('theme_settings');     echo $settings['option1'];      echo $settings['option2'];      echo $settings['option3'];       I've heard it really decreases number of queries and I have them all as one option. I'd love to use this one but as I mentioned above I'm not sure how to update this array of options within Wordpress admin form. I guess: `<input type="hidden" name="theme_settings" value="option1,option2,option3,..." />` will overwrite the array instead of adding new elements? # 3. Settings API - the new way. Requires a lot of additional code:               function register_theme_settings() {         //register our settings            register_setting( 'theme-settings', 'option1' );              register_setting( 'theme-settings', 'option2' );              register_setting( 'theme-settings', 'option3' );              register_setting( 'theme-settings', 'option4' );              register_setting( 'theme-settings', 'option5' );              // imagine this for 100 and more options         };      And I'm not sure what's the difference between this and the method with one option as an array? **tl;dr** So, how should I project my theme settings storage so it will be **working fast** and **store** all the options/settings **in one place** so I will be able to, for example, echo/dump them all with one simple function (yes, I want to do that badly but I have no idea how to do that with this Settings API). The second method looks the best so far.


Recommendation for a WordPress Calendar Plugin with Recurring Events?

I'm building a base WordPress theme that will cater mainly to an events calendar plugin (yet to be decided.) I'm curious what WordPress users consider to be the best solution in terms of stability and usability? I should note that **recurring events are a must-have feature** but that's just personal preference. This is a free GPL project that will be publically available as a basic greyscale starting point for other theme builders. I'd like to know first though, **which plugin do seasoned WordPress developers use**?


Is This A Correct Example Usage Of current_filter()?

Is this a good example of usage of `current_filter()`?               <?php     add_filter("_my_filter", "common_function");     add_filter("_another_filter", "common_function");     function common_function(){       $currentFilter = current_filter();       switch ($currentFilter) {         case '_my_filter':           echo "Called by My Filter";           break;         case '_another_filter':           echo "Called by another filter";           break;       }     }      So I am guessing `current_filter()` is used to get the name of the filter for which the current execution is happening?


how to update or refresh the wp user object?

If I have the wp user object instantiated what is the proper way to update the value of a particular key if it changes during the course of a script? For example, lets say I have this somewhere in my code near the beginning of the script:               echo $current_user->display_name;//lets say this returns 'sometestname'      Then I do something here to change the value of display name in the wp_users table. Let's say I change the display_name to 'someothertestname' using wpdb->query .               echo $current_user->display_name;//still would result in 'sometestname'      What should I be doing here? Is this where wp_cache comes in? How do I update the value in the current object? Or do I?


Warning/Notice about functions.php

I have trouble about the notice shows on the top of the home page as: > Notice: `load_plugin_textdomain` was called with an argument that is > deprecated since version 2.7 with no alternative available. in > `.../wordpress/wp-includes/functions.php` on line 2925 The code of this line is something about `$wpsmiliestrans`:               ';)' => 'icon_wink.gif',      If I delete this code, it will show the problem on line 2924, which is another code about smilies, and there are dozens of these type of code. How can I get rid of this?   I have updated the software to the latest version.


Add a select-option to the default widgets

I would like to add an extra feature to one of the default widgets so that the user can choose from the select-field to either align the widget to the left, center or to the right. ![enter image description here](http://i.stack.imgur.com/Xw4Xp.jpg) ![enter image description here](http://i.stack.imgur.com/0AdOA.jpg) How would I be able to achieve this without tampering with any of the files outside of my themes directory?


Custom product fields in wp e-Commerce plugin

I want the user to be able to set a text, option values or other type of data in each product just before they add it to the cart. Just like product options. > For example: The user buys a sticker and is able to set the text to be print I can't use product variations for this task before it is not about fixed values. Is there a way to add this type of functionality on wp e-Commerce plugin?


Plupload in metabox - AJAX action not working in Class

I'm trying to put the WP Pluploader into a meta box on my posts page - as per Plupload Intergration in a meta-box? and http://www.krishnakantsharma.com/2012/01/image-uploads-on-wordpress-admin- screens-using-jquery-and-new-plupload/ I got it all working as in the example in the second link. However, I want to put it all into a class file. It stops working if I wrap it all into a Class. And it's all because of:               function g_plupload_action()     {          // check ajax noonce         $imgid = $_POST["imgid"];         check_ajax_referer($imgid . 'pluploadan');              // handle file upload         $status = wp_handle_upload($_FILES[$imgid . 'async-upload'], array('test_form' => true, 'action' => 'plupload_action'));              // send the uploaded file url in response         echo $status['url'];         exit;     }      It works if this function is outside the Class and called through:               add_action('wp_ajax_plupload_action', "g_plupload_action");      But inside the Class and called with:               add_action('wp_ajax_plupload_action', array($this, 'g_plupload_action'));      and the return data is `0`. What do I need to do in `function g_plupload_action()` to make it work?


How to make custom plugin run on demand?

I'm trying to make a plugin which would run either by itself at a specific time or when it is triggered manually(that is, a particular function of the plugin is triggered). I'm not understanding how to implement that though and googling around hasn't been fruitful. If that may help, this is **briefly** how the function looks like.               function rrikesh_insert_post()     {       $post = array([variables populated from external file]);       wp_insert_post($post, true);     }      Anyone can suggest a way? Thanks


Custom Jquery in admin breaks media-upload script

I have this part of code which loads custom version of jquery                       wp_deregister_script('jquery');             wp_register_script('jquery', ("http://code.jquery.com/jquery-latest.min.js"), false, '');             wp_enqueue_script('jquery');      Everything works fine but if i open the media upload manager which is loaded by this code                   wp_enqueue_script('media-upload');         wp_enqueue_script('thickbox');         wp_enqueue_style('thickbox');      and triggered by this                               <script language="JavaScript">                         jQuery(document).ready(function() {                         jQuery('#upload_image_button').click(function() {                         formfield = jQuery('#upload_image').attr('name');                         tb_show('', 'media-upload.php?type=image&TB_iframe=true');                         return false;                         });                              window.send_to_editor = function(html) {                         imgurl = jQuery('img',html).attr('src');                         jQuery('#upload_image').val(imgurl);                         tb_remove();                         }                              });                     </script>                         <label for="upload_image">                             <input id="upload_image" type="text" size="36" name="upload_image" value="<?php  ?>" />                             <input id="upload_image_button" type="button" value="Upload Image" />                             <br />Enter an URL or upload an image for the banner.                         </label>      The lightbox opens and displays all options, but when i choose "Upload Image" or if i go to media library and select an image from there nothing happens. If i remove the custom jquery the media uploader works fine. But then the jquery ui code i have is not working, although i am loading the jquery-ui script, so i have to load my custom latest version of jquery. Is there any solution so both media-upload and jquery-ui are working on the same page in the plugins admin panel?


Create More Widget Holders Like Active Widgets and Inactive Widgets

I am wondering if it is possible to create other Widget Holding sections like Active Widgets and Inactive Widgets. For instance, perhaps I would create a Media Widgets section and place all media related widgets in there. Is this possible? If so, how could I create the section and how would I place the widgets in there? Thanks.


Show different menus for login / logout user

I am try to show different menus for login and logout user. Here is perfect solution to do this and also work on Twenty eleven theme. But when I try to add this code to my woo theme's defination (in header.php) I got this error `Parse error: syntax error, unexpected '}' in C:\xampp- portable\htdocs\wordpress\wp-content\themes\definition\header.php on line 63` How to fix it? This is code of Definition's header.php:               <?php     if ( ! defined( 'ABSPATH' ) ) exit;     /**      * Header Template      *      * Here we setup all logic and XHTML that is required for the header section of all screens.      *      * @package WooFramework      * @subpackage Template      */           global $woo_options, $woocommerce;          ?><!DOCTYPE html>     <html <?php language_attributes(); ?>>          <meta charset="<?php bloginfo( 'charset' ); ?>" />     <title><?php woo_title( '' ); ?></title>     <?php woo_meta(); ?>     <link rel="pingback" href="<?php echo esc_url( get_bloginfo( 'pingback_url' ) ); ?>" />     <?php     wp_head();     woo_head();     ?>               <body <?php body_class(); ?>>     <?php woo_top(); ?>
              <?php woo_header_before(); ?>
                      <?php woo_header_inside(); ?>                      <hgroup>                     <?php _e( 'Navigation', 'woothemes' ); ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?>

<?php bloginfo( 'description' ); ?>
                 </hgroup>                      <?php woo_nav_before(); ?>                                                <?php /*                     if ( function_exists( 'has_nav_menu' ) && has_nav_menu( 'primary-menu' ) ) {                         wp_nav_menu( array( 'depth' => 6, 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'main-nav', 'menu_class' => 'nav fl', 'theme_location' => 'primary-menu' ) );                     } else { */                     if (is_user_logged_in()) {           wp_nav_menu(array('theme_location' => 'logged_user' ));     } else {           wp_nav_menu(array('theme_location' => 'new_user' ));     }                     ?>
                         <?php if ( is_page() ) $highlight = 'page_item'; else $highlight = 'page_item current_page_item'; ?>                         <li class="<?php echo $highlight; ?>"><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php _e( 'Home', 'woothemes' ); ?>
                         <?php wp_list_pages( 'sort_column=menu_order&depth=6&title_li=&exclude=' ); ?>
                     <?php } ?>                     <?php if ( is_woocommerce_activated() && isset( $woo_options['woocommerce_header_cart_link'] ) && 'true' == $woo_options['woocommerce_header_cart_link'] ) { ?>

<a class="cart-contents" href="<?php echo esc_url( $woocommerce->cart->get_cart_url() ); ?>" title="<?php esc_attr_e( 'View your shopping cart', 'woothemes' ); ?>"><?php echo sprintf( _n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'woothemes' ), $woocommerce->cart->cart_contents_count );?> - <?php echo $woocommerce->cart->get_cart_total(); ?>

                     <?php } ?>                                            <?php woo_nav_after(); ?>
                       <?php woo_content_before(); ?>


posts_per_page - Repeats only first posts 'post__in' array

This question correlates with a previous question I was able to solve here: http://wordpress.stackexchange.com/a/137929/28389 I am using an array for '`post__in`', and I am able to run this no problem. However, when I am looping the posts with the default '10 posts per page', everytime the next page loads, it loads the first 10 posts over and over again. Not going on to 11-20, 21-30, etc etc. My array consists of 100 post id's. Here is the code I am using:               $args = array(       'post_type' => $post_type,       'order_by' => 'post__in',       'post__in'  => $post_ids, // This is an array of 100 post id's       'ignore_sticky_posts' => 1,     );          $wp_query = new WP_Query( $args );          if (have_posts()) :        usort($wp_query->posts, function($a, $b) use ($post_ids) { // Lists loop in order of the array -> http://pastebin.com/3vwiDSfb           return array_search($a->ID, $post_ids) - array_search($b->ID, $post_ids);        });        while(have_posts()) : the_post();          ...           endwhile;         endif;      So when I use '`posts_per_page = -1`', or '`nopaging = true`', all 100 posts from the array displays fine. But I need the `posts_per_page` option' for lazy loading reasons. * * * Updated working code:               $paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1; // setup pagination          $args = array(       'post_type' => $post_type,       'orderby' => 'post__in',       'post__in'  => $post_ids,       'paged' => $paged,       'ignore_sticky_posts' => 1,     );          $wp_query = new WP_Query( $args );          if (have_posts()) : while(have_posts()) : the_post();          ...          endwhile;         endif;


TinyMCE Button to Insert Multiple Lines of Text?

Is there a way to get my custom TinyMCE button to insert multiple lines of text? Ultimately I am making a "Premade Themes" button where a user will select a theme and it will insert about 6-8 different shortcodes with one click and they can edit the shortcodes accordingly.. A problem I'm having is that all of these shortcodes get put in one line. Here's the code I use that actually pastes the shortcodes: `tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : 'the shortcodes go here'});` Any help is appreciated!


Thumbnail and image management

I always though the the image manager into wp is not really good... I need to be able to generate square or custom size when i like where i like, much like **TimThumb** that generate thum on the fly... but a little complicated... what do you use or what is the best plugin...


Will post id change when migrating to new site?

I'm creating a rather complex plugin that synchronizes posts from your server with a thirdparty server. I need to know, if you migrate your wordpress server to a new site, "can" the post ids change? If so is there another unique id? Also, is there any other instance where a post id could change? If the id does change and there is no other unique id then chances are I'll just do some complex md5 signature checking and string comparison if need be.


How to check whether a post exceeds 300 words

I need to check whether a post exceeds 300 words or not. If it exceeds 300 words, then I have to provide a link to read more about the post.How can I do it? Please help me.I am new to word press.


this jQuery function works perfect in static html page but not on wordpress

I am using wp_enqueue_script to do this. If I try to do something else lets say popup a dialog, it works but the code below does not. Can someone tell me the problem. thanks.               var $j = jQuery.noConflict();         $j('#mystuff').hide();         var mouseLastYPos = null;         $j(document).mousemove(function(e){              if(mouseLastYPos){                  if (e.pageY < mouseLastYPos && e.pageY <= 2){                         $j('#mystuff').show();                      }             }             mouseLastYPos = e.pageY;         });      here is a working demo of this code on a static page. when you move you mouse to the top of the page some text appears. http://jsfiddle.net/bmHbt/


Travel Blog Plugins

I'm using Wordpress to create a blog of my travels later on this year. I would like the blog to have the following features   * my posts to be geo-located    * a map containing the locations of my posts   * ability to click individual points on the map to get to the post. I am looking for the best/most appropriate plugins to use. Thanks, Al.


Loading Multiple Comments Pages via Ajax?

I have been searching Google and still haven't found any great ideas for making comments pages load via Ajax. After searching SE I found this older thread from just a few months ago which provides a solution, but it seems to focus on submitted comments. Not loading the pages dynamically which requires a different type of query. Similarly I am wondering if this would even be the proper solution? Wordpress has a seemingly instinctive way to implement certain functions, especially Ajax. So I am hoping to follow the most proper route for typical WP installs. Happy to answer further questions. Thanks in advance for any help!


Lost of query parameter when using permalink

I have many issues with the use of rewriting, but i'll just point out one in this post to be specific. In my theme i use custom post type, with custom taxonomy               function custom_post_realisation() {         $labels = array(             'name' => 'realisation',             'menu_name' => 'Realisation'         );         $args = array(             'labels' => $labels,             'public' => true,             'show_in_nav_menus' => true,             'menu_position' => 5,             'show_ui' => true,             'show_in_menu' => true,              'capability_type' => 'post',             'hierarchical' => true,             'with_front' => false,             'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt' ),             'has_archive' => false,         );         register_post_type( 'realisation', $args );     }     add_action( 'init', 'custom_post_realisation' );     function taxonomies_realisation() {         $args = array(              'hierarchical' => true,              'label' => 'realisation',              'query_var' => true,              'rewrite' => true,              'show_admin_column' => true ,         );         register_taxonomy( 'realisation_category', 'realisation',  $args);     }     add_action( 'init', 'taxonomies_realisation', 0 );      For breadcrumb purposes i use an extra parameter in my permalinks : parentid Everything works fine without rewriting. In the permaling management i set               http://127.0.0.1/CONSTRUCTION/wordpress/%postname%/      And in order to use this extra parameter in the rewrite string i have added in functions.php               function add_query_vars($query_vars)     {         $query_vars[] = "parentid";         return $query_vars;     }     add_filter('query_vars', 'add_query_vars');     // Adding a new rule     function wp_insertMyRewriteRules($rules)     {         $newrules = array();         $newrules['realisation/([^/]+)/([^/]+)$'] = 'index.php?realisation=$matches[1]&parentid=$matches[2]';         return $newrules + $rules;     }     add_filter('rewrite_rules_array','wp_insertMyRewriteRules');      without rewriting, i have for custom post type 'realisation' article               ?realisation=habillage-de-stands&parentid=38      with rewriting i would like to have :               realisation/habillage-de-stands/38      but instead i get :               realisation/habillage-de-stands/&parentid=0/      This doesn't lead to a 404, but :   * this is not the desired permalink   * the parentid value is lost ! (0 != 38) **Why &parentid is still in the rewritten string ? Why the parentid is lost ? I've never heard of such thing using a rewriting.** to be more precise : i tried this tool : http://wordpress.org/extend/plugins/monkeyman-rewrite-analyzer/ and if i try in the tool this pattern :               realisation/habillage-de-stands/38      this is well matched with my rule, but               realisation/habillage-de-stands/&parentid=0/      also. for instance the               realisation/habillage-de-stands/38      gives me in the tool               realisation/([^/]+)/([^/]+)/?   => realisation: habillage-de-stands, parentid: 38     realisation/(.+?)(/[0-9]+)?/?$  => realisation: habillage-de-stands, page: /38     (.?.+?)(/[0-9]+)?/?$            => pagename: realisation/habillage-de-stands, page: /38      And another point: wether i get my parameter like this               $parentid = $wp_query->query_vars['parentid'];       or this               $parentid = get_query_var( 'parentid');      with the rewriting, if i echo $parentid, i get               &parentid=0      whereas without rewriting i get               38      So i'm not sure if it's only a pattern problem or a more complex one, affecting the way query vars are retrieved when rewrite is set. Thanks ---EDIT --- I think there's something wrong (or something i totally don't understand) with the rewriting thing. For instance a parent, simple page, with no extra parameter : without rewriting :               ?page_id=38       when i               echo get_query_var( 'page_id' );       or               echo get_query_var( 'p' );       or               echo $wp_query->query_vars['page_id'];       or               echo $wp_query->query_vars['p'];       The displayed result is **'38'** , as expected. **But if i turn on the rewrite, all the previous queries return 0 !** **why do i "loose" the query value when rewriting ?**


Retrieve 1st image in post and set it as featured image, when post is saved/updated

I need to set a featured image for every post I publish. So, when a post is published/updated, the script would scan the post for the first image using a script like this:                  // Get URL of first image in a post        function catch_that_image() {        global $post, $posts;        $first_img = '';        ob_start();        ob_end_clean();        $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content,      $matches);        $first_img = $matches [1] [0];             // no image found display default image instead        if(empty($first_img)){        $first_img = "/images/default.jpg";        }        return $first_img;        }      So, it would get that image and set it as a featured image for that post. If there is no image, then do nothing. I have looked into many scripts and plugins but none do it the way I am asking.


VT-resize image and display it

> **Possible Duplicate:**   >  Retrieve 1st image in post and set it as featured image, when post is > saved/updated I am trying to make this works and instead of giving me the url of the image, it is giving me "Array" I have this code that gets the first image of the post               // Get URL of first image in a post     function catch_that_image() {     global $post, $posts;     $first_img = '';     ob_start();     ob_end_clean();     $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);     $first_img = $matches [1] [0];          // no image found display default image instead     if(empty($first_img)){     $first_img = "/images/default.jpg";     }           $first_img = vt_resize( $first_img, '', 608, 250, true );               return $first_img;     }      and this code to display the image:               <img src="<?php echo catch_that_image() ?>" width="608" height="250" />      Could you please tell me what I am doing wrong and how to fix it please? Thank you.


Function to scan for image, attach it to post, set it as featured

> **Possible Duplicate:**   >  Retrieve 1st image in post and set it as featured image, when post is > saved/updated I need a function that when a post is saved/updated, it will scan the post for the first image. This image has already been uploaded to the media gallery but it has not been attached to the post. So, after the function finds this image, it has to attach it to the post, and after it is attached, it has to set it as featured. I have been looking for something like this over many forums, but unfortunately I haven't been able to find it.


Issue with WordPress native theme customizer function and jquery ui tabs

So I am using the customizer in my theme which have tabs in the page utilizing jQuery UI Tabs. When I load up the customizer, it would the sidebar accordion would be sluggish and the preview page would duplicate the content and the tabs would not render correctly. This is very strange and it does not produce this issue when you just go to the page on its own ( not in the customizer preview ). I am also not seeing any errors from my browser console in terms of JS script. So to test, I disabled the jQuery tabs and everything works in preview customizer again...So it is somehow related to that but I just don't know what. Has anyone encountered this?


How can woocommerce be used in mu-plugins folder?

I don't want clients to deactivate woocommerce plugin even by mistake. And I have recently come across a concept called must use plugins in wordpress. (http://codex.wordpress.org/Must_Use_Plugins) Just want to know if there is possibility to use woocommerce as a must use plugin.


Wrong current class on admin menu with add_submenu_page()

I'm writing a plugin that displays a post/page list in the admin menu, as a submenu for each post type. Here's the code I've got far: http://pastebin.com/DmUGfzxN The lists are showing and linking fine. However, I have a problem when I go to another menu, for example, Media, and go to edit a post (or image in this case). The _current_ class that WordPress uses for the admin menu points to the wrong place, and opens the menu for Pages, highlighting the last submenu item. I believe this is a related problem here: Current class on admin menu using add_submenu_page() He solved it by adding the submenu page to a page slug, instead of a link like `admin.php?=page...`. Unfortunately, I want my submenus to be under Post, Page, etc., so I need to use `edit.php` and `edit.php?post_type=...`. If anyone has any ideas how to get around this quirk/bug, I'd appreciate it. Thank you.


more tables created when create a new site

Can someone suggest me an idea on this? I am using Wordpress MU. And as per my requirement every user who register on main site will have a sub-site for them. And it is working correctly. I noticed that whenever a new site is created it is creating few tables in the database as like wp_2_post, wp_2_postmeta and so on. **Whenever a new site is created, it is creating about 9 new tables in my database**. **If i have 1000 users in my site, then will it create about 9000 new tables in my database?** I will be having lot more users with my site. So, can someone tell me is this right? Can i have this much of tables in my database? Or can i do anything else to avoid this? **Is there any other way to avoid this.?**


How to do more than one verify_nonce in one function?

I use a function to inset post at front_end. There are 3 different types of actions may trigger this function. So, in this function, should I write 3 verify_nonce?


What's the difference between wp_insert_user() and wp_create_user()

I know the former allows additional parameters, so you can more user info, but other then that, why do both exist? The specific reason I want to know is that wp_insert_user() is happening REALLY slowly. Somewhere between 5 - 10 seconds. I don't remember having this problem in the past, when I was using create_user, so I'm wondering if there's a lot more happening behind the scenes with one as opposed to the other. Thanks.


How to add a profile pic and biographical info at registration page?

I am running a multi-author blog which is also open to new authors registrations. How is it possible that new authors are forced to include the following information to the registration page (http://www.example.com/wp- login.php?action=register):   * to upload a profile picture    * fill out biographical information Just as an information, I am having the following plugins activated:   * Theme my login: This plugin themes the WordPress login and registration pages according to the current theme.    * Profile pic: This plugin allows authors to add a picture to their profile


WP Admin bar from subdomain included on main domain (non WP)?

I have a question regarding integrating the WP admin bar from a WP install on a subdomain into the main website (built only with HTML/PHP). I would just like to implement it so that users can login to the subdomain from the main domain's pages, as one of the plugins installed on the bar would be very helpful to have on the main website pages. Has anyone got any ideas on how to implement this properly? Regards, Matthew Stratford


Dropdown List Won't Display Selected Option After Submit / Refresh

I created a user form on my index page which allows the site visitor to re- order my post loop order based on either most recent posts or highest rated posts. The form works perfectly, the problem is: the post loop loads by most recent as a default, but after they select/submit for the highest rated order, the page refreshes and the dropdown list displays the default option value of "Most Recent Posts" when it should be displaying the current option value of "Highest Rated Posts". This is confusing for the reader because it appears as if they are still seeing the most recent posts when they are in fact seeing the highest rated. How can I force the dropdown list to stay on the selected option instead of defaulting back to first option after refresh? Here is my code:               <?php $sort= $_GET['sort']; if($sort == "date") { $order= "orderby=date"; } if($sort == "highest_rated") { $order= "orderby=meta_value_num"; } ?>          <form class="formindexfilter" action="#ifilter" method="get">     <input type="hidden" name="r_orderby" value="desc">     <select name="r_sortby" id="sorting">      <option value="date" <?php if ($sort == "date") { echo ' selected="selected"'; } ?> >Most Recent Posts</option>      <option value="highest_rated" <?php if ($sort == "highest_rated"){ echo ' selected="selected"'; } ?> >Highest Rated Posts</option>     </select>     <input type="submit" value="Submit" />     </form>      What am I doing wrong? I just want the dropdown list to accurately describe the loop results all the time. Any help would be extremely appreciated. I've been trying to figure this out for weeks now.


Hide default "Recent Comments" Widget if there are no comments yet

Is there a way to hide the widget completely if there are no comments yet? I was thinking about maybe adding a php function to my functions.php file - is that a possible way? If so, can someone provide a suggestion?


How to create three columns from selected posts

I would like to create a three columns with 3 selected posts. They must include image and title. Like this http://i.imgur.com/tXg0bv3.png How to create it in CSS and HTML? This is very important for me, I can't find something like that. Thanks. I'm sorry, I did not mention. This columns must be outside the loop. This is a code for post outside the loop:               <?php     $recent = new WP_Query();     $recent->query('showposts=1');     if($recent->have_posts()) : while($recent->have_posts()): $recent->the_post();     ?>
     <?php the_post_thumbnail('mainImageCropped'); ?>

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

<?php echo get_avatar( get_the_author_meta( 'ID' ), 32 ); ?><?php the_author_posts_link(); ?>

<?php comments_popup_link('0 comments »', '1 comment »', '% comments »'); ?>

     <?php endwhile ?>     <?php else : ?>
 Nothing find
     <?php endif ?>


Foundation and Wordpress Footer Widgets

I'm trying to use Zurb's Foundation 5 and I have the following code that works great, IF, using 4 footer widgets because Foundation uses a 12 column grid.               $sidebars = array('Footer');     foreach ($sidebars as $sidebar) {         register_sidebar(array('name'=> $sidebar,             'before_widget' => '

',             'after_widget' => '

',             'before_title' => '
',             'after_title' => '
'         ));     }       But, in this case I need 5 widget areas and so I want to set the first widget area to:               class="large-4"       and the other 4 widget areas to:               class="large-2"      How would I change the code to accommodate that scenario? Is it even possible? Thanks!


Nesting Functions within Functions

I'm looking for an efficient way to group a series of separate but related functions for a child theme I'm designing using theThematic Theme Framework. Thematic does a great job of providing plenty of action hooks and filters for child theme development, which I'm trying properly utilize. I'm making a lot of changes to the home page, so I have created a series of functions which alter specific content areas but I only want to execute these functions on my site's index page. Previously my functions.php file has looked a lot like this:               <?php          function home_function_a() {               if ( is_front_page() ) {                    //Something Near the top of the Home Page               }          }          add_action('thematic_belowheader', 'home_function_a');               function home_function_b() {               if ( is_front_page() ) {                    //Something in in the sidebar               }          }          add_filter('thematic_sidebar', 'home_function_b');                       function home_function_c() {               if ( is_front_page() ) {                    //Something near the bottom of the page               }          }          add_action('thematic_abovecomments', 'home_function_c');               // etc, etc, etc           ?>      The above technique works but strikes me as somewhat inefficient. I was thinking it might be nice to use a nested function approach as shown below:               <?php         function everything_on_the_home_page() {              if ( is_front_page() ) {                        function home_function_a() {                        //Something near the top of the Home Page                   }                   add_action('thematic_belowheader', 'home_function_a');                        function home_function_b() {                        //Something in the sidebar of the Home Page                   }                   add_filter('thematic_sidebar', 'home_function_b');                        function home_function_c() {                        //Something near the bottom of the Home Page                   }                   add_action('thematic_abovecomments', 'home_function_c');                        // etc, etc, etc                            }         }         add_action('thematic_aboveheader', 'everything_on_the_home_page');       ?>      This code looks a little nicer and seems to work properly, but I wanted to double check to make sure this technique is recommended and Kosher. I tried a couple google searches for articles/forum posts about this approach, but I couldn't find anything helpful. Please let me know if you think my nested function tree is a good way to solve my problems or if you have any other suggestions. Thanks for your time! Best, Jonathan


Order Categories by Hierarchy?

I want order my categories by hierarchy. But I want to use custom select name, id and class like this:               <select name="kategorisec" id="cat" class="postform">     ...     </select>      and I want to use my custom value like this:               <option value="<?php echo $cat->slug; ?>"><?php echo $cat->name; ?></option>      But it doesn't ordering by hierarchy. How can I order the categories by hierarchy (with levels)? Thanks in advance. My all codes:               <?php $args2 = array(       'taxonomy'     => 'fgaleri',         'orderby'      => 'name',      'show_count'   => 1,     'hierarchical' => 1,         'title_li'     => ''       );     ?>     <?php $cats = get_categories($args2); ?>     <select name="kategorisec" id="cat" class="postform">     <option value="">Kategori Seç ve Ara</option>     <?php foreach ($cats as $cat) : ?>         <option value="<?php echo $cat->slug; ?>">     <?php echo $cat->name; ?></option>       <?php endforeach; ?>


How to load the WordPress jquery in the <head> section

**In my WordPress blog I included a javascript-based slideshow** at the top which works well. I have a PHP file which outputs the necessary javascript that has to go in the `<head>` tag by means of an "add_action" in my child theme's functions.php file:               function add_slideshow_js() {     include('/path/slideshow_output.php');     echo $js_output;     }     add_action( 'wp_head', 'add_slideshow_js' );      The javascript that this PHP outputs includes a call to the controlling javascript file:               <script src="path/slideshow.js" type="text/javascript"></script>      ... followed by the javascript that makes the page's slideshow. It all works very well, looks great. The thing is, **it's dependent on jquery** , but it was working fine, so I wondered how jquery was actually being included. I tuned off all my plugins and it stopped working. So obviously one of them was including jquery and allowing it to work. But I thought I'd like to make sure that jquery will be included, without relying on a plugin, since I might delete the vital plugin at some point in the future, and of course I'd still want the slideshow to work. So, with all plugins disabled, I thought I'd include jquery explicitly myself, by writing this function in my child theme's functions.php file:               function insert_jquery(){        wp_enqueue_script('jquery');     }     add_filter('wp_head','insert_jquery');      Now, that does include jquery, but it's called in the footer, and by experimenting I find that the slideshow will only work if jquery is called inside the `<head`> tag. I could write a function to call my own jquery file, but I get the impression that it's best to use the jquery included with WordPress, and in any case, I thought that re-enabling the plugins would then get jquery called twice. So what function can I write in my child theme's functions.php file that will reliably get the WordPress jquery loaded in the `<head>` section of the page? Hope this all makes sense.


Convert mp3 into ogg?

I using an audio player plugin to play mp3 and ogg files. But I'd want the editor to input only a mp3 file and it should automatically be converted into ogg file and send both files to the front-end. Is there any WP function to convert mp3 files into ogg? I've seen some plugins that do that, but they have their own player. I just want the above functionality.


Running WordPress as FTP user?

I've been doing some research on file permissions as of late, as my WordPress installation on my VPS doesn't have write access. From what I've heard it's very dangerous to make the `apache` user the owner of your WordPress files, as `apache` can then do whatever it wants. The WordPress Codex says: > "All of your WordPress files must be either owner writable by, or group > writable by the user under which your Apache server executes." http://codex.wordpress.org/Updating_WordPress That's great, but I've also heard talk of running your WordPress install as the FTP user: > If WordPress is running as the FTP account, that account needs to have write > access, i.e., be the owner of the files, or belong to a group that has write > access. http://codex.wordpress.org/Changing_File_Permissions Any ideas on the best way to set this up? Is it not a bad idea to have the WordPress files owned by the `apache` user? I feel like it is...


Which filter/hook to use for styling comments?

I would like to create a plugin that modify the styling of the comments section. Given that some users may be using other plugin to replace the default commenting system (facebook, disqus, ...), what are my options? Is the `comments_template` filter/template a good place to start? Basically, I intend to "surround" the existing comments output with HTML code. Thanks for the help.


Simplest way to query with blog_id?

What is the simplest way to query posts using blog_id? I have a post type called video that holds, not surprisingly, multiple embedded videos. Each post has a different video. I would like to display a specific video in specific locations across different sites. The video posts are on Site 1, and other sites in the network could be Site 2, Site 3, Site 4 and Site 5. All sites are in the same multisite setup. Each video is currently being identified by matching terms in two custom taxonomies, Taxonomy A and Taxonomy B. If all posts were on the same blog I would use this to query the right video:               $video_query = new WP_Query( array(         'post_type' => 'video',         'post_status' => 'publish',         'posts_per_page' => 1,         'no_found_rows' => true,         'tax_query' => array(             'relation' => 'AND',             array(                 'taxonomy' => 'TaxA',                 'field' => 'slug',                 'terms' => $the_termA             ),             array(                 'taxonomy' => 'TaxB',                 'field' => 'slug',                 'terms' => $the_termB             ),         )     ) );          if( $video_query->have_posts() ) :         while( $video_query->have_posts() ) :         $video_query->the_post();       **How can I make the query only look for posts in Site A?**


Stats for a wp powered intranet

I'm currently building a simple intranet powered by wordpress. I need to show the stats (most read articles, user logins, etc..) to the administrator, but I can't use google analytics as the install is on a VPN without internet access. Do you know any reliable plugin to record and show stats on a local install of wordpress?


Getting two wp_link_pages output

http://i.stack.imgur.com/Yr35p.jpg As you can see in the picture above. I got two links for each page. I'm using `<div class="pagelink"><?php wp_link_pages('pagelink=Source %'); ?></div>` for the top one and the bottom one is automatically appearing because of `<!-- nextpage-->` So how do I remove the links in the bottom. If I remove `<!--nextpage-->` the top one will dissapear as well. Thanks. Edit: My single.php               <?php get_header(); ?>

     <?php                      if (have_posts()) :                          while (have_posts()) : the_post(); ?>
<?php the_title(); ?>

by <?php the_author(); ?>

<?php wp_link_pages('pagelink=Source %'); ?>

     <?php the_content('
Read the rest of this entry »
'); ?>     <?php link_pages('
Pages: ', '
', 'number'); ?>

                          <?php comments_template(); ?>     <?php                          endwhile;                     else: ?>
Uh oh.

Sorry, no posts matched your criteria. Wanna search instead?
     <?php include (TEMPLATEPATH . '/searchform.php'); ?>

     <?php                      endif; ?>
                      <?php include (TEMPLATEPATH . '/left_bar.php')?>
                  <?php get_sidebar(); ?>
          <?php get_footer(); ?>      My theme is: Neoclassical


What's an easy way of sorting custom post types manually?

I'm using the bbpress plugin. It has a custom post type called **forums**. I used to sort posts by changing its publishing date. But you can't do that with this custom post type. Any suggestions?


How can I list Custom Post Types created with the Types plugin under categories?

I am using the Types plugin and have ticked _Categories_ under the **Registered taxonomies that will be used with this post type** section. However, no categories seem to appear. Has anyone encountered this problem before? Any advice appreciated.


Check to see if specific loop has less than certain amount of posts

I'm looking for a way to check how many posts are returned by a specific loop. So if I have a loop like this..               <?php      $featured_post_id = get_the_ID();      global $post;      $args = array('cat' => '9', 'posts_per_page' => 5, 'post__not_in' => array($featured_post_id) );      $my_query = new WP_Query($args);      if ( $my_query->have_posts() ) : while ( $my_query->have_posts() ) :   $my_query->the_post(); ?>      And if this loop returns less than 5 posts then I want to show something. In my situation I'd be showing another loop to add more results.


Removing "trashed" posts from post count in custom taxonomy terms?

I found a function that counts the number of posts in a custom taxonomy term. The problem is when I "trash" a post it still appears in the count. Any ideas on how to fix this? Placed in functions.php:               //Job count          function wt_get_category_count($input = '') {     global $wpdb;     if($input == '')     {     $category = get_the_category();     return $category[0]->category_count;     }     elseif(is_numeric($input))     {     $SQL = "SELECT $wpdb->term_taxonomy.count FROM $wpdb->terms, $wpdb->term_taxonomy WHERE $wpdb->terms.term_id=$wpdb->term_taxonomy.term_id AND $wpdb->term_taxonomy.term_id=$input";     return $wpdb->get_var($SQL);     }     else     {     $SQL = "SELECT $wpdb->term_taxonomy.count FROM $wpdb->terms, $wpdb->term_taxonomy WHERE $wpdb->terms.term_id=$wpdb->term_taxonomy.term_id AND $wpdb->terms.slug='$input'";     return $wpdb->get_var($SQL);     }     }      Placed in the template file: (term located by id)               <?php echo wt_get_category_count('26'); ?>


Integrate Wordpress and bbpress profiles?

I have installed bbforum plugin in my wordpress. However It has two separate profiles for the blog users and the forum users. Blog users have profiles url: /author/test/ While forum users have profile: /forums/users/test/ Is it possible to integrate both profiles and make only a single profile? So that the users in forums also have same url as the blog profile? Thanks


How to allow registered users to submit the form only 5 times per day?

# Question Is there a way that my registered users (if they are not the form is hidden so I don't need that) are restricted to submit the form more than 5 times per day, or 20 per month or whatever value I would use? And I would also need to display the number of sumbmissions they have left. If they already sent the form 3 times they would have the function echo something like: "You have 2 submissions left for today". ## Form code (like every other form with submit on bottom :) )               <form id="submiter" method="post" action="<?php echo get_author_custom_permalink(        b_extract_user_info('user_id') , 'submit' ); ?>" onsubmit="return ray.ajax()"      enctype="multipart/form-data">          bla bla bla form fields...          <input type="submit" value="<?php print __('Submit', 'an'); ?>" class="button-form" />     <input type="hidden" name="user_id_value" value="<?php echo        b_extract_user_info('user_id'); ?>" />     <input type="hidden" name="action" value="wp_handle_upload" />     <input type="hidden" name="jj_form_action" value="submit_post" />      i would really appreciate any help! Thanks everyone :)


Error trying import one category on page

I'm trying to post on this page only posts from category "Fotos Abertas" but I'm not getting, is showing all categories. Is there any error in the code of my template?               <?php      /*     * Template Name:Modelos Fechadas     */     get_header(); ?>

<?php the_title(); ?>

                                   <?php query_posts('category_name=Fotos Fechadas'); ?>                                   <?php                              $loop = new WP_Query( array('post_type' => 'post','paged' => $paged) );                             if($loop->have_posts()) : while($loop->have_posts()) : $loop->the_post();                             global $post,$wp_query;                             at_set_query($loop);                                  // $meta = get_post_meta( $post->ID, $key = 'staff_meta', true );                          ?>
                             <div id="post-<?php the_ID(); ?>" <?php post_class('post-item'); ?>>                                 <?php if(has_post_thumbnail( )) { ?>
                                     <?php the_post_thumbnail( 'blog-post' ); ?>                                     <a href="<?php the_permalink(); ?>" target="_blank" class="more"><?php _e('Veja mais sobre a modelo','at'); ?>

                                                 <?php the_title(); ?>

                                 <?php } ?>

                     <?php endwhile; ?>
                     <?php echo at_pagination(array( 'type' => 'numbers', 'class' => ''));                         at_restore_query();                      ?>
                          <?php endif; ?>

<img src="<?php bloginfo('stylesheet_directory'); ?>/img/bg_wall.jpg" />

     <?php get_footer(); ?>


is ther a plugin that will hide/show content for a scheduled period of time?

We would like to post some html during a specific time on a given day of the week.   For instance: _Imagine a website for a TV station that wants to show what is on the air right now._ I am looking for a plugin that will do this. We will pay. I found something at this site: http://premium.wpmudev.org/project/scheduled-content/ I do not want to subscribe to all their other stuff, just to get one plugin. Any suggestions would be welcome.


Show special backend content for certain roles

I think I'm pretty close to what I need, but just need a little direction. I'm trying to show a content widget in the backend to users of a certain role. Right now, I'm just testing it out with a user that has a role of `subscriber`. **This works perfect :**               <?php          // Add a widget to the WordPress dashboard         function wpc_dashboard_widget_function()          {             // Do whatever you want to render in here             echo '

Special Offer One

Special Offer Text will go here!

';         }         function wpc_add_dashboard_widgets()          {             wp_add_dashboard_widget('wp_dashboard_widget', 'Special Offers Just For                Vendors', 'wpc_dashboard_widget_function');         }         add_action('wp_dashboard_setup', 'wpc_add_dashboard_widgets' );     ?>      But that shows it to all users. I would like to only show to a certain role and was trying to use:               if (!current_user_can('subscriber')):     endif;      along with it, but it just screws things up and the special widget doesn't show at all for anyone. Any ideas?


Getting featured image of blog page rather than post image

I have a page called "Blog" which uses "Default Template" (index.php). It has a featured image. I want to display this image, but when I use get_post_thumbnail_id(), inside or outside the loop, I get the thumbnail of the first post on my blog, not the one of my "Blog" page. Just in case, in Settings > Reading, Posts Page is set as "Blog"


Custom Permalinks for Blog Posts Only

I know this is a fairly common topic around here, but I can't seem to figure out a solution to my particular case from reading similar threads. Basically, my permalink structure needs to be /%postname%/ for compatibility with a finicky plugin. The plugin authors may fix this in the future, but for now I need to come up with my own solution. The problem is, I want my blog post urls to be /blog/%postname%/. I need some way to hook into the URL rewriting for just the `post` post type and change the permalink structure from /%postname%/ to /blog/%postname%/. Any ideas?


Custom sidebar not showing in the dashboard

I am trying to create a new sidebar. For that I have used the following code: In `functions.php`               if ( function_exists('register_sidebar') )     register_sidebar();          if ( function_exists ('register_sidebar')) {     register_sidebar ('sidebar-custom');     }       Then I created a file called `sidebar-custom.php`.The code for that file is as follows               <ul class=”sidebar”>          <?php if ( !function_exists('dynamic_sidebar') ||                !dynamic_sidebar('sidebar-custom') ) : ?>          <?php endif; ?>     </ul>      But the sidebar area is not visible in the dashboard.I know I have done something terribly wrong. But dont know what it is. Can anyone help?


Grabbing the_content from "about us"

I have created an "about us" page as I am currently in developing for a client's website. It has a couple of paragraphs, the title & a feature image. What I would like to do is be able to grab all three of them and place them in the home page. How would I go around and do that?


How can I set wp_dropdown_users so that it shows only authors?

I want to list in a drop-down box all users who have role "author" How can i do it? Thank you


Read text defined under __()

I am new to WP Plugin development. I have a theme where texts are included inside __() function for translations, like:               __('This is text to be translated');      I want to create a plugin which would get the value from __() functions and run through my own defined functions. Suppose the text inside __() contains               __("This is JavaScript alert <script>alert('Hello');</script>");      I want my plugin to do sanity check before printing it in the browser, something like:               function my_sanitizer($text) {       $text = trim(strip_tags($text)); // The $text is value from __() of above       return $text;     }      and the sanitized text should print in the browser. How shall I be approaching this, any hints, ideas, solutions would be appreciated.


Change Post Template based on post meta?

I am trying to figure out a way to use a custom template within my plugin. I would like to avoid using a custom post type if possible. I searched for a way to add my theme file to the dropdown list in the admin (under page attributes), but nothing seems to work. Here is what I have:               add_filter('page_template', 'catch_plugin_template');          function catch_plugin_template( $template ) {     if( is_page_template('page_template.php') ){         $template = WP_PLUGIN_DIR . '/myplugin/page_template.php';         return $template;        }     }       However, since I can never select "page_template.php" from the template list it wont fire. Any suggestions on how to fix this or another way to approach it? I have considered changing the template based on whether or not certain post meta has a value, but I can't get that to work. The code above works fine if I remove the **if statement** but I'm hoping for some sort of viable alternative.


fetch meta fields inside a widget

I'm trying to fetch a (date) meta field from a custom post type in a sidebar widget here: http://www.oransje.com/utvikling/ngnf/kurs/ Somehow the date doesn't show correctly inside the widget (everywhere else I put it, also manually in the sidebar the code works fine). Anyone a clue? The code looks like this:               <?php $loop = new WP_Query(array(      'post_type' => 'kurs',      'posts_per_page' => '5',     'meta_key' => 'dato',     'meta_value' => date('Y-m-d'),     'meta_compare' => '>=',     'orderby' => 'meta_value',     'order' => 'ASC'      )); ?>          <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>          <?php $display_date = date('d.m.Y', strtotime(get_post_meta($post->ID, "dato", true))); ?>
<?php echo $display_date; ?> - <?php the_title( '', '' ); ?>
          <?php endwhile; ?>


Extend walker - navigation, adding data attribute to a tag

I would a data attribute to the `a` tag in the menu, like have `<a href="#example" data-attribute="attribute">CLICK</a>`   I know that I have to extend the Walker BUT I tried in several times (finding some code on internet) and I never made it work. Here the code (I've still not tried to insert the `data-attribute` because before I would make the menu works.) CODE:               /* WALKER */     wp_nav_menu( array(      'container' =>false,      'menu_class' => 'nav',      'echo' => true,      'before' => '',      'after' => '',      'link_before' => '',      'link_after' => '',      'depth' => 0,      'walker' => new description_walker())      );      class description_walker extends Walker_Nav_Menu     {           function start_el(&$output, $item, $depth, $args)           {                global $wp_query;                $indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';                     $class_names = $value = '';                     $classes = empty( $item->classes ) ? array() : (array) $item->classes;                     $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );                $class_names = ' class="'. esc_attr( $class_names ) . '"';                     $output .= $indent . '
ID . '"' . $value . $class_names .'>';                     $attributes  = ! empty( $item->attr_title ) ? ' title="'  . esc_attr( $item->attr_title ) .'"' : '';                $attributes .= ! empty( $item->target )     ? ' target="' . esc_attr( $item->target     ) .'"' : '';                $attributes .= ! empty( $item->xfn )        ? ' rel="'    . esc_attr( $item->xfn        ) .'"' : '';                $attributes .= ! empty( $item->url )        ? ' href="'   . esc_attr( $item->url        ) .'"' : '';                     $prepend = '';                $append = '';                $description  = ! empty( $item->description ) ? ''.esc_attr( $item->description ).'' : '';                     if($depth != 0)                {                          $description = $append = $prepend = "";                }                      $item_output = $args->before;                 $item_output .= '';                 $item_output .= $args->link_before .$prepend.apply_filters( 'the_title', $item->title, $item->ID ).$append;                 $item_output .= $description.$args->link_after;                 $item_output .= '';                 $item_output .= $args->after;                      $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );                 }     }      And here the errors: ![enter image description here](http://i.stack.imgur.com/CxzpY.png) Could any help me? Thanks :)


SFC Problem with the comment login

I want to use the comment function of the SFC plugin for my website. However, every time I click the log in with Facebook button a little window pops up asking for the app connection then disappears and nothing else happens. I can use the comment form in the normal way but not with the Facebook log in.


Custom Post Type Events Archive Grouped By Month

I'm currently trying to get my events listing code to print out headers by Month. So basically this: October   * event    * event September   * event   * event etc... Right now it just keeps echoing January. I think it might have something to do with the $currentMonth or the strtotime() but I'm not sure what. Any suggestions? I've been looking at this post to try and figure it out. Thanks!               <?php          $args = array(         'post_type' => 'events',         'orderby' => 'meta_value',         'meta_key' => 'tf_events_startdate',         'order' => 'DESC'         );              $my_query = new WP_Query($args);              if ($my_query->have_posts()) : while ($my_query->have_posts()) :         $my_query->the_post();              $custom = get_post_custom(get_the_ID());              // dates         $sd = $custom["tf_events_startdate"][0];         $ed = $custom["tf_events_enddate"][0];              // - local time format -         $time_format = get_option('time_format');         $stime = date($time_format, $sd);         $etime = date($time_format, $ed);              // set headers              if(!isset($currentMonth) || $currentMonth != date("m", strtotime($sd))){             $currentMonth = date("m", strtotime($sd));                    echo '
'.date("F", strtotime($sd)).'
';              }?>

             <a href="<?php the_permalink();?>"><?php the_title();?>
             <?php // - determine if it's a new day -             $longdate = date("l, M j, Y", $sd);             if ($daycheck == null) { echo $longdate; }             if ($daycheck != $longdate && $daycheck != null) { echo $longdate; } ?>
             <?php echo $stime;?>

         <?php endwhile; else: ?>

<?php _e('No Events Yet .'); ?>

         <?php endif; ?>


Plugin - create a page without it appearing in the side menu

I am currently using add_submenu_page to add pages for my plugin. However, I wish to create a page that don't appear in the admin menu, is that possible?


Complete Custom Style Part of Site

I have a wordpress site, and I need to apply custom styles to one page, I see the custom styles option, and some of them work, but others get overwritten. Is there a way I can apply strictly my own styles to a portion of the page? Thanks, Brian


Batch Emails with WP-Mail()

I've searched all over Google with no luck. Can someone point me in the right direction for learning how to send out batch emails with the wp_mail() function?


Adding more options to the instance of an image. (Attachment Display Settings)

I'm trying to build a simple reusable plugin for image presentation in Wordpress 3.9, and it seems I've hit a brick wall. I would like to be able to add a couple of options to the instance of the image. (The details under "Attachment Display Settings"). Like a checkbox that says "Responsive" that disables (grays out) the image size dropdown, or options for fixed page positions etc. In the Media Manager when selecting / replacing an image, I've been able to add some custom fields by use of `attachment_fields_to_edit` and it's sibling filters, however these fields attach to the image itself (or the image attachment post object if you will), so if I had two instances of the same image on a page, they would share the same value of my custom field. ![The wordpress replace image screen, annotated.](http://i.stack.imgur.com/ILIZY.jpg) a) The Custom Text field I've added, I'm unable to attach this to the instance, all instances of the same image share this value. b) This is the area where I would like to add options, as everything in here seems to follow each instance. ![The Wordpress image details screen, annotated.](http://i.stack.imgur.com/5TkWd.jpg) c) This shows the same display settings as in the previous screen, however it's presented different when clicking the "pencil" on top of an image in Wordpress 3.9. Notice how the custom options given by `attachment_fields_to_edit` are not present on this screen at all. Even though I haven't gotten my head fully around how backbone works, or what the best practices for modifying the wp.media objects are, I'm fairly competent with both php, js and googling for answers. But this one has had me stumped for a few days now, so any help is appreciated greatly. Thanks for reading!


Delete option value from array using update_option()

I have a user profile field which subscribes the user to forum posts by email. This adds the user's email address to an array in `wp-options`. Naturally I want the user to be able to unsubscribe, in which case he would uncheck a checkbox. Here is how I am trying to do this:               add_action( 'personal_options_update', 'my_save_extra_profile_fields' );     add_action( 'edit_user_profile_update', 'my_save_extra_profile_fields' );          function my_save_extra_profile_fields( $user_id ) {          if ( !current_user_can( 'edit_users', $user_id ) )         return false;          if(!isset($_POST['subscribed'])){              $useremail = get_userdata($user_id, 'user_email');         $list = (array)get_option('mf_forum_subscribers_1');         $key = array_search($useremail, $list);         unset($list[$key]);          } else {              update_option('mf_forum_subscribers_1', $_POST['subscribed']);     }     }      As it isn't doing anything (and I am not getting any errors) I assume I've done this wrong. I looked for a different hook and found `delete_option()` but it only takes one parameter and deletes the whole option. Also (forgive me if this is an obvious question) in a normal form I would change POST to GET so I could see the values submitted. How can I test this when using hooks? (That's not the question to be answered I'm just curious.) Additional information. I realize I probably should have included the functions that show the extra fields in the first place. Here it is :               add_action( 'show_user_profile', 'my_show_extra_profile_fields' );     add_action( 'edit_user_profile', 'my_show_extra_profile_fields' );          function my_show_extra_profile_fields( $user ) { ?>
Player information

           <?php if(user_can( $user, 'edit_posts'))         { ?>
             Email Subscription to Main Forum	                        <?php if(is_player_subscribed($user->data->user_email)){ ?>                              <input type="checkbox" name="subscribe" value="<?php $user->data->user_email ?>" id="subscribed" checked> Automatic Forum e-mails
                 <?php              } else { ?>                     <input type="checkbox" name="subscribe" value="<?php $user->data->user_email ?>" id="subscribed"> Automatic Forum e-mails
                      <?php } ?>                 Check to add subscription to General Forum email
      <?php } ?>
      <?php }


Show comments to unregistered users

I require users to register in order to post comments on www.bbleaks.com However, using this feature in wordpress causes the comments to be hidden if you aren't logged in. How can I show the comments even if you aren't logged in? Thanks!


Wordpress best practice - should I delete the default themes?

when managing a Wordpress site it gives me great pleasure to see nothing needs updating. Should I delete the default themes or is it best to leave them there? By default themes I mean: Twenty Eleven Twenty Twelve Twenty Thirteen Or should I just update them and keep them there for possible troubleshooting in the future?


Execute one AJAX request after another AJAX request finished

One JS file is making an ajax call. Within the success of this ajax call another AJAX call is made. The second call checks whether the email has already been registered. If it has been then the second AJAX call recieves no returned data as shown in firebug and Chrome console in the case. But the same code works just fine in localhost while the mentioned problem takes place ONLY in online server. The hosted page is at `http://twmobilefitness.com/signup/`. The problem takes place when you click on the _'Register Now'_ link at the end. You have to register twice with the same email address if you want to get the problem happen. JS:               $.ajax( {         url : base_url+"/wp-admin/admin-ajax.php",         type : 'GET',         cache : false,         data : 'action=check_user_name&'                + Math.floor( ( Math.random() * 100 ) +1 )                + '&user_name='+user_name,         success : function( result ) {             if ( parseInt( result ) == 0 ) {                 $( ".result" ).html( 'User name not available ' );             } else if ( parseInt( result ) == 1 ) {                 $.ajax( {                     url : base_url                          + "/wp-admin/admin-ajax.php",                     type : 'GET',                     cache : false,                     data : 'action=check_email_used&'                         + Math.floor( ( Math.random() *100 ) +1 )                         + '&email=' + email,                     success : function( result_email ) {                         if ( parseInt( result_email ) == 0 ) {                             $( ".result" ).html( 'Email already used ' );                         } else if ( parseInt( result_email ) == 1 ) {                             $( ".result" ).html( '' );                                   $( ".signup_div" ).hide();                             $( ".signup_emergency_contact" ).show();                         }                     }                 } );             }         }        } );          `functions.php` has               add_action('wp_ajax_check_user_name','check_user_name');     add_action('wp_ajax_nopriv_check_user_name','check_user_name');          add_action( 'wp_ajax_check_email_used','check_email_used' );     add_action( 'wp_ajax_nopriv_check_email_used','check_email_used' );     function check_user_name() {         global $wpdb;              $user_name = trim( $_GET['user_name'] );         $MobTraining = new MobTraining();         $table =trim( "{$wpdb->prefix}users" );         $array_where['user_login'] = $user_name;         $sql_fetch = $MobTraining->fetch( $table, $array_where );         $row = $wpdb->get_results( $sql_fetch, ARRAY_A );         if ( sizeof( $row ) != 0 ) {             echo '0';         } else {             echo '1';         }         die();     }          function check_email_used() {         global $wpdb;              $email = trim( $_GET['email'] );         $MobTraining = new MobTraining();         $table = trim( "{$wpdb->prefix}users" );         $array_where['user_email'] = $email;         $sql_fetch = "SELECT * FROM $table WHERE `user_email`='$email'";         $row = $wpdb->get_results( $sql_fetch, ARRAY_A );         if ( sizeof( $row ) != 0 ) {             echo '0';         } else {             echo '1';         }         die();     }      How to make the code work in online server ?


URL of a custom post type's post format archive?

With pretty permalinks enabled, the URL of a Custom Post Format archive would look like this:               http://example.com/type/link/      And it works for me. Now, considering that my custom post type archive is located at (where 'bookmarks' is the custom post type's name, registered with `'has_archive' => true`):               http://example.com/bookmarks/      Isn't the custom post type's post format archive supposed to be located at:               http://example.com/bookmarks/type/link/      But I get an HTTP 404 Not Found Error. Isn't it how it works? If not, how do I access the custom post type's post format archive?


Cannot Create a new Post

Please help me resolving the issue as I am getting 404 Page not found issue when I click on Create new Post.


Is there any way to put rating stars?

Is there any way to put rating stars after each quotation for rating with the help of GD Star Rating plugin?


WP Ecommerce: Fixing the confirmation email sent to customer upon purchase

I'm pulling my hair out. I cannot find where the purchase confirmation email is created in WP Ecommerce. I found where the message is stored, but I'm seeing an unclosed paragraph tag and it's creating a massive space afterwards and I can't figure out where it's held. I've looked at the following and cannot find it:   * purchase-log-notification.class.php    * options_page.php   * updating_tasks.php I've searched the whole project for the offending element: `<p>You ordered these items:<br /><br />` I've even searched the database, but can't find it.. I feel like I can find the structure, but can't find where that paragraph is being generated. Looking for some guidance. Thanks!


How to call a new php page inside a plugin page?

I have a **custom plugin** that is accessible via WordPress sidebar, this is the option page of my plugin. How do I called a new page inside my option plugin page?
<a href="<?php echo plugins_url(); ?>/myPlugin/create.php">Create
      Apparently, this code above, will display `create.php` but I want this page to be displayed inside the WordPress wp-admin, with the sidebar and all..


Collect user custom field in product page woocommerce

I have a custom user field named "weight" and I need to collect this information in woo product page. How can I do that?


Verify Values Using Settings API

I have recently been working on a WordPress plugin using the Settings API. The only problem i found with it is that the user can manually edit the value in the input tag. I was wondering if there was a way to check the before saving it.


How can I use the WordPress Loop and Pagination in multiple instances but different scenarios throughout my site?

I am using the Starker Theme as a foundation to build my custom WordPress theme. The Starker Theme comes with a loop.php file for setting up the main loop. I decided to use the loop.php file to display content on the homepage of my site. I would like to incorporate this loop as well as the pagination on other pages of my site but I would only like to query specific categories. Below is the code I have in my loop.php. What's the best way to setup other pages or templates on my site and have their own unique queries without conflicting with the main loop?

                                                        <?php                 $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;                 $args=array(                 'post_type'=>'post',                 'cat' => 'featured-news',                 'posts_per_page' => 2,                 'paged'=>$paged                 );                 $temp = $wp_query;                 $wp_query= null;                 $wp_query = new WP_Query($args);                      if (function_exists('wp_pagenavi')) { wp_pagenavi(); }                 if ( $wp_query->have_posts() ) : while ( $wp_query->have_posts() ) : $wp_query->the_post();                 ?>                                                          <article class="post" id="post-<?php the_ID(); ?>" <?php post_class(); ?> >                                       <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( '%s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?>
By <?php echo get_the_author(); ?> / <?php echo get_the_date('m.d.Y'); ?>
                                                        <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(array(640,320)); ?>
<?php the_excerpt(); ?>
                                                        <?php include('includes/social.php'); ?>
                                       <?php                 endwhile; endif;                 /* PageNavi at Bottom */                 if (function_exists('wp_pagenavi')){wp_pagenavi();}                 $wp_query = null;                 $wp_query = $temp;                 wp_reset_query();                 ?>                                                        <?php if ($wp_query->max_num_pages > 1) : ?>
                 <?php next_posts_link( __( '← Older News', 'twentyten' ) ); ?>
                 <?php previous_posts_link( __( 'Newer News →', 'twentyten' ) ); ?>

                      <?php endif; ?>

                                                        <?php query_posts('category_name=other-news&showposts=6'); ?>                 <?php while (have_posts()) : the_post(); ?>

<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( '%s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?>

<?php echo get_the_date('d.m.Y'); ?>

                                       <?php endwhile; ?>
                 View More →


Remove box character after excerpts. Special Character Bug

I want to hide these special charecter (������) after excerpts .. e.g. "Los votos del PP han impedido este jueves que el Parlament apruebe instar al Govern a que en un plazo de mes establezca un calendario en el que detalle las fechas en las que hará efectivos los pagos a los proveedores. Los 'populares **�����** " "“सीएमएस मीडिया लेब” द्वारा जारी आकडे बताते हैं की इन चैनलो ने अपने प्राइम टाइम के कुल समय का **������** " plz guide me


How to edit footer content

The theme I'm using doesn't allow me to edit the footer content and uses: `<?php get_sidebar(); get_footer(); ?>` instead of calling them separately, any suggestions would be greatly appreciated. The theme I'm using is this one: http://pithoe.com/theme/?preview_theme=woddyx Thank you kindly!


Custom metabox field help tips popups

Is there anything built-in to core that displays a little (?) icon next to admin-side input fields (custom metabox input fields, for example) that provide tooltips or a contextual help popup when rolled over? I thought I saw something like that once, but it may very well have been specific to a plugin. Any thoughts?


Banner Advertising plugins for WordPress

I am on the lookout for plugins that can help me set a number of banner spaces with custom sizes, then be able to rotate banners within these spaces. So I could guarantee 10% of all impressions to an advertiser when there are 10 banners for a particular spot. Any suggestions for good plugins, I don't mind if they are premium?


How to share category taxonomy with custom post type (The Event Calendar plugin)

I have a custom post type 'Events' created by The Event Calendar plugin. It has registered it's own custom taxonomy. Is there a way I can assign the regular WP post categories to some of these events so that they will show up on category archives? I see in the answer to this question get_posts cannot grab from specific category that I have to add 'category' to the array of taxonomies supported by the Events post type, something like this: `register_post_type( 'tribe_events', array( 'taxonomies' => array( 'category' ) ) );` What is the next step I have to take to get this to work?