Listing wordpress users with a search function

I'm having trouble finishing off this code that I adapted from Cosmoslabs excellent tutorial. Everything is working (listing and pagination etc) except the search function whic is returning nothing i.e. no users are listed when I try to filter by a keyword. Can anyone see what the problem might be? Thanks for any pointers. Osu               <?php     /*     Plugin Name: WP Author Listing     Plugin URI: #     Description: Simple shortcode to list our WordPress users.     Author: OSU     Version: 1.0     Author URI: #     Licence: MIT          Many thanks for original plugin by: Cristian Antohe [http://cozmoslabs.com/]          */          function osu_user_listing($atts, $content = null) {         global $post;              extract(shortcode_atts(array(             "role" => '',             "number" => '5'         ), $atts));              $role = sanitize_text_field($role);         $number = sanitize_text_field($number);              // We're outputting a lot of HTML, and the easiest way          // to do it is with output buffering from PHP.         ob_start();              // Get the Search Term         // (condition) ? (true return value) : (false return value)         $search = ( isset($_GET["as"]) ) ? sanitize_text_field($_GET["as"]) : false ;              // Get Query Var for pagination. This already exists in WordPress         $page = (get_query_var('paged')) ? get_query_var('paged') : 1;              // Calculate the offset (i.e. how many users we should skip)         $offset = ($page - 1) * $number;              if ($search){             // Generate the query based on search field             $my_users = new WP_User_Query(                  array(                      'role' => $role,                      'search' => '*' . $search . '*' // Assuming the problem is around here?                 ));         } else {             // Generate the query              $my_users = new WP_User_Query(                  array(                      'role' => '', // Default is all                     'offset' => $offset ,                     'number' => $number                 ));         }                   // Get the total number of authors. Based on this, offset and number          // per page, we'll generate our pagination.          $total_authors = $my_users->total_users;              // Calculate the total number of pages for the pagination         $total_pages = intval($total_authors / $number) + 1;              // The authors object.          $authors = $my_users->get_results();     ?>

Search authors by name
             <form method="get" id="sul-searchform" action="<?php the_permalink() ?>">                 Search                 <input type="text" class="field" name="as" id="sul-s" placeholder="Search Authors" />                 <input type="submit" class="submit" name="submit" id="sul-searchsubmit" value="Search Authors" />             </form>         <?php          if($search){ ?>
Search Results for: <?php echo $search; ?>
             <a href="<?php the_permalink(); ?>">Back To Author Listing         <?php } ?>
          <?php if (!empty($authors))  { ?>
     <?php         // loop through each author         foreach($authors as $author){             $author_info = get_userdata($author->ID);             ?>
                 <?php echo get_avatar( $author->ID, 90 ); ?>
<a href="<?php echo get_author_posts_url($author->ID); ?>"><?php echo $author_info->display_name; ?> - <?php echo count_user_posts( $author->ID ); ?> posts

<?php echo $author_info->description; ?>
                 <?php $latest_post = new WP_Query( "author=$author->ID&post_count=1" );                  if (!empty($latest_post->post)){ ?>
Latest Article:                 <a href="<?php echo get_permalink($latest_post->post->ID) ?>">                     <?php echo get_the_title($latest_post->post->ID) ;?>
                 <?php } //endif ?>
<a href="<?php echo get_author_posts_url($author->ID); ?> ">Read <?php echo $author_info->display_name; ?> posts

             <?php         }     ?>
      <?php } else { ?>
No authors found
     <? } //endif ?>
Post navigation
             <?php if ($page != 1) { ?>                 <a rel="prev" href="<?php the_permalink() ?>page/<?php echo $page - 1; ?>/">< Previous             <?php } ?>                  <?php if ($page < $total_pages ) { ?>                 <a rel="next" href="<?php the_permalink() ?>page/<?php echo $page + 1; ?>/">Next >             <?php } ?>                            <?php          // Output the content.         $output = ob_get_contents();         ob_end_clean();                   // Return only if we're inside a page. This won't list anything on a post or archive page.          if (is_page()) return  $output;          }          // Add the shortcode to WordPress.      add_shortcode('userlisting', 'osu_user_listing');     ?>


Duplicating wordpress install issue

I wonder if anyone could help me with a problem that I am having. I am having a guy do some plugin/theme customization on my wordpress site and he wants to have a duplicate of the site to work with on localhost. I have sent the mysql database and a copy of the wordpress site in a folder to him or suggested he just work on our 'live' site to get this response. I was wondering whether anyone knew what he meant by 'archived format'? Thanks and sorry if this is dense of me! ' i need the files of the site because i do not want that after cusomization in the plugin, the site looks bad. So that's why i was thinking of working with actual site files so that during this process i wud be getting an idea, how the plugin wud look and work wen integrated actually in the site. For this i have copied the files to the folder site_backup which is located in parallel of wp-contents folder, but in order to download it wat i need is the archived format of that folder, but since the server didn;t have any such option, i m not able to download archived copy of the files.'


Jigoshop and WooCommerce differences

I'm aware that WooCommerce is a fork of jigoshop, and there was some controversy, however now that both have had releases since their divergence, how do they differ in features and direction?


On the post list, how do you show different text to the main content?

Not sure if the title makes sense sorry, but at the moment on my blog there is a long list of posts (with the thumbnail custom field) - the text next to the thumbnail is just the first characters from within the post. How exactly do I change that to something else? Thanks!


Extending the search context in the admin list post screen

I have a created a custom post type and have attached some custom fields to it. Now I would like for the search that authors can perform on the custom post list screen (in the admin backend) to also be performed on the meta fileds and not only look in the title and content as usual. Where can I hook in and what code I have to use? **Example image** ![enter image description here](http://i.stack.imgur.com/30leQ.png) Stefano


Show certain terms from custom taxonomy but exclude 'parent' terms?

I have a custom post type "mycustom_products" (hierarchical) that has custom taxonomies called 'categories' and 'tags' (as many other custom post types do). My custom category is called "myprod_category" (also hierarchical) and my tag taxonomy is called "product_tag" ( _not_ hierarchical). I want to show a list of Product Tags that correspond ONLY to certain Product Categories. For example, with Product Categories like "soap" & "lotion", there might be tags called "Blueberry" or "Lavender" (scents) but "jewelry" would have tags like "silver" or "gold". I want to be able to have a listing of the "scent" only tags (which would be the ones that correspond only with the "soap" and "lotion" categories. I don't want the tags for "jewelry" to be included. So any tags that have been used on products entered in those categories would be included, and any used for other categories wouldn't be. Obviously I could hard code everything into the theme, but if/when the client adds more tags, I would have to go in and re-code everything and I'd like to avoid doing that. I tried using `<?php wp_tag_cloud( array( 'taxonomy' => 'product_tag', format => 'list' ) ); ?>` to list out all my tags, but I can't seem to get the EXCLUDE argument to prevent whole "product categories" from showing. Seems like I can do it using the tag_ID but that would be tedious, and would put me back to hard coding them into the theme and having to update each time a new tag is added. Is there a filter or something I can use to exclude a category? Or is there a better way to list tags in this fashion. Thanks!


custom post type problem

Let me explain. I have a link `www.mydomain.com/%artist-name%/%song-title%/`.   `artist-name` is a custom post type.   `song-title` is the title of the post. Now, `www.mydomain.com/%artist-name%/%song-title%/` displays the song entry -which is working great. The problem is when I'm in `www.mydomain.com/%artist-name%/`. It would display all the post titles. I don't want it to be that. Is there a way to make it post the artist's info? **note:** `%artist-name%` and `%song-title%` can have any value. That's why it's really a problem.


File Upload with Server in safe_mode

When I try to upload an image to a post, I get an error: "The uploaded file could not be moved to /home/httpd/xxxx/xxxx/xxx/wp/wp- content/uploads." My server is set up in safe_mode - is that the problem? What can I do about it?


My .js file is getting a 404

I uploaded a few `.js` files, so my `js` folder is in the root (The same level as wp-contents). I have a few .js files, but I just uploaded the masonry library and when I try to access it via `domain.com/js/masory.js`, it just goes to a 404. Is there something I am supposed to do with Wordpress ? The weird thing is, my other javascript in the same file works and it doesn't go to the 404. For example, my custom.js (jQuery stuff) works, but the other doesn't:               <script language="javascript" type="text/javascript" src="http://domain.com/js/jquery.eachdelay-0.0.1.js"></script>     <script language="javascript" type="text/javascript" src="http://domain.com/js/jquery.masonry.min.js"></script>


How to get a taxonomy term name by the slug?

If I know a taxonomy term slug, how can I get that term's name?


I need help about wordpress of members section

function yg_yorumsuz_link_gizle($content) {       global $current_user, $post, $wpdb, $yg_yorumsuz_yazi;       $mesaj = '';      //Eğer giriş yapılmamışsa      if ( !is_user_logged_in() ) {        $mesaj = 'Bağlantıyı Görmek için Giriş/Yorum Yapmalısınız';      }else{        //Giriş yapılmışsa ancak yorum yapılmamışsa        if ( (int) $yg_yorumsuz_yazi == $post->ID ) $yorum_sayisi = 0;         else $yorum_sayisi = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_post_ID = '%d' AND user_id = '%d'", (int) $post->ID, (int) $current_user->ID));        if ( 1> $yorum_sayisi) {          $mesaj = 'Bağlantıyı Görmek için Yorum Yapmalısınız';          $yg_yorumsuz_yazi = $post->ID;        }      }      if ($mesaj) return preg_replace('/(][^<]*<\/a>)/', $mesaj, $content); else return $content;     }     function yg_link_gizle($attr)     {      if ($attr['title'] == "") $attr['title'] = $attr['link'];      $link = ''.$attr['title'].'';      return yg_yorumsuz_link_gizle($link);     }     add_action('the_content', 'yg_yorumsuz_link_gizle');     add_shortcode('ygizle', 'yg_link_gizle');      i could show my links to my member witch write a comment but the thing is how could i do this to the place i chose


Where are my posts linked to? I keep getting a Not Found Error, and I have no single.php page

Recently I had someone customize a WP blog for me. This person didn't do a very will job so I decided to do it myself. I customized my own blog page and it all works, except for when I click on the posts I get a "Not Found Error" page. I looked through the old blog that some person made and I can't tell where that person linked my posts to. The only clue I have is this bit of code after the `<?php the_content(); ?>`:               <?php wp_link_pages( array( 'before' => '
' . __( 'Pages:', 'twentyten' ), 'after' => '
' ) ); ?>      I left this bit of code out when I customized my own page. Now I Get a "Not Found Error" when I click on the Post, here is my blog page:                   <?php     /*     Template Name: Blog     */     ?>          <?php get_header(); ?>

Web   Design   inspiration,  all   resources  you   could   need !

            <?php if (have_posts()) : ?>            <?php query_posts('posts_per_page=3'); ?>            <?php while (have_posts()) : the_post(); ?>

<a class="lightbox-image box-image" data-gal="prettyPhoto" href="<?php echo catch_that_image() ?>"><img src="<?php echo catch_that_image() ?>" alt="" />

<a class="link-1" href="<?php the_permalink() ?>" title="Go to <?php the_title(); ?>"><?php the_title(); ?>

Posted on: <?php the_time('m/d/y') ?>

<?php the_content() ?>

             <?php endwhile; ?>

                <?php next_posts_link(' ') ?>

            <?php else : ?>
Not Found

Sorry, but you are looking for something that isn't here.
     <?php endif; ?>
          <?php get_footer(); ?>      Thanks in advance! (P.S. I'm working in my local host so I don't have a webpage that you can go to.)


get latest post in category date

I'm building an ajax archive tool. Among the functionalities it can list categories. For each entry i'm displaying the category name (with an anchor that links to the category page) and the number of entries for the category. I would also like to show the date when a post was last added to the category. Is there a way to do this without having to make a new wp_query for each category getting the last post and then it's date?


woocommerce how to get cat id in content-product.php

I installed the woocommerce plugin. my page url is like this http://sitename.com/product-category/products-and- service/servicecat1/ products-and-service - is the main category servicecat1 - is the sub category In this page the list of products are displayed. I want to get the category id of the subcategory (i.e servicecat1) I used the following code                 $q_cat = get_query_var('cat');      AND                    $term_list = wp_get_post_terms('servicecat1','product_cat');      But it is not working. How to get this id. I used this code in content-product.php Please help to get this.


add_filter and remove_filter added before and after wp_query

I have just started with WordPress Development, and found following block of code online (in some tutorial)               function filter_where( $where = '' ) {    // posts in the last 30 days         $where .= " AND post_date > '" . date('Y-m-d', strtotime('-30 days')) . "'";         return $where;     }          add_filter( 'posts_where', 'filter_where' );          $args = array(         'posts_per_page' => -1,     );     $the_query = new WP_Query($args);          remove_filter( 'posts_where', 'filter_where' );      I am not able to understand **why** add_filter and remove_filter are called before and after WP_Query? In what scenario we need to use above kind of pattern?


Editing Source Code in Wordpress

I am a senior in a college computer science program, and therefore have a decent knowledge of code and several languages. However, I am doing a summer internship type program, and the company I am working with hosts their webpage on Wordpress, which to which I am new. They want me to edit some of the code in order to do various things, such as enable a photo container to be a moving slideshow. Figuring out the javascript and html to achieve the results they desire is not problematic for me. However, I am unsure how to get full access to the Source Code of the site. I have privileged access to the backend of the site but in wordpress when you go to edit it only shows some of the basic html tags while hiding the and tags and code. Is there any way edit the page in its source code format? I don't want to have to go through the simplified and less expressive/less control Wordpress interface, and I don't even know if I can achieve the desired results with it. Thanks for your help.


wp_localize_script $handle

Can anyone tell me what the "`$handle`" ( first parameter ) of `wp_localize_script` is normally used for. Thanks. P.s.: I have no idea why but stackexchange is telling me this question dosen't meet quality standards. Edit: When i put in my ps it accepted it so i suppose it's the length of the quesion.... if you feel like this is an unacceptable question then apologies


Group post archive by last two weeks and months

I want to show an archive menu in each page in the following manner:               Today     Yesterday     This week     Last week     This month     Last month     Earlier      How could I do that?


How to use HyperDB plugin in a existing wpmu

I am using wordpress multisite v3.5.1 in a single db called `maindb`. And i have also 5 blog. They are **bazar** (main blog), **demo1** , **demo2** , **demo3** and **demo4**. In future i want add more blog but i want to create a database for each blog and want to use them(but also in a single network). as like **maindb** for **bazar** (main blog) blog, **db1** for **demo1** blog, **db2** for **demo2** blog, **db3** for **demo3** blog, **db4** for **demo4** blog ... How i do that with **hyperdb**? how would `db-config.php` code will be look like for my this condition? please help me.


Display custom fields in frontside user profile

I installed the `CIMY User Extra Fields` plugin to add new custom fields in theuser profile. I added 1 custom field for gender to the user profile but it displays only in the admin panel user profile. How to display on the front side registered user profile page? Have any one idea.. Please send me step by step because new in WordPress.


Mamp pro permalink issues. Pages keep reverting to index.php

So I pulled a site down to my local machine to do some work on it. Copied the files, find/replace on the database to update the url, added a host. Everything worked fine until I changed the permalink settings. Now every page uses the index.php template in my theme folder instead of the page.php. Of course it works fine when you use the default settings, but not any others that require htaccess directives. I have tried everything I can think of including changing the AllowOverride None to All in the httpd.conf. Anyone else have any ideas? I am at a complete and frustrated loss. Edit: Here is my htaccess file:               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>     # END WordPress


override function from my plugin

can anyone guide me how can I override following function from my plugin. I know how to use add_action but I didn't found add_action for this function in buddypress plugin. Its using do_action and I am not sure how to get it working               function groups_screen_group_request_membership() {     global $bp;          if ( !is_user_logged_in() )         return false;          $bp = buddypress();          if ( 'private' != $bp->groups->current_group->status )         return false;          // If the user is already invited, accept invitation     if ( groups_check_user_has_invite( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) {         if ( groups_accept_invite( bp_loggedin_user_id(), $bp->groups->current_group->id ) )             bp_core_add_message( __( 'Group invite accepted', 'buddypress' ) );         else             bp_core_add_message( __( 'There was an error accepting the group invitation, please try again.', 'buddypress' ), 'error' );         bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) );     }          // If the user has submitted a request, send it.     if ( isset( $_POST['group-request-send']) ) {              // Check the nonce         if ( !check_admin_referer( 'groups_request_membership' ) )             return false;              if ( !groups_send_membership_request( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) {             bp_core_add_message( __( 'There was an error sending your group membership request, please try again.', 'buddypress' ), 'error' );         } else {             bp_core_add_message( __( 'Your membership request was sent to the group administrator successfully. You will be notified when the group administrator responds to your request.', 'buddypress' ) );         }         bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) );     }          do_action( 'groups_screen_group_request_membership', $bp->groups->current_group->id );          bp_core_load_template( apply_filters( 'groups_template_group_request_membership', 'groups/single/home' ) );      }


How to set ckeditor to VISUAL mode by default instead of HTML mode in bbpress

I've just installed bbpress and ckeditor. I have only these plugins activated and my theme is twenty twelve. So when in the blog part, I mean the main page and such, ckeditor works perfectly. This in the sense that all the editor box is shown in visual mode. In this part there is no button to work with HTML code, which is perfect for my purposes. But then the problem is when I go into the forums part and try to make a comment or to make a new post because it seems that there's no editor there. There's no box, no cursor bar, and no ck editor buttons. I've been looking all over the internet and I just found that I need to add a snipet code to my functions theme. http://codex.bbpress.org/enable-visual-editor/               function bbp_enable_visual_editor( $args = array() ) {     $args['tinymce'] = true;     return $args; }     add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );      The problem now is that I have just two buttons, one for VISUAL mode and the other one for HTML code, but still no buttons, no cursor bar, no anything. When I press the button for visual mode then it appears the editor as it should be. But this is almost the same because we always expect to have visual mode by default, just like the one I'm using right now to make this question. So the problem is that people would always think that there is no editor, or even if they know about it I think it's just wrong. How can I fix this problem? This is how it looks in the blog part, by default and I like to have it also in the forums: ![enter image description here](http://i.stack.imgur.com/WrBD7.jpg) This is how it looks in the forums editor, without the snipet code: ![enter image description here](http://i.stack.imgur.com/9at37.jpg) And this is how it looks after the snipet code. ![enter image description here](http://i.stack.imgur.com/5NVj8.jpg)


How to access the actual input html of the login form

I'm designing a custom login template and I need a way to access the `<input>` html so I can add a label inside the input. I understand the use of `wp_login_form()` but that only lets me set the default lables outside the input to blank. I need to add the `onfocus` and `onblur` attributes to the html. Any ideas?


How to display user's nickname by default instead of username

I need to display the user's nickname by default after they are created in the DB, NOT the username. I am creating a user with:                   wp_create_user( $user_name, $random_password, $user_email );      updating the user nickname field directly after user creation:                   update_user_meta($user_id, 'nickname', $user_nickName);      Now i need the "Display name publicly as" to be set to the nickname as default not the username. My WP is automatically defaulting the users display name as the username. How do i put the selected value for the display name(Display name publicly as) as my nickname value programmatically?


Importing images from blogspot to wordpress

The import process is easy enough and everything is imported correctly. The one thing I can't figure out is how to change what size image gets imported into the posts. The image that gets imported is the right size, but it always selects the smallest size image to insert into the post and I need the largest size (or the size that was selected in blogspot, either would work). I just don't want to go back through hundreds of images and replace them. Does anyone know how to import the images in such a way?


Adjust the order for returned posts

I have written a neat responsive slider for my Wordpress featured articles (feel free to use it):               <?php          $responsive = 'on' != get_option('henrik_responsive_layout') ? false : true;         $featured_auto_class = '';         if ( 'on' == get_option('henrik_slider_auto') ) $featured_auto_class .= ' et_slider_auto et_slider_speed_' . get_option('henrik_slider_autospeed');     ?>     <div id="featured" class="<?php if ( $responsive ) echo 'flexslider' . $featured_auto_class; else echo 'et_cycle'; ?>">         <?php esc_html_e('Previous','henrik'); ?>         <?php esc_html_e('Next','henrik'); ?>          <?php if ( $responsive ) { ?>
     <?php } else { ?>
     <?php } ?>             <?php global $ids;             $ids = array();             $arr = array();             $i=0;                  $featured_cat = get_option('henrik_feat_cat');              $featured_num = (int) get_option('henrik_featured_num');                   if (get_option('henrik_use_pages') == 'false') query_posts("showposts=$featured_num&cat=".get_cat_ID($featured_cat));             else {                 global $pages_number;                      if (get_option('henrik_feat_pages') <> '') $featured_num = count(get_option('henrik_feat_pages'));                 else $featured_num = $pages_number;                      query_posts(array                                 ('post_type' => 'page',                                 'orderby' => 'menu_order',                                 'order' => 'ASC',                                 'post__in' => (array) get_option('henrik_feat_pages'),                                 'showposts' => (int) $featured_num                             ));             } ?>             <?php if (have_posts()) : while (have_posts()) : the_post();             global $post; ?>             <?php if ( $responsive ) { ?>
             <?php } else { ?>
             <?php } ?>                     <?php                     $width = $responsive ? 960 : 958;                     $height = 340;                     $small_width = 95;                     $small_height = 54;                     $titletext = get_the_title();                          $thumbnail = get_thumbnail($width,$height,'',$titletext,$titletext,false,'Featured');                          $arr[$i]['thumbnail'] = get_thumbnail($small_width,$small_height,'',$titletext,$titletext,false,'Small');                     $arr[$i]['titletext'] = $titletext;                          $thumb = $thumbnail["thumb"];                     print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height, ''); ?>

<?php esc_html_e('Posted','henrik'); ?> <?php esc_html_e('by','henrik'); ?> <?php the_author_posts_link(); ?> <?php esc_html_e('on','henrik'); ?> <?php the_time(esc_attr(get_option('henrik_date_format'))) ?>

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

<?php truncate_post(410); ?>

                         <a href="<?php the_permalink(); ?>" class="readmore"><?php esc_html_e('Read More', 'henrik'); ?>
              <?php if ( $responsive ) { ?>
              <?php } else { ?>
              <?php } ?>             <?php $ids[] = $post->ID; $i++; endwhile; endif; wp_reset_query(); ?>     <?php if ( $responsive ) { ?>
      <?php } else { ?>
      <?php } ?>

             <?php for ($i = 0; $i < $featured_num; $i++) { ?>

                         <a href="#"<?php if ( $i == 0 ) echo ' class="active"'; ?>>                             <?php print_thumbnail( $arr[$i]['thumbnail']['thumb'], $arr[$i]['thumbnail']["use_timthumb"], $arr[$i]['titletext'], $small_width, $small_height ); ?>

             <?php } ?>

       It selects a custom category and returns a custom amount of posts. The problem is that it will display the posts in the order of which they were created. **I want to choose my own order** , so that I can select which posts displays first and so on. **So, is it possible to select which order the returned posts are displayed?** Maybe by targeting specific IDs? Ideally, I would like to set a custom ID (directly in the code) for the first post, and then have the rest display in the returned order as it is. Is that possible? If you choose to reply, please be detailed with code example, thank you for reading.


Correctly delete posts with meta and attachments

I am having an overview of custom post types: http://www.citizen-science.at/wordpress/projekte/roadkill/ubersicht/ These have custom tax and also an attachment. In my overview I need to provide links to delete the entries. With that I also need to delete the attachment and the meta data. I was using this:                   if ( !current_user_can( 'delete_bkroadkill', $post->ID ) )             return;              $link = "ID, 'delete-post_' . $post->ID) . "'>".$link."";         echo $before . $link . $after;      I found Delete Post Link to delete post, its meta and attachments but there is no solution provided. Which will not delete anything else than the post. What is the proper way to do this?


Paginate product variations during product edit

I have a client who has a large number of variation for some products which is causing admin to hang when editing any of the affected products. I have increased max_input_vars to 5000 but this didn't have any effect. I saw this code in github (I have asked Alex but no answer)               $paged = ($_GET['paged']) ? $_GET['paged'] : 1;                 $args = array(                     'orderby'        => 'ID',                     'order'            => 'asc',                     'post_type'        => 'product_variation',                     'post_status'   => array( 'private', 'publish' ),                     'numberposts'   => -1,                     'post_parent'   => $post->ID,                     'posts_per_page'    => 50,                     'paged'            => $paged,                 );                      $variations = get_posts( $args );      https://github.com/woothemes/woocommerce/issues/4907 Does anyone know how to implement this or something similar? Thanks


How to Fix an Archive.php That Displays All Posts?

I am currently working on developing my first large-scale WordPress powered site, and I have run into a major problem in my archive.php file. It loads all posts, rather than the categories/tags that I am looking to display. The basic idea is to have an article-showcase bar in which the first 6 posts will be shown as thumnails, while the rest will be displayed in the normal format. The pagination then kicks in, and the user can click to see the next page of results, in which there will be the same article-showcase, but with the next page of standard posts. To do this I am using two loops, where the second one is offset by 6 posts. I had it working until last night, when I changed some things and reloaded only to have the thing start showing all of the posts on the site. I originally thought it was an issue with my query for standard posts, so I changed it, but now I can see no reason why it shouldn't work.               <?php get_header(); ?>

                  <?php //Check to See If We Are Looking for Posts Of A Specific Category ?>             <?php if (is_category()) {             ?>
                                  <?php _e( ' ', 'bonestheme' ); ?> <?php single_cat_title(); ?>
                  <?php //Check to See If We Are Looking for Posts With A Specific Tag ?>             <?php } elseif (is_tag()) { ?>
                                  <?php _e( ' ', 'bonestheme' ); ?> <?php single_tag_title(); ?>
                  <?php //Check to See If We Are Looking for Posts From A Specific Author ?>             <?php } elseif (is_author()) {                     global $post;                     $author_id = $post->post_author;             ?>
                                  <?php _e( 'Posts By ', 'bonestheme' ); ?> <?php the_author_meta('display_name', $author_id); ?>
                  <?php //Check to See If We Are Looking for Posts From A Specific Day ?>             <?php } elseif (is_day()) { ?>
                                  <?php _e( 'Posted Today:', 'bonestheme' ); ?> <?php the_time('l, F j, Y'); ?>
                  <?php //Check to See If We Are Looking for Posts From A Specific Month ?>             <?php } elseif (is_month()) { ?>
                                          <?php _e( 'Posted This Month:', 'bonestheme' ); ?> <?php the_time('F Y'); ?>
                  <?php //Check to See If We Are Looking for Posts From A Specific Year ?>             <?php } elseif (is_year()) { ?>
                                          <?php _e( 'Posts This Year:', 'bonestheme' ); ?> <?php the_time('Y'); ?>
                  <?php } ?>                  <?php //Begin Archive Article Showcase ?>
                           <?php                      $arcshowcaseargs = array(                 'showposts'=> 6,                 'caller_get_posts'=>1                 );                      $my_query1 = new WP_Query($arcshowcaseargs);                 if( $my_query1->have_posts() ) {                 while ($my_query1->have_posts()) : $my_query1->the_post();                 ?>                                <a href="<?php the_permalink() ?>" rel="bookmark" class="archive-article-showcase-thumbnail">                         <?php if (class_exists('MultiPostThumbnails')) :                         MultiPostThumbnails::the_post_thumbnail(get_post_type(),'secondary-image', NULL,'square-icon-large');                     endif; ?>                         LOL                                       <?php                 endwhile;                 }                 wp_reset_query();  // Restore global post data stomped by the_post().                 ?>
         <?php //End Archive Article Showcase ?>              <?php                      $maincaseargs = array(                 'offset = 6',                 'caller_get_posts'=>1                 );                      $my_query3 = new WP_Query($maincaseargs);                 if( $my_query3->have_posts() ) {                 while ($my_query3->have_posts()) : $my_query3->the_post();                 ?>                        <article id="post-<?php the_ID(); ?>" <?php post_class( 'cf' ); ?> role="article" style="position: relative; padding: 5px; border-bottom: 1px dashed #d4d8d8;">

                             <?php echo get_the_post_thumbnail(NULL, 'main-loop') ;?>

<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?>

By <?php the_author(); ?>

                                          <?php printf( __( '', 'bonestheme' ) . ' <time class="updated" datetime="%1$s" pubdate>%2$s</time> ' . __(' ', 'bonestheme' ) . ' ', get_the_time('Y-m-j'), get_the_time(get_option('date_format')), get_the_author_link( get_the_author_meta( 'ID' ) )); ?>
                              |
                                     <?php comments_number( __( 'No Comments', 'bonestheme' ), __( 'One Comment', 'bonestheme' ), _n( '% Comments', '% Comments', get_comments_number(), 'bonestheme' ) );?>

                  <?php endwhile; ?>                                  <?php bones_page_navi(); ?>                  <?php else : ?>

<?php _e( 'Sorry, No Results.', 'bonestheme' ); ?>

<?php _e( 'Try your search again.', 'bonestheme' ); ?>

                  <?php endif; ?>

          <?php get_footer(); ?>


Add extra fields to Add New Category page

I need to add an extra field to the Add New Category page. Currently it only has fields for Name, Slug, and Description. Essentially, I need to have a second description text box. I use the current Description field at the bottom of each category page, but now I need to have additional information specific to the category (and different from the bottom) displayed at the top. How can I add this additional field? Below is what I am trying to achieve: ![http://i.imgur.com/QLNC6.jpg](http://i.stack.imgur.com/j1uR2.jpg)


Getting the list of the latests posts and custom type posts in the homepage

When I need to get a single post type list I usually use `get_posts`, how can I retrieve multiple `custom posts types` to populate the site homepage? To be more precise, I would like to get the latest mixed posts (so mixed slugs like work, photo, code) and oreder them by date. I could call `get_posts` per each custom post type and then filter them, but I was just wondering if there was a more optimized way to do it, something like:               <?php     $args = array (         'post_type' => array ('work', 'photo', 'code', 'post'),         'numberposts' => 5,         'orderby' => 'post_date',         'order' => 'DESC'     );     $posts_array = get_posts($args);     ?>      So, does exists some way to get a mixed post type list?


Remove HTML editor and visual/HTML tabs from TinyMCE

Is it possible to remove the `Visual` \ `HTML` tabs from `wp_editor` and display only the TinyMCE editor? Basically, right now, I'm using `wp_editor` to display the smallest possible TinyMCE editor I can - only one button is needed, italics. ![Current TinyMCE instnace](http://i.stack.imgur.com/LH1dD.png) What I'd like to do is make that smaller by removing the `Visual` \ `HTML` tabs. Our authors won't ever need the HTML editor and the custom buttons I'm creating will only be accessible from the visual editor. **NOTE:** For reasons found here, I can't use the `teeny` argument of `wp_editor`. Thanks in advance,


Plugin development - loading Javascript and Flash

I've been using Wordpress for a while, and I really like it \o/... I've written plugins for the Joomla platform but I'm sort of struggling getting going on the wordpress platform : Here's my plan. I'm in the process of writing a plugin that uses Flash to allow the user to record audio from the soundcard (my idea is to allow the user to record a podcast through the web site). I have a questions (so many questions...) but I'll go with these few : I am using wp-enqueue to load the Javascript libraries into the page or post as it is loaded. Currently I'm using add_action('init', 'register_libraries'); to register the javascript libraries - and I think that works - but it also shows in the administration page (where this plugin won't be used). So I had a look a the codex page and it suggests that I should be using init - it says that init is "Typically used by plugins to initialize". But that also includes the administration side, which I don't want for this plugin. Any suggestions what I should do instead? In addition, and perhaps this should be a separate question - I wanted to load flash during the loading of the plugin - how should I do that - any ideas?... I know... It's a bit noobish...


Catagorized hierarchy menu for PAGES!

Yes, I am a noob at all this so please excuse my ignorance! So, for the past couple of days, I've been searching for a drop down page menu widget, but I would like to have the pages separated into "labeled" catagories. I don't have pages that require any hierarchy, so I don't have or want a parent page to catagorize by. Basically, I want to be able to enter a label/title for the group that will show on the menu and when you click or hover on the label, the pages designated to that label will drop down. I noticed you can catagorize posts and links, but not pages. Does such a widget exist??


How can i customize the comment list

I am using **wp_list_comments()** function to draw the comment list.But,I want change many things in the form like class,styles, reply link and etc... so please help me, How can i customize the comment listing function Thanks


Cropped featured image replaces original image in gallery

_Firstly, I have done my research as thoroughly as I possibly can. Searches have been made, but I have not found any advice or solution as to my exact issue._ Ok, time to explain. Currently I am working on a gallery theme for a client (I am not the original developer of this theme, it was created by another developer in the office). The theme is rather simple, the home page displays 220x170 thumbnails of each post containing an image. Click on the image, page with full size image comes up. Simple enough. Now my trouble starts. The client would like to define which area of the image is displayed in the 220x170 thumbnail as currently WordPress just centers the image. My process to do this has been to upload the image to the gallery, insert into post and save. I will then click on **Set Featured image**. The main problems begins here. There's 2 ways I can go about this, both causing issues. If I crop the image, select **Apply Changes to: Thumbnail** , save it and then select **Use as featured image** , the featured image remains the full sized image, just resized to fit the 220x170 size. At first I thought I figured out a solution, but I'd call it more of a band- aid fix and my client would rather avoid this next way. If I crop the image, instead now using **All image sizes** , this will now set the correctly cropped image as the thumnbnail, but will obviously overwrite ... all the image sizes. So if I got back into my post (let's say I accidentally deleted the image from the post) and I wanted to insert it back in, the image now inside of the gallery is the cropped image. I'm trying to look for some guidance as to how I can fix the first issue, where the cropped thumbnail does not display in the featured image section, but rather just the full sized image. Thank you,


How to Add Author Editing Capability to Existing Post by Admin

I apologize if this is mentioned on here but I can't find any information! Anyway, I am building a WordPress site where I created the content with my administrator account. However, once the site is launched there are going to be 10-15+ Author accounts in order to manage a single custom post each. Is there any way that I can create a new account, and add author capability to a post which already exists but is not created by them? Or is there a way I can change the author on an existing post from the admin account to the newly created one?


Wordpress plugin Post Creation

Does someone know any plugin available that can allow any users to create a post and publish it without even registering?? In fact, I want to use it with wp-ecommerce wordpress plugin found here


Can't get drafts with WP_Query using post_status parameter

I can't seem to get drafts to show up with WP_Query, even when post_status is set to 'any' or 'draft'                       $args = array(                         'p' => 1234,                          'post_type' => 'any',                         'post_status' => 'any'                         );             $query = new WP_Query( $args );                  while ( $query->have_posts() ) : $query->the_post();                 // display the post             endwhile;                  wp_reset_postdata();      If I go back and Publish post 1234, WP_Query grabs it just fine. But when it is a draft, neither `any` nor `draft` grabs it. I read that the `exclude_from_search` parameter in `register_post_type()` prevents posts from showing up with WP_Query, so I set it to false in the post_type I am grabbing from, like so:               $args = array(         'labels' => $labels,         'description' => '',         'public' => true,         'publicly_queryable' => true,         'exclude_from_search' => false,         'show_ui' => true,         'menu_position' => 60,         'menu_icon' => null,         'capability_type' => post,         'hierarchical' => false,         'supports' => array('title', 'editor', 'author', 'excerpt', 'trackbacks', 'custom-fields', 'revisions'),         'rewrite' => true,         'query_var' => true,         'can_export' => true,         'show_in_nav_menus' => true,     );          register_post_type('chart', $args);      Is there something I'm overlooking here? I don't see why a draft post in this post type wouldn't show up in the query above.


Add class to every other posts using get_posts

I am currently using this little loop to display a list of posts using the "events" custom post type               <?php global $post; // required         $args = array('post_type' => 'events');         $custom_posts = get_posts($args);         foreach($custom_posts as $post) : setup_postdata($post);     ?>

Content goes here

          <?php endforeach; ?>      What I want to do is add a class to every other list item so that I can style them alternatively (One white, one black, one white, one black, for example) I've done this before with a standard loop but I'm only just converting over to get_posts so I'm a bit stuck. Any help would be great. Thanks in advance


Permalinks for custom post-types within custom taxonomies not found

I have tried to apply the advice offered by TheDeadMedic in this post to achieve the following URL structure: example.com/activities = a WP page   example.com/activities/type-term = a custom archive   example.com/activities/type-term/activity-post = a custom post All URL's work until the lowest one which returns a Wordpress "not found" error. I don't know whether I need to filter the rewrite rules to make this work. The post I linked above suggests that I have done everything needed. Any help would be greatly appreciated, thanks. Here's my code:               /*      * Register custom content objects on initiation      */     add_action('init', 'register_type'); // Type taxonomy (activities)     add_action('init', 'register_activity'); // Activity post-type     add_filter('post_type_link', 'filter_activity_link', 10, 2); // Filter permalinks for activity post-type          /*      * Register Type custom taxonomy for activities      */     function register_type() {              $labels = array(             'name'                  => ('Types'),             'singular_name'         => ('Type'),             'add_new'               => ('Add New Type'),             'add_new_item'          => ('Add New Type'),             'edit_item'             => ('Edit Type'),             'new_item'              => ('New Type'),             'view_item'             => ('View Type'),             'search_items'          => ('Search Type'),         );              $args = array(             'labels'                => $labels,             'public'                => true,             'query_var'             => true,             'rewrite'               => array( 'slug' => 'activities', 'with_front' => false ),              );         register_taxonomy( 'type', 'activity', $args );     }          /*      * Register Activity custom post-type      */     function register_activity() {              $labels = array(             'name'                  => ('Activities'),             'singular_name'         => ('Activity'),             'all_items'             => ('All Activities'),             'add_new_item'          => ('Add New Activity'),             'edit_item'             => ('Edit Activity'),             'new_item'              => ('New Activity'),             'view_item'             => ('View Activity'),             'search_items'          => ('Search Activities')         );              $args = array(             'labels'                => $labels,             'public'                => true,             'show_in_nav_menus'     => false, // Do not appear directly in navigation             'menu_position'         => 5,             'hierarchical'          => false,             'query_var'             => true,             'supports'              => array( 'title', 'editor', 'type', 'revisions', 'comments' ),             'rewrite'               => array( 'slug' => 'activities/%tax_type%', 'with_front' => false )         );              register_post_type( 'activity', $args );     }          /*      * Update Type rewrite slug with applicable terms      */     function filter_activity_link($link, $post) {         if ($post->post_type != 'activity')         return $link;          if ($cats = get_the_terms($post->ID, 'type'))         $link = str_replace('%tax_type%', array_pop($cats)->slug, $link);     return $link;     }      * * * # UPDATE OK, it turns out you will always need to add rewrite rules to finish this process. The URL's may appear correctly but the database doesn't understand them. This post helped me enormously, along with this reference information on regex. I just needed to add the code               add_rewrite_rule('^activities/([^/]*)/([^/]*)/?$' ,'index.php?activity=$matches[2]','top';      Hope this helps someone.


Customise the appearance of 4 specific post ID's within the loop?

I am using Isotope and I currently have each post rendering as a box on my homepage. I am currently trying to edit my (working) query that currently displays all posts with the category slug of 'static'. Within that query i'd like to target 4 specific post ID's and customise the appearance of each of those 4 posts. So each of those 4 posts will have different content to one another. How can I adjust this working loop so that I can add/remove content for 4 different post ID's? Just to note as well, in my template file, I have another query below this query that displays posts from 6 other categories. The code is the same but I've just changed a link position. I hope that all makes sense!               <?php                 // Query just the category static and make the link manually editable through the 'URL' custom field                 $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;                 $args= array(                     'category_name' => 'static',                     'paged' => $paged                 );                 query_posts($args);                 if( have_posts() ) :?>                      <?php while (have_posts()) : the_post(); ?>                        <?php foreach( get_the_category() as $cat ) echo '
slug . '" data-category="' . $cat->slug . '" >'; ?>                            <a href="<?php echo get_post_meta($post->ID, 'URL', true); ?>" title="<?php the_title(); ?>">

                             <?php the_post_thumbnail(); ?>

<?php the_title(); ?> / Explode here
                       <?php                       // Call in the contents of a custom field called Excerpt and if custom field in admin panel is empty don't display
 tags otherwise wrap contents in
 tags                       $excerpt=get_post_meta($post->ID,'Excerpt',true);                       if($excerpt != '') {                       echo '
'. $excerpt .'
';                       } else {                       echo ' ';                       }                       ?>
<?php the_time('Ydm') ?>

                      <?php endwhile; ?>                  <?php endif; ?>


3 blogs on one site with the same header menu?

Person X has default SITE with an integral blog. Person X also has SITE 2 with Blog 2 and also SITE 3 with Blog 3. Is it possible to have on the DEFAULT SITE HEADER MENU something like this:               HOME BLOG1 BLOG2 BLOG3 CONTACTUS      BLOG1 is a integral blog of that DEFAULT SITE. Blog 2 tab would link to the blog 2 of the site 2. Blog 3 tab would link to the site 3 with blog 3. The point is when user clicks at the BLOG2 and BLOG3 tabs to get content from these blogs, the HEADERMENU of default site always stays on the top and it is always the same. Is that possible? (categories of a single blog as a solution excluded). Possible solution is to mimic BLOG 2 and BLOG 3 with exactly the same header (with linked tabs) that could give a simulation of the same page all the way, but that would be cheating and it is hard to update all these blogs-sites like that (especially if new tab appears in the future). Is there any other more logical-better solution?


is there a plugin that allow editing pages from within pages without entering admin panel?

Is there a plugin that allows editing pages/posts without going to admin panel? I've a specific need to disallow access for users to admin panel of wordpress/multisite users. But I want them to be able to change contents of pre-structured pages. is this possible? anyone already thought of this before me??


Remove Featured Image from posts in specific category?

I am building a theme that includes the featured image as a navigation feature outside the single post, but once the user gets to the post in category "Specials", I'd like to take that image away. None of the other category posts require this lack of Featured Images. Theirs can be intact. I can do it with JavaScript easily enough, targeting the div, but I'd like to do it server-side. How can I isolate and remove a featured image from a specific category's posts?


Delete old post with new post

Hope you can point me in the right direction, with a plugin or function. With "Contact Form 7" logged in users post their info with "Form to Post" plugin. Everything is front end. It is a big form that uses custom fields to display posts. I need a way to automatically delete posts, so every time a new post by user is created the last one is deleted in that category. I found a way I can do it by date, by that will not work. Thanks.


Adding attributes to <a> link in wp_nav_menu using custom Walker function

I am trying to generate a menu using wp_nav_menu. My expected output is this:

                             Dashboard

Dashboard #2

Dashboard #1

Photo Gallery

                             Site Pages

View pages

Add page

                             eCommerce

Catalog

Categories

Products

Add product

Orders

                             Members

Clients

Edit account

                             Other

Charts

                             Documentation

Overview

Features

Getting Started

Customization Guide

Powered by

Credits

           So far I am able to use a custom walker function to wp_nav_menu and achieved to generate almost all the html as above but I am unable to insert **class="dropdown-toggle" data-toggle="dropdown"** inside the tag. This will allow me to toggle the dropdown I guess (currently I am able to generate only the top menu. The submenu's appear in html but they are not visible in browser.). Here is my effort so far:

                                                                                <?php class My_Walker_Nav_Menu extends Walker_Nav_Menu {     function start_lvl(&$output, $depth) {     $indent = str_repeat("\t", $depth);     $output .= "\n$indent
\n";     }     }     $defaults = array(     'theme_location'  => '',     'menu'            => '',     'container'       => 'div',     'container_class' => 'nav-collapse collapse',     'container_id'    => '',     'menu_class'      => 'nav',     'menu_id'         => '',     'echo'            => true,     'fallback_cb'     => 'wp_page_menu',     'before'          => '',     'after'           => '',     'link_before'     => '',     'link_after'      => '',     'items_wrap'      => '

%3$s
',     'depth'           => 0,     'walker'          => new My_Walker_Nav_Menu          );               wp_nav_menu( $defaults );                ?>

           Can somebody help me to modify my custom walker function so as to get the desired html output given above. Thanks in advance.


Can I run a second wordpress site as a subdomain without using multisite?

I have an two wordpress sites that I would like to host on the same domain. One is already up and running, the other is sitting in waiting. Can I get the second as a subdomain, or simple within a folder, to run on the same domain (different DB) without converting to multisite?


Where have the Privacy Settings gone in WordPress 3.5?

I moved a WordPress site to another server and everything is working well, minus the fact that I can't seem to change the settings in Privacy. When I click on "allow search engines to index this site", the radio button automatically switches back to "ask search engines not to index this site". Also, the Privacy Settings menu itself is gone from the Settings menu. I have to manually type in `/wp-admin/options-privacy.php` to access the page. Can anyone tell me what is going on?


How to show a custom notification to a specific user?

I am new here, I found this spot interesting and very special. I've already found useful information through your discussions. My first question is about user management. As Admin, I would need to display some text or notification on the dashboard of a specific user. For a "specific" user name, for example.


Does an activated plugin automatically mean its methods are available to other WP functions?

I made a WordPress plugin like this:               Class MY_CLASS {     //codes     }     Global $myclass;     $myclass = New MY_CLASS ();      After installed and activated the plugin, can I use this class in other plugins without including the myclass.php file? For example, in another plugin:               Global $myclass;     $myclass->a = 'dog';


Problem running Ajax in Wordpress

**FIXED** I changed this:               wp_enqueue_script( 'pfxconversion', plugin_dir_url( __FILE__ ) . 'function.js', array( 'jquery' ) );         wp_localize_script( 'pfxconversion', 'MyAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );              add_action( 'wp_ajax_nopriv_pfxconversion', 'pfxconversion_callback' );         add_action( 'wp_ajax_pfxconversion', 'pfxconversion_callback' );      to this:               add_action ('wp_print_scripts', 'widget_logic_js_fx', 1);          function widget_logic_js_fx() {         wp_enqueue_script( 'purefx-currency-converter', plugin_dir_url( __FILE__ ) . 'function.js', array( 'jquery' ) );         wp_localize_script( 'purefx-currency-converter', 'MyAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );     }          add_action( 'wp_ajax_nopriv_pfxconversion', 'pfxconversion' );     add_action( 'wp_ajax_pfxconversion', 'pfxconversion' );      wp_print_scripts is what we we're missing :-)


one category template for multiple categories

i have category-events.php to list my posts tagged 'events' but it wont work for 'events' child categories. ie i have some posts tagged 'events' and one of events' children 'exhibition'. I thought it would use category-events.php automatically but it doesn't. Is this possible as i want to user category-events.php for several of 'events' child categories. hope that makes sense and any pointers welcome. dan.


How to query WordPress from another application?

We're building an iOS app for BarbadosPropertyList.com. The iOS app needs to query the website and download recent listings data, including titles, datestamps, thumbnails and custom fields. We would like to know the best practice for querying WordPress data from an external app?


404 redirection and Google's index

I have several dead pages, which are annoyingly still indexed in Google. I've set my 404.php to redirect to my homepage using wp_redirect, however I'm worried that this will prevent Google from unindexing those dead pages? I've tried setting the status code in the redirect to 404, but this results in no redirection.


Display Custom Field in Sidebar if Value is Present

I'm trying to use 'if' 'else' to display a link button if I have a value in the 'TourURL' custom field, and if not, nothing will display but can't seem to get the if code to work:               <?php if(global $wp_query;         $postid = $wp_query->post->ID;         echo get_post_meta($postid, 'TourURL', true);         wp_reset_query();     ): ?>
Show Link
          <?php else : ?>
No Link
          <?php endif; ?>      Thanks!


Upload image from other server without resize?

For image upload in my plugin i am using `media_handle_sideload` function. Is it possible to disable image resizing on this function?


Getting the Current User

I am trying to use information about the current user in a plugin that I am designing and I have seen people go about it in several different ways. ## My Way This way seems to work, but am I missing something?               global $current_user;          // Use information     echo "User ID: " . $current_user->user_id;     echo "User First Name: " . $current_user->first_name;      I have seen some people call the function **get_currentuserinfo()** on the next line after declaring the global variable $current_user. However, this seems to work without that call - so is it necessary? Also, there is the function **wp_get_current_user()** - what is the difference between this and **get_currentuserinfo()**? I have also seen people use a global variable called **$profileuser** and use **get_user_to_edit()** in order to set it to the user object. Is there some benefit to this? I have also seen people refer directly to the **$user_ID** global variable in addition to using the **$current_user**. Why wouldn't they just use **$current_user->ID**? Thanks, William


Some widgets on Multisite not showing up in template for particular theme

I have a load of custom widgets that all look pretty much the same. I have a multisite blog with 3 blogs. The widgets are configured individually to show up on all 3 blogs with their own settings in Appearance -> Widgets. All widgets show normally on the first, main blog. On the other blogs, **some** of the widgets don't appear. I've given a sample of two widgets below - `gem_countryFilter_Widget()` shows up everywhere like it should, but `gem_joinConversation_Widget()` only appears on the main blog, even though it's configured on all of them and is part of the same sidebar as the other widget that _does_ work. I can't see any difference between the two, so I'm baffled as to what the problem is. The widgets are also used in a previous custom theme, and have not been modified. In the previous theme, the widgets appeared on all blogs as expected. I've tried copying the functions.php file (where the widgets are declared) from the old theme directly into the new one and it's had no effect - some of the widgets just disappear on the non-main blogs. It seems logical that the theme is the problem, but I'm drawing a blank over where to look to diagnose it. Has anybody encountered a similar problem before? **sample code:**               /**join conversation**/     class gem_joinConversation_Widget extends WP_Widget {         function gem_joinConversation_Widget() {             parent::WP_Widget(false, 'Join the Conversation');         }     function form($instance) {             // outputs the options form on admin             echo '
Displays the social and sharing icons in the sidebar. There are no options for this widget.
';         }     function update($new_instance, $old_instance) {             // processes widget options to be saved             return $new_instance;         }     function widget($args, $instance) {             // outputs the content of the widget             gem_joinConversation();         }     }     register_widget('gem_joinConversation_Widget');     function gem_joinConversation($args = array()){         ?>

Join the conversation

                    <?php     }          /**Country filter**/     class gem_countryFilter_Widget extends WP_Widget {         function gem_countryFilter_Widget() {             parent::WP_Widget(false, 'Country filter');         }     function form($instance) {             // outputs the options form on admin             echo '
Displays a dropdown list of blogs. There are no options for this widget.
';         }     function update($new_instance, $old_instance) {             // processes widget options to be saved             return $new_instance;         }     function widget($args, $instance) {             // outputs the content of the widget             gem_countryFilter();         }     }     register_widget('gem_countryFilter_Widget');     function gem_countryFilter($args = array()){         ?>

Filter by country

Brazil

China

France

                <?php     }


Query posts based on parents attribute

This is the scenario: I have multiple pages that all have a custom field named "Location" Those pages all have child-pages with the custom field of "size_m2". What I want is to do a normal meta_query to list all pages with let say "size_m2 >= 55", but only if the parent page have "Location == Stockholm". Do i need to use a custom SQL query for this? Or can I query for the parent_pages children, and when filter and "query" that query?


Apply function on all action hooks?

Is there an easy way to apply a function on all action hooks? > I want to apply `esc_attr()` to every action hook (in a way that would work > from functions.php or a plugin). I figure I would need to filter `do_action` and `do_action_ref_array` except that those functions don't use `apply_filters`. Is there any way to do this?


IE7 compatible twentyeleven

I installed a site with the stock twentyeleven theme but it looks terrible in IE6 and has many small problems in IE7. I am ready to give up on IE6 but not on IE7 yet but wouldn't like to rewrite a whole theme from scratch just to fix IE7. Is there a port of twentyeleven that supports these 2 browsers.


Adding featured image to posts created by a plugin

The below code is part of Keyring Social Importer, and it imports my Tweets from Twitter and posts them as individual blog posts on my Wordpress.org install. I was wondering how I could make it set the featured image of all of the blog posts it creates to something. Currently it just imports my Tweets as publishes them as blog posts... no images whatsoever, but my theme relies heavily on featured images and thumbnails so if I could set one in this code it would be really handy. So something like, the_post_thumbnail=imgID for all posts. Let me know your thoughts. Many thanks, HT               <?php          function Keyring_Twitter_Importer() {          class Keyring_Twitter_Importer extends Keyring_Importer_Base {         const SLUG              = 'twitter';    // e.g. 'twitter' (should match a service in Keyring)         const LABEL             = 'Twitter';    // e.g. 'Twitter'         const KEYRING_SERVICE   = 'Keyring_Service_Twitter';    // Full class name of the Keyring_Service this importer requires         const REQUESTS_PER_LOAD = 3;     // How many remote requests should be made before reloading the page?              var $auto_import = false;              function __construct() {             parent::__construct();             add_action( 'keyring_importer_twitter_custom_options', array( $this, 'custom_options' ) );         }              function custom_options() {             ?>
                                      <?php _e( 'Import retweets', 'keyring' ); ?>                 	                                      <input type="checkbox" value="1" name="include_rts" id="include_rts"<?php echo checked( $this->get_option( 'include_rts', true ) ); ?> />

                                      <?php _e( 'Import @replies', 'keyring' ); ?>                 	                                      <input type="checkbox" value="1" name="include_replies" id="include_replies"<?php echo checked( $this->get_option( 'include_replies', true ) ); ?> />
<?php         }              function handle_request_options() {             // Validate options and store them so they can be used in auto-imports             if ( empty( $_POST['category'] ) || !ctype_digit( $_POST['category'] ) )                 $this->error( __( "Make sure you select a valid category to import your checkins into." ) );                  if ( empty( $_POST['author'] ) || !ctype_digit( $_POST['author'] ) )                 $this->error( __( "You must select an author to assign to all checkins." ) );                  if ( isset( $_POST['auto_import'] ) )                 $_POST['auto_import'] = true;             else                 $_POST['auto_import'] = false;                  if ( isset( $_POST['include_rts'] ) )                 $_POST['include_rts'] = true;             else                 $_POST['include_rts'] = false;                  if ( isset( $_POST['include_replies'] ) )                 $_POST['include_replies'] = true;             else                 $_POST['include_replies'] = false;                  // If there were errors, output them, otherwise store options and start importing             if ( count( $this->errors ) ) {                 $this->step = 'greet';             } else {                 $this->set_option( array(                     'category'        => (int) $_POST['category'],                     'tags'            => explode( ',', $_POST['tags'] ),                     'author'          => (int) $_POST['author'],                     'include_replies' => (bool) $_POST['include_replies'],                     'include_rts'     => (bool) $_POST['include_rts'],                     'auto_import'     => (bool) $_POST['auto_import'],                     'user_id'         => $this->service->get_token()->get_meta( 'user_id' ),                 ) );                      $this->step = 'import';             }         }              function build_request_url() {             // Base request URL             $url = "http://api.twitter.com/1/statuses/user_timeline.json?";             $params = array(                 'user_id' => $this->get_option( 'user_id' ),                 'trim_user' => 'true',                 'count' => 75, // More than this and Twitter seems to get flaky                 'include_entities' => 'true',             );             if ( false == $this->get_option( 'include_replies' ) )                 $params['exclude_replies'] = 'true';             if ( true == $this->get_option( 'include_rts' ) )                 $params['include_rts'] = 'true';             $url = $url . http_build_query( $params );                       if ( $this->auto_import ) {                 // Locate our most recently imported Tweet, and get ones since then                 $latest = get_posts( array(                     'numberposts' => 1,                     'orderby' => 'date',                     'order' => 'DESC',                     'meta_key'    => 'keyring_service', // In case there are other asides                     'meta_value'  => 'twitter',                     'tax_query' => array( array(                         'taxonomy' => 'post_format',                         'field' => 'slug',                         'terms' => array( 'post-format-standard' ), // Tweets stored as asides                         'operator' => 'IN',                     ) ),                 ) );                      // If we have already imported some, then start since the most recent                 if ( $latest ) {                     $max = get_post_meta( $latest[0]->ID, 'twitter_id', true );                     $url = add_query_arg( 'since_id', $max, $url );                 }             } else {                 // Handle page offsets (only for non-auto-import requests)                 $url = add_query_arg( 'page', $this->get_option( 'page', 0 ), $url );             }                  return $url;         }              function extract_posts_from_data( $raw ) {             global $wpdb;                  $importdata = $raw;                  if ( null === $importdata ) {                 $this->finished = true;                 return new Keyring_Error( 'keyring-twitter-importer-failed-download', __( 'Failed to download your tweets from Twitter. Please wait a few minutes and try again.', 'keyring' ) );             }                  // Check for API overage/errors             if ( !empty( $importdata->error ) ) {                 $this->finished = true;                 return new Keyring_Error( 'keyring-twitter-importer-throttled', __( 'You have made too many requests to Twitter and have been temporarily blocked. Please try again in 1 hour (duplicate tweets will be skipped).', 'keyring' ) );             }                  // Make sure we have some tweets to parse             if ( !is_array( $importdata ) || !count( $importdata ) ) {                 $this->finished = true;                 return;             }                  // Get the total number of tweets we're importing             if ( !empty( $importdata[0]->user->statuses_count ) )                 $this->set_option( 'total', $importdata[0]->user->statuses_count );                  // Parse/convert everything to WP post structs             foreach ( $importdata as $post ) {                 // Double-check for @replies, which shouldn't be included at all if we chose to skip them                 if ( true == $this->get_option( 'exclude_replies' ) && null != $post->in_reply_to_screen_name )                     continue;                      // Post title can be empty for Asides, but it makes them easier to manage if they have *something*                 $title_words = explode( ' ', strip_tags( $post->text ) );                 $post_title  = implode( ' ', array_slice( $title_words, 0, 15 ) );     // Use the first 15 words                 if ( count( $title_words ) > 15 )                     $post_title .= '…';                            // Parse/adjust dates                 $post_date_gmt = strtotime( $post->created_at );                 $post_date_gmt = gmdate( 'Y-m-d H:i:s', $post_date_gmt );                 $post_date     = get_date_from_gmt( $post_date_gmt );                      // Apply selected category                 $post_category = array( $this->get_option( 'category' ) );                      // Clean up content a bit                 $post_content = $post->text;                 $post_content = $wpdb->escape( html_entity_decode( trim( $post_content ) ) );                      // Handle entities supplied by Twitter                 if ( count( $post->entities->urls ) ) {                     foreach ( $post->entities->urls as $url ) {                         $post_content = str_replace( $url->url, $url->expanded_url, $post_content );                     }                 }                      // Any hashtags used in a tweet will be applied to the Post as tags in WP                 $tags = $this->get_option( 'tags' );                 if ( preg_match_all( '/(^|[(\[\s])#(\w+)/', $post_content, $tag ) )                     $tags = array_merge( $tags, $tag[2] );                      // Add HTML links to URLs, usernames and hashtags                 $post_content = make_clickable( esc_html( $post_content ) );                      // Include geo Data (if provided by Twitter)                 if ( !empty( $post->geo ) && 'point' == strtolower( $post->geo->type ) )                     $geo = array(                         'lat' => $post->geo->coordinates[0],                         'long' => $post->geo->coordinates[1]                     );                 else                     $geo = array();                      // Get a GUID from Twitter, plus other important IDs to store in postmeta later                 $user = $this->service->get_token()->get_meta( 'username' );                 $twitter_id              = $post->id_str;                 $twitter_permalink       = "https://twitter.com/{$user}/status/{$twitter_id}";                 $in_reply_to_user_id     = $post->in_reply_to_user_id;                 $in_reply_to_screen_name = $post->in_reply_to_screen_name;                 $in_reply_to_status_id   = $post->in_reply_to_status_id;                 $post_author             = $this->get_option( 'author' );                 $post_status             = 'publish';                 $twitter_raw             = $post;                      // Build the post array, and hang onto it along with the others                 $this->posts[] = compact(                     'post_author',                     'post_date',                     'post_date_gmt',                     'post_content',                     'post_title',                     'post_status',                     'post_category',                     'tags',                     'twitter_id',                     'twitter_permalink',                     'geo',                     'in_reply_to_user_id',                     'in_reply_to_screen_name',                     'in_reply_to_status_id',                     'twitter_raw'                 );             }         }              function insert_posts() {             global $wpdb;             $imported = 0;             $skipped  = 0;             foreach ( $this->posts as $post ) {                 extract( $post );                 if (                     $wpdb->get_var( $wpdb->prepare( "SELECT meta_id FROM {$wpdb->postmeta} WHERE meta_key = 'twitter_id' AND meta_value = %s", $twitter_id ) )                 ||                     $post_id = post_exists( $post_title, $post_content, $post_date )                 ) {                     // Looks like a duplicate                     $skipped++;                 } else {                     $post_id = wp_insert_post( $post );                          if ( is_wp_error( $post_id ) )                         return $post_id;                          if ( !$post_id )                         continue;                               // Track which Keyring service was used                     add_post_meta( $post_id, 'keyring_service', $this->service->get_name() );                          // Store the twitter id, reply ids etc                     add_post_meta( $post_id, 'twitter_id', $twitter_id );                     add_post_meta( $post_id, 'twitter_permalink', $twitter_permalink );                     if ( !empty( $in_reply_to_user_id ) )                         add_post_meta( $post_id, 'twitter_in_reply_to_user_id', $in_reply_to_user_id );                     if ( !empty( $in_reply_to_screen_name ) )                         add_post_meta( $post_id, 'twitter_in_reply_to_screen_name', $in_reply_to_screen_name );                     if ( !empty( $in_reply_to_status_id ) )                         add_post_meta( $post_id, 'twitter_in_reply_to_status_id', $in_reply_to_status_id );                          // Update Category and Tags                     wp_set_post_categories( $post_id, $post_category );                     if ( count( $tags ) )                         wp_set_post_terms( $post_id, implode( ',', $tags ) );                          // Store geodata if it's available                     if ( !empty( $geo ) ) {                         add_post_meta( $post_id, 'geo_latitude', $geo['lat'] );                         add_post_meta( $post_id, 'geo_longitude', $geo['long'] );                         add_post_meta( $post_id, 'geo_public', 1 );                     }                          add_post_meta( $post_id, 'raw_import_data', json_encode( $twitter_raw ) );                          $imported++;                 }             }             $this->posts = array();                  // Return, so that the handler can output info (or update DB, or whatever)             return array( 'imported' => $imported, 'skipped' => $skipped );         }     }          } // end function Keyring_Twitter_Importer               add_action( 'init', function() {         Keyring_Twitter_Importer(); // Load the class code from above         keyring_register_importer(             'twitter',             'Keyring_Twitter_Importer',             plugin_basename( __FILE__ ),             __( 'Import all of your tweets from Twitter as Posts (marked as "asides") in WordPress.', 'keyring' )         );     } );


Alternative to esc_textarea

I need an alternative function to use with textareas in meta boxes instead of esc_textarea. The problem is that when I use this function with textarea's it removes line breaks and paragraphs. Is there an alternative function that will keep the line breaks and paragraphs. I have tried the validation reference page in the Codex but had no luck finding a function.


How to do a custom bookmarks post type?

## Let me first explain what I am wanting to do... I am wanting to add all my hundreds of website bookmarks that I have now in my browser, into wordpress for the following reasons.   * Can search my bookmarks by tags   * Can search my bookmarks by description and/or name   * Can access my bookmarks from anywhere   * Can add a description to all my bookmarks   * Can add a screenshot image of website (optional)   * Will have a custom template for viewing the bookmarks which will look different from a regular blog post/list ## And what I have done so far...   * Created a new post type **"Website Bookmarks"** with the code below functions.php               <?php     /*     *  Add custom post type     *  name: website_bookmarks     */          function bookmark_post_type()     {         // Set some labels for our bookmarks post type         $bookmark_labels = array(             'name' => _x('Website Bookmark', 'post type general name'),             'singular_name' => _x('Websiteite Bookmark', 'post type singular name'),             'add_new' => _x('Add New', 'Websiteite Bookmark'),             'add_new_item' => __('Add New Website Bookmark'),             'edit_item' => __('Edit Website Bookmark'),             'new_item' => __('New Website Bookmark'),             'all_items' => __('All Website Bookmarks'),             'view_item' => __('View Website Bookmark'),             'search_items' => __('Search Website Bookmarks'),'not_found' => __('No website Bookmarks found'),             'not_found_in_trash' => __('No Website Bookmarks found in Trash'),             'parent_item_colon' => '',             'menu_name' => 'Website Bookmarks'             );              $bookmark_args = array(             'labels' => $bookmark_labels,             'public' => true,             'publicly_queryable' => true,             'show_ui' => true,             'show_in_menu' => true,             'query_var' => true,             'rewrite' => array(                 'slug' => 'bookmark',                 'with_front' => false),             'taxonomies' => array('post_tag', 'category'),             'capability_type' => 'post',             'has_archive' => true,             'hierarchical' => false,             'menu_position' => null,             'can_export' => true,             'supports' => array(                 'post-thumbnails',                 'thumbnail',                 'excerpt',                 'custom-fields',                 'editor',                 'title'             )         );              register_post_type('website_bookmarks', $bookmark_args);     }          add_action('init', 'bookmark_post_type');      * * * ## And then what I need help/ideas with... I basically need the following...   * Website Title   * Website URL   * Website Description   * Bookmark Tags (can be more then 1) This will be done with a custom taxonomy   * Screenshot image (can be optional) So... I can use the built in **post title** for the **website title** , Website URL ? Should I use custom fields for this? Website description ? Again custom fields or something else like the content input box? Bookmark tags, done with custon taxonomy Screenshot image ? should I just use the post thumbnail for this? Please help, this will be my first time using wordpress do do any kind of custom stuff.


Pagination is not working wp_query custom fields values

All I want those post having post_type == profile And wpcf-gender == 1 (male). I tried this code                           $wp_query = new WP_Query( array( 'meta_key' => 'wpcf-gender', 'meta_value' => '1', 'meta_compare' => '==', 'post_type' => 'profile','posts_per_page' => 2 ) );      Results which I am getting is perfect but pagination is not working. Can you please help me to find what is the issue in below code ?               <?php                               $temp = $wp_query;                     $wp_query = null;                          $wp_query = new WP_Query( array( 'meta_key' => 'wpcf-gender', 'meta_value' => '1', 'meta_compare' => '==', 'post_type' => 'profile','posts_per_page' => 2 ) );                     ?>                     <?php while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?>                          <div class="post" id="post-<?php the_ID(); ?>">
<a href="<?php the_permalink();?>"><?php the_title(); ?>

                                                          <?php                                       if(has_post_thumbnail()) {                                     the_post_thumbnail();                                 } else {                                      echo '';                                 }                             ?>

                                     First Name: <?php echo do_shortcode('[types field="first-name" class="" style=""]'); ?>	                                     Last Name: <?php echo do_shortcode('[types field="last-name" class="" style=""]'); ?>

                                     Gender: <?php echo do_shortcode('[types field="gender"][/types]'); ?>	                                     DOB: <?php echo do_shortcode('[types field="dob" style="text" format="F j, Y"][/types]'); ?>

                                     City: <?php echo do_shortcode('[types field="city"]'); ?>	                                     State: <?php echo do_shortcode('[types field="state"]'); ?>

                             <?php the_excerpt(); ?>                              <input type="button" value="Read more..." id="searchsubmit" class="readmore" onClick="javascript:location.href = '<?php the_permalink();?>';" >

                          <?php endwhile; ?>                     <?php                       global $wp_query;                      $big = 999999999; // need an unlikely integer                      echo paginate_links( array(                     'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),                     'format' => '?paged=%#%',                     'current' => max( 1, get_query_var('paged') ),                     'total' => $wp_query->max_num_pages                 ));?>


how to download all media files into my computer

How do I "download" all my photos from my media library to my local computer? I can do this one at a time, but is there a way to grab them all at one time? Sort of like a "download all" process.


Multiple level category drop-down

I'm using WordPress as a CMS and would like to have categories selectable from multiple selections i.e `<option>`. ![enter image description here](http://i.stack.imgur.com/b97Wg.jpg)![enter image description here](http://i.stack.imgur.com/KrA6n.png) As a usage example, The first dropdown would contain parent categories. Then after selecting the parent a second select drop-down would appear with the child categories. There are a few plugins available on Wordpress.org but they all seem to be broken or out of date. Any help would be appreciated. Broken plugin http://wordpress.org/extend/plugins/ajax-category-dropdown/ The code I'm using from wordpress.org               <form action="<?php bloginfo('url'); ?>/" method="get">         <?php         $select = wp_dropdown_categories('orderby=name&echo=0&depth=0&hierarchical=1&exclude=5,4');         $select = preg_replace("#<select([^>]*)>#", "<select$1 onchange='return this.form.submit()'>", $select);         echo $select;         ?>         <noscript><input type="submit" value="View" /></noscript>     </form>


Displaying a checkbox array from advanced custom field

I'm using the advanced custom field plugin for wordpress and wondering if I'm able to do the following: If checkbox ticked = web and it equals the page title echo this. Does anyone know what code to use for this? UPDATE: The closest I've got is this:               <?php $fields = get_acf(); print_r ($fields->categories); ?>       But that is printing out this:               Array ( [0] => option_1 [1] => option_2 [2] => option_9 )      1. How can I print out the real names (without it saying array)? 2 Also say if it = web and matches the page title then echo something?


Trimming a custom field to a length

I have a custom field added through the Advanced Custom Fields Plugin. I am trying to trim the content of the field down to a set number of words. I have tried to use the excerpt filter and setting a custom length see code bellow but It's not working, thought?               // set the length of the excerpt     function custom_excerpt_length( $length )          {         return 20;         }          add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );          // apply the filter and strip crap from 'description'     // http://codex.wordpress.org/Function_Reference/the_content     $content = apply_filters('the_excerpt', get_field('description'));     $content = str_replace(']]>', ']]>', $content);          echo $content;          //echo wp_trim_excerpt($content);      I also tried the wp_trim_except() function but it isn't doing anything either. The whole length of the text is being echoed.


how can i use custom field in query post

I want to get all featured items using query post. featured is meta_key using custom field plugin. I tried bellow,but it failed               $featured_item = new WP_Query('posts_per_page=-1&cat=3&meta_key=>Featured List&meta_value=>Yes');      my wp version is 3.1.3 **EDIT:**               $arg2 = array(         'posts_per_page'=>'5',         'cat'=>'3',         'orderby'=>'rand',         'meta_query'=> array(             'key'=>'Featured List',             'value'=>'Yes',             'compare'=>'LIKE'         )     );          $featured_random_item = new WP_Query($arg2);      This query also failed. How can i do this Thanks in advance !


link posts to custom post type

I have a custom post type 'books' which I store different custom fields of information about books. I want to use posts and link the posts I write (in categories such as news, or offers) to the books. For example, when the user is viewing the book information page, I want to be able to display all the posts in news category related to that book. I was able to do this using a custom field and assigning the book id to the news. But what if I have a news that's related to a lot of books? Is there any way to file all the Custom Post titles to a taxonomy? What's the best way to do this?


Showing current taxonomy terms

I've created a custom post type called "References" and a custom taxonomy "Genre". I have 2 terms : Applications and Games. My problem is that I'd like to show posts associated in Applications on a page (and the same for the games). I believe WordPress do this like doing the same for tags.... In fact, I just need to make a query and getting the current term of the page. Here is what I tried but I get the same list for each terms page (Applications and Games) :               <?php get_header(); ?>

<?php single_cat_title(); ?>

         <?php              $loop = new WP_Query( array( 'post_type' => 'references' , 'genre' => '') ); ?>         <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>                  <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php the_title(); ?>

<?php the_content(); ?>

                  <?php the_post_thumbnail();?>              <?php endwhile; // end of the loop. ?>

          <?php get_footer(); ?>      Hope someone can help me. I've Googled for a week now...


WP_Query based on a custom field result

I would like to know if there's a way to do a query filtered by a custom field result. In this case, I have 6 posts I would like to retrieve, but only if they have "true" selected in a custom field I've previously created. The name of the custom field is called "featured". Here's my code               <?php     $recentPosts = new WP_Query();     $recentPosts->query('showposts=6');     ?>     <?php while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?>
             <?php if ( has_post_thumbnail() ) {?>
                 <a href="<?php the_permalink() ?>"><?php the_post_thumbnail( 'post-thumb-140' ); ?>
              <?php } ?>                  <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?>
     <?php endwhile; ?>      I've checked WordPress documentation on possible WP_Query arguments, but there are no filters based on a custom field. Any ideas?


Elements floating on top of each other when Resizing or checking site on mobile. Twenty Twelve

I'm using WP Twenty Twelve theme for my blog: Glory and Honor and have followed the Replace #site-title with resizable image in Twenty Twelve Post to fix my logo not displaying when visiting via my mobile. (This is my first isssue) I've been struggling with having my blog layout and site-logo display properly on my iPhone and iPad. The @media CSS (from the posting I have been following) disappears my site-logo altogether. Also, I have been working on the CSS for the actual site-logo but noticed that when I remove the margins from the site-logo CSS, the logo does display on my mobile and the layout looks fine. The problem is, I do need the margins because the logo displays exactly how I want it to - centered in the header - for the desktop version. Another issue is the sign up form, search form, and shop image-button/ link I have added. They float all over the place on the desktop site (when resizing the browser) and when visiting the site via my mobile. I absolutely would like to keep the site responsive.


How do I insert a custom field in a user submitted post?

Please help! I have a form for users to submit posts, and I want them to be able to choose photos already in the media gallery based on category selected. I want to include radio buttons to choose between a few images that will attach to the post, become the featured image, or just echo out in a template file in this manner                   <?php $custommeta = get_post_meta($post->ID, "CategoryImage", true); ?>       The value of the selected image will be the image url to echo out into the custom field. I can not figure out the code to get the custom field in the form and get the value into the custom field. I think I should use add_post_meta but I am not completely sure how to incorporate it. Any help would be greatly appreciated. I am using the plugin User Submitted Posts but I would take a general answer as well.


How can i count the post added in relationship field, theme display

How can i count the post added in relationship field. The relationship field is a plugin (http://www.advancedcustomfields.com/docs/field- types/relationship/) In my admin i have a MetaBox i create to link the post from another post type to my posts. please see picture below in the link http://i.imgur.com/PFFY8.jpg Subtitle and Trailers How can i get the number of post attach to the relationship field. Ex: If the relationship field has 4 articles added in site in tabs i want to be able to get the number of articles Ex: Trailers(1) - that are display in Front-end. Something like this ( cinemagia.ro/filme/avatar-2-578279/ ) To retrive the post and display into my theme i use               <?php if(get_field('trailere_filme') != ""){foreach(get_field('trailere_filme') as $post_object): ?>

     <a href="<?php echo get_permalink($post_object->ID); ?>" rel="bookmark" title="<?php printf(__('Trailer film %s', 'kubrick'), the_title_attribute('echo=0')); ?>">     <?php echo get_field( 'tip', $post_object->ID ); ?>          <img src="http://img.youtube.com/vi/<?php echo get_field( 'trailer', $post_object->ID ); ?>/<?php echo get_field( 'img_trailer', $post_object->ID ); ?>" alt="Trailer <?php echo get_the_title($post_object->ID) ?>" title="Trailer <?php echo get_the_title($post_object->ID) ?>">     <?php echo get_field( 'time', $post_object->ID ); ?>
     <a href="<?php echo get_permalink($post_object->ID); ?>" title="Trailer <?php echo get_the_title($post_object->ID) ?>"><?php echo get_the_title($post_object->ID) ?>
        <?php endforeach;}else{?>
Acest film nu are trailer.
     <?php } ?>      And for tags related to post in my hteme i use:               <?php     $orig_post = $post;             global $post;             $tags = wp_get_post_tags($post->ID);                  if ($tags) {                 $tag_ids = array();                 foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;                 $args=array(                     'tag__in' => $tag_ids,                     'post__not_in' => array($post->ID),                     'post_type'=> 'stiri',                     'posts_per_page'=>1, // Number of related videos that will be shown.                     'caller_get_posts'=>1                      );}     $recentPosts = new WP_Query($args);     ?>     <?php while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?>
<a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?>

     <img src="/scripts/timthumb.php?src=<?php the_field('imagine_stire'); ?>&h=60&w=90&zc=1" alt="" title="<?php the_title(); ?>" />     <?php $excerpt = get_the_excerpt();echo string_limit_words($excerpt,30);?><a class="detalii" href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'kubrick'), the_title_attribute('echo=0')); ?>">...detalii

     <?php endwhile; ?>      Thanks


Exclude Taxonomy Terms from Template Via Back End?

I'm wondering if you can help me work through an issue or provide alt ideas. I have an archive displaying a list of custom tax terms in a grid view. My client needs to be able to turn on/off the terms from displaying in the grid. If these were posts this would be easy because I could simply have him check/uncheck a category for the post. However, taxonomies don't have that feature out of the box. Does anyone know how I might accomplish this?


How to print (or echo) name of parent category of a product?

I have parent categories for New and Used with sub-categories for the product type. How do I display only the parent category for the product. I would like a meta section "Condition: X" where X is the parent category name.


How and when to include shortcode source files

I am Writing a plugin, with many shortcodes. Now I do not want to include all shortcodes source files to every page. So my questions are:   1. Where should I include the source? Is it back-end or front-end   2. How to add it on that specific page? thanks HoGo


One page - Multiple parents?

I'd like to have the same pages assigned to two different parent pages, to save me making separate pages for two sections that contain mostly the same info. I'm using the WenderHost Subpages widget to generate the side menus.