Edit Wordpress loop, taxonomies, & filter

I have managed to integrate a custom taxonomies plugin that: -Filters down the staff depending on what category is selected. I want it to show **that department first** , and then the other departments beneath rather than that department all on its own (how it is now). Here is the link: http://crippslawtest.co.uk/people/ I am guessing I need to add a second part to my loop, that says "And display all posts from all other categories afterwards". Here is my Wordpress loop:
         <?php         $args = array( 'post_type' => 'cripps_staff', 'posts_per_page' => 300 );         $loop = new WP_Query( $args );         while ( $loop->have_posts() ) : $loop->the_post();              echo '
';         echo '';         echo 'ID,'image',true);         echo '">';         echo '';         echo '
';         echo get_post_meta($post->ID,'staff_name',true);         echo '
';         echo '
';         echo get_post_meta($post->ID,'staff_role',true);         echo '
';         echo '
';         echo get_post_meta($post->ID,'staff_telephone_number',true);         echo '
';         echo '
';         echo get_post_meta($post->ID,'staff_email_address',true);         echo '
';         echo '
';         endwhile;         ?>
      I have tried to make a 2nd query within my loop with the help of this page: http://codex.wordpress.org/Class_Reference/WP_Query#Methods_and_Properties What I can't figure out is how to write the argument that pulls "All other posts", any ideas? Here is my attempt:               <?php         $args = array( 'post_type' => 'cripps_staff', 'posts_per_page' => 300 );         $loop = new WP_Query( $args );         while ( $loop->have_posts() ) : $loop->the_post();              echo '
';         echo '';         echo 'ID,'image',true);         echo '">';         echo '';         echo '
';         echo get_post_meta($post->ID,'staff_name',true);         echo '
';         echo '
';         echo get_post_meta($post->ID,'staff_role',true);         echo '
';         echo '
';         echo get_post_meta($post->ID,'staff_telephone_number',true);         echo '
';         echo '
';         echo get_post_meta($post->ID,'staff_email_address',true);         echo '
';         echo '
';         endwhile;              // 2nd loop         wp_reset_postdata();         /* The 2nd Query (without global var) */         $query2 = new WP_Query( $args2 );         // The 2nd Loop         while( $query2->have_posts() ) {         $query2->next_post();         echo '
';         echo '';         echo 'ID,'image',true);         echo '">';         echo '';         echo '
';         echo get_post_meta($post->ID,'staff_name',true);         echo '
';         echo '
';         echo get_post_meta($post->ID,'staff_role',true);         echo '
';         echo '
';         echo get_post_meta($post->ID,'staff_telephone_number',true);         echo '
';         echo '
';         echo get_post_meta($post->ID,'staff_email_address',true);         echo '
';         echo '
';         // Restore original Post Data         wp_reset_postdata();         }         ?>      Thank you!


Deleting the attached "comment replies" when trashing a comment

When sending a comment to the bin, the attached "comment replies" does not get trashed or deleted. How can you configure wordpress so that when you trash a comment, the comment replies automatically gets deleted?


List repeating share links

I want to add social share buttons to my posts, but I don’t want to put all that big bulk of code into all my content files. I want to create a function, and then add the function name to my template files, something like this:               function pietergoosen_sosiale_netwerk_deel_knoppies() {          Deel die pos met ander<p
             <a href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&amp;t=<?php the_title(); ?>" title="Share on Facebook.">             <img src="<?php bloginfo('stylesheet_directory'); ?>/images/facebook.png" alt="Share on Facebook" id="sharethis-last" />             <a href="http://twitter.com/home/?status=<?php the_title(); ?> : <?php the_permalink(); ?>" title="Tweet this!">             <img src="<?php bloginfo('stylesheet_directory'); ?>/images/twitter.png" alt="Tweet this!" />             <a href="http://www.google.com/bookmarks/mark?op=edit&bkmk=<?php the_permalink();?>&amp;t=<?php the_title(); ?>" title="Google+1.">             <img src="<?php bloginfo('stylesheet_directory'); ?>/images/google.png" alt="Google+1" id="Google+1" />             <a href="http://www.stumbleupon.com/submit?url=<?php the_permalink(); ?>&amp;title=<?php the_title(); ?>" title="StumbleUpon.">             <img src="<?php bloginfo('stylesheet_directory'); ?>/images/stumbleupon.png" alt="StumbleUpon" />             <a href="http://digg.com/submit?phase=2&amp;url=<?php the_permalink(); ?>&amp;title=<?php the_title(); ?>" title="Digg this!">             <img src="<?php bloginfo('stylesheet_directory'); ?>/images/digg.png" alt="Digg This!" />                            <a href="http://del.icio.us/post?url=<?php the_permalink(); ?>&amp;title=<?php the_title(); ?>" title="Bookmark on Delicious.">             <img src="<?php bloginfo('stylesheet_directory'); ?>/images/delicious.png" alt="Boekmerk op Delicious" />             <a href="https://mail.google.com/mail/?view=cm&fs=1&to&su=<?php the_permalink();?>&amp;t=<?php the_title(); ?>" title="epos.">             <img src="<?php bloginfo('stylesheet_directory'); ?>/images/gmail.png" alt="epos" id="epos dit" /> }      This isn't working. How should I do it correctly?


Trashed "comment replies" still visible?

When I send a "comment reply" to the trash bin it's still visible on the site. It only disappears after you've deleted it permanently. Is there a way to fix this?


wp_nav_menu, add class to every nth item?

is there a way to add a class to every nth item in a menu using wp_nav_menu? Trying to create columns but need to add a 'last' class to the 3rd item. cheers! Dc


Log hits on advertiser images

We have a few "sponsor" images on our site which link to our.. well, sponsors! ![Sponsors](http://i.stack.imgur.com/hU6uQ.png) **Source**               <img src="<?php bloginfo('template_url'); ?>/images/BelowWater.png" alt="" />     <img src="<?php bloginfo('template_url'); ?>/images/PierAquatics.jpg" alt="" />     <img src="<?php bloginfo('template_url'); ?>/images/IEF.png" alt="" />     <img src="<?php bloginfo('template_url'); ?>/images/sponsor1.png" alt="" />      What I'd like, ideally, is a plugin which can track the hits on these images; i.e. to show me that `170 clicks have been made on all of our sponsors; 34 on the Amazonas`. Obviously it doesn't need to be this specific, and I guess the plugin would have to set these images up in the first place. That's all fine. Thanks in advance,


How to display a certain template element only for posts published within certain time range?

I recently migrated a blog from sub.domain.com to blogs.domain.com/sub/. Because I'm using Facebook comments, all the posts published before April 25 need to reference sub.domain.com/blog-entry-title as the fb:comments href. I know how to display certain posts for my date range with this code:               <?php           function filter_where($where = '') {           //posts for Jan 1 to April 26, 2012         $where .= " AND post_date >= '2012-03-01' AND post_date <= '2012-03-15'";         return $where;           }     add_filter('posts_where', 'filter_where');     query_posts($query_string);     ?>      But can I manipulate this code to use at the template level to say: "If post published before April 25, display xyz comments; else display abc comments."


How can I attach files without using a plugin?

I want to add files from my site or from external links with files to any of my posts, and be able to add the size of the file and choose which ones it will do "File Force" and which not. I want to have too a counter that it will show how many clicks/downloads the file had. Any link that I add to a post internal or external, I want it to have automatically rel noindex, nofollow. Is this possible to do with custom fields??? I also tried by adding media>external media, I inserted it to the post but it doesn't show it in the post, have I done something wrong or I have to something more to find out?


Get first image in a post

I am using this code directly from the codex.               function echo_first_image ($postID)     {                            $args = array(         'numberposts' => 1,         'order'=> 'ASC',         'post_mime_type' => 'image',         'post_parent' => $postID,         'post_status' => null,         'post_type' => 'attachment'         );              $attachments = get_children( $args );              //print_r($attachments);              if ($attachments) {             foreach($attachments as $attachment) {                 $image_attributes = wp_get_attachment_image_src( $attachment->ID, 'thumbnail' )  ? wp_get_attachment_image_src( $attachment->ID, 'thumbnail' ) : wp_get_attachment_image_src( $attachment->ID, 'full' );                      echo '<img src="'.wp_get_attachment_thumb_url( $attachment->ID ).'" class="current">';                  }         }     }      I call it within the loop like this `echo_first_image ($post->ID);` The function does call but nothing gets output ... as far as I can see there is nothing in `$attachments` I do have an image in the post I am using. It's not a featured image or in a gallery, just in the post. Am I doing something wrong, or is there something wrong with the code in the first place?


How can I display show/hide elements when user is registered?

I'd like to change some elements in my header when the user is registered. I have both codes of the element, one when unregistered and the other when the user is registered, but I don't know how to make them switch. Any help?


Enqueueing scripts selectively & activation where needed

If I enqueue my scripts selectively, for instance I have a slider I only want to load on homepage, which is activated in main-js, e.g:               wp_enqueue_script( 'main-js' );     if ( is_front_page() ) {           wp_enqueue_script( 'slider' );     }      What is then the best way to do this? because all my jquery is in main-js and is applied to every page, so the call to activate the slider (e.g. `$('#slider').slider();`) only applies to homepage? Hopefully that makes sense and appreciate if anyone could explain best way to do this. UPDATE: So in functions.php I have:               // Hook in function with javascript files using the wp_enqueue_scripts hook      add_action( 'wp_enqueue_scripts', 'load_javascript_files' );          // Register javascript files     function load_javascript_files() {          wp_register_script( 'slider', get_template_directory_uri() . '/js/slider.js', array('jquery'), '', true );     wp_register_script( 'main-js', get_template_directory_uri() . '/js/main.js', array('jquery'), '', true );          wp_enqueue_script( 'main-js' );     if ( is_front_page() ) {         wp_enqueue_script( 'slider' );     }          }      And main.js has generic code, e.g:               jQuery(document).ready(function($){            //activate slider       $('#slider').slider();                // scroll body to 0px on click         $('a[href=#top]').click(function () {             $('html, body').animate({                 scrollTop: 0             }, 'slow');             return false;         });              //add opacity to linked images         $("a img").hover(function(){            $(this).stop().animate({"opacity": 0.7}, 200);            },function(){            $(this).stop().animate({"opacity": 1}, 300);         });       });      So I need the slider activation only to apply to the homepage.


Post-upgrade problems: Image URL in DB, but not showing

Hey I'm a WP noob but I was given the task of upgrading WP from 3.2.x to 3.5.x. Now some images aren't showing. Here's the chunk of code responsible for it:               $query = "select w1.guid,w2.post_title, w1.ID from wp_posts w1,wp_posts w2 where w2.id=w1.post_parent and w1.post_type='attachment' and w1.post_parent in (".$post_a.") and w2.post_status='publish' ORDER BY w2.post_date DESC ".$lim_." ";          $terms = $wpdb->get_results($query);     print_r($terms); // for debugging     for ($i = 0; $i < sizeof($terms); $i++) {         $gallery_image_thumb = wp_get_attachment_image_src($terms[$i]->ID, 'thumbnail');              if ($size != "") {             $result_[$i] = 'post_title.'" border="3"> ';         } else {             $result_[$i] = 'post_title.'" border="0">';         }      So for one section it shows images properly, but for another it generates images with empty `src`s. So I printed out the `$terms` search results array and this is what comes up for the section that works: `Array ( [0] => stdClass Object ( [guid] => http://www.mysite.com/wp- content/uploads/2013/05/jmc-body.jpg [post_title] => jmc-body [ID] => 28358 ) [1] => stdClass Object ( [guid] => http://www.mysite.com/wp- content/uploads/2013/05/jmc-80.jpg [post_title] => jmc-80 [ID] => 28356 )` while this is the `$terms` array for the section that doesn't work: `Array ( [0] => stdClass Object ( [guid] => http://www.mysite.com/images/mysite/gallery_latest_images/ckc721.jpg [post_title] => CKC_704 [ID] => 25367 ) [1] => stdClass Object ( [guid] => http://www.mysite.com/images/mysite/gallery_latest_images/jmc1294toy.jpg [post_title] => JMC_1294 [ID] => 25366 )` So I'm guessing that I need to add an if/else condition on this line: $gallery_image_thumb = wp_get_attachment_image_src($terms[$i]->ID, 'thumbnail'); ? I assume `wp_get_attachment_image_src` looks only in uploads? Does anyone know a clean way of fixing this? I'm not sure what kind of if/else statement I could do... unless it were a regex for matching the guid?


Display same menu for parent and all its children

I have three main directories in my site, and I'm wanting to display one unique menu for each directory and display it on each child of that directory. I'm thinking I create my three custom menus, but then what would be the best way to display the correct one for each section? Thanks for your help!


Limiting number of visible links displayed with wp_link_pages

I need to extend the wp_link_page function to only show a max of 5 links at a time. What is the best approach to limit the number of links? In the end i'd like it to look like this: **_Previous 1 2 3 4 5 ... Next_** I've already used this solution to generate the prev/next buttons along side the numbers.


Disable wordpress pagination URL rewrite for specific page

I'm hoping somebody could help me out with the following issue. I have a wordpress page: http://www.howdesign.com/design-jobs and there is a list of jobs coming from behance.net via JavaScript. When you click on "Next Page" or a specific page number, the URL is supposed to be as follows: /design- jobs/?callback=Joblist.search.repage&page=2&sort=published_date&status=current However, WordPress automatically takes the "page=2" and rewrites the URL as               /design-jobs/2/?callback=Joblist.search.repage&sort=published_date&status=current      (I was unable to post more than two URLs hence the shortened version). Notice the number 2 is now out of the query string and "page=2" was removed as well. This then breaks the pagination of the job listing on this page. I was wondering if there is a way to disable this rewrite behavior for a specific page to allow the pagination to work correctly.


Plugin hook breaks new WP 4.0 media library grid view?

I have a plugin which has code in it which has broken the new WP 4.0 media library grid view. The grid view itself (the rest of the page is fine) won't display if my plugin is active and this option is checked. My code is getting the current screen and displaying a bar with info about it (just below the admin bar) if the user has this option checked. Here is the code that was working properly prior to WP 4.0 release:               function sbah_show_current_screen() {         $screenoptions = get_option('sbah_options');         if(isset($screenoptions['sbah_view_screen'][0])) {             $takenscreen = $screenoptions['sbah_view_screen'][0];         }         if(isset($takenscreen)) {              function my_current_screen($screen) {                 if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) return $screen;                 $idofscreen = $screen->id;                 echo "
This is your current screen ID ( You can turn this off here ):  ".$idofscreen. "
";                 return $screen;             }             add_action('current_screen', 'my_current_screen' );         }     }     add_action( 'admin_menu', 'sbah_show_current_screen' );      My bar still displays just fine, the only thing that seems to be broken is the grid view of the media library. Even the list view of the media library still works just fine.


Cannot add custom image uploader for custome post type in custom wordpress theme

I am trying to set image uploader for a custom post type on a Theme I am developing. The aim is to get it to insert the image URL into the textbox of id "meta- image" but instead it inserts the image into the content editor field! here is the code I have so far: this displays the button and text input:               <?php              global $post;             $prfx_stored_meta = get_post_meta( $post->ID );        ?>     <p>                 <label for="meta-image" class="prfx-row-title"><?php _e( 'Service Icon', 'prfx-textdomain' ); ?></label>                 <input type="text" name="meta-image" id="meta-image" value="<?php if ( isset ( $prfx_stored_meta['meta-image'] ) ) echo $prfx_stored_meta['meta-image'][0]; ?>" />                 <input type="button" id="meta-image-button" class="button" value="<?php _e( 'Choose or Upload an Image', 'prfx-textdomain' ); ?>" />     </p>      this includes the necessary js for admin area:                   /**      * Loads the image management javascript      */     function prfx_image_enqueue() {         global $typenow;         if( $typenow == 'service' ) {             wp_enqueue_media();                  // Registers and enqueues the required javascript.             wp_register_script( 'meta-box-image', get_bloginfo('stylesheet_directory').'/js/meta-box-image.js', array( 'jquery' ) );             wp_localize_script( 'meta-box-image', 'meta_image',                 array(                     'title' => __( 'Choose or Upload an Image', 'prfx-textdomain' ),                     'button' => __( 'Use this image', 'prfx-textdomain' ),                 )             );             wp_enqueue_script( 'meta-box-image' );         }     }     add_action( 'admin_enqueue_scripts', 'prfx_image_enqueue' );      and this is the js:               /*      * Attaches the image uploader to the input field      */     jQuery(document).ready(function(){              // Instantiates the variable that holds the media library frame.         var meta_image_frame;              // Runs when the image button is clicked.         jQuery('#meta-image-button').click(function(e){                  // Prevents the default action from occuring.             e.preventDefault();                  // If the frame already exists, re-open it.             if ( meta_image_frame ) {                 wp.media.editor.open();                 return;             }                  // Sets up the media library frame             meta_image_frame = wp.media.frames.meta_image_frame = wp.media({                 title: meta_image.title,                 button: { text:  meta_image.button },                 library: { type: 'image' }             });                  // Runs when an image is selected.             meta_image_frame.on('select', function(){                      // Grabs the attachment selection and creates a JSON representation of the model.                 var media_attachment = meta_image_frame.state().get('selection').first().toJSON();                      // Sends the attachment URL to our custom image input field.                 jQuery('#meta-image').val(media_attachment.url);             });                  // Opens the media library frame.             wp.media.editor.open();         });     });      any ideas on how to get this actually storing to the proper area?


wordpress pagination fix after the_posts

I am using the_posts action to filter out some unwanted posts - this works fine, but the pagination after this is applied gets broken. If for example there is a page with 10 results before the_posts is applied, then after it gets applied the page displays only 6 posts for example, yet there is 100 posts in total and 20 of them should be excluded. Pagination shows 1-10 pages when it should show 1-8. So the question is - how to make pagination work as expected and display 10 posts per page and not to have pages with less than that.


?taxonomy_name=slug shows both posts and pages

Visiting `mysite.com/?taxonomy_name=slug`, or otherwise querying for a taxonomy, lists both matching posts _and_ pages. (My taxonomy applies to both posts and pages.) I would prefer that it listed only the posts. I don't think earlier version of wordpress worked this way. Am I doing something wrong? Is there a proper way to get just the posts? I can think of hacks to fix it such as modifying the archive template or query hooks, but is there a simpler way? Can this behavior be changed in the way you register your taxonomy?


edit title-tag in wp_head with yoast seo

I want to manipulate the html-title tag. so < title > these not the content of the title-tag! I use child-themes and it's inevitable, because the template have to be easy to update. So I have to use the functions.php or the header.php in the child- folder. At moment I try it with the functions.php At moment I have following situation:                              <title>My awesome title-content</title>     <meta name="robots" content="noindex,follow,noodp,noydir"/>     <link rel="canonical" href="WEBSITE" />     <meta property="og:locale" content="de_DE" />      and I want to have these situation: The focus are on the title-tag                              <title itemprop="name" id="company_name">My awesome title-content</title>     <meta name="robots" content="noindex,follow,noodp,noydir"/>     <link rel="canonical" href="WEBSITE" />     <meta property="og:locale" content="de_DE" />      my current try in the functions.php in the child-folder are:               add_action('get_header', 'blog_template_add_ob_start');     add_action('wp_head', 'blog_template_add_ob_end_flush', 100);     function blog_template_add_ob_start() {         ob_start('blog_template_add_filter_wp_head_output');     }     function blog_template_add_ob_end_flush() {         ob_end_flush();     }     function blog_template_add_filter_wp_head_output($output) {              if (is_single()) {             $output = preg_replace('/<title>(.*?) - (.*?)<\/title>/', '<title>$2 » $1</title>', $output);             #$output = str_ireplace('<meta property="og:url" content="' . $url . '" />', '<meta     property="og:url" content="' . esc_attr(esc_url($altUrl)) . '" />', $output);         }         return $output;     }      my first try was these: first:               function add_itempromp_to_title( $str )     {         #$str = preg_replace('/<title>(.*?) - (.*?)<\/title>/', '<title>$2 » $1</title>', $str);         return $str;     }        add_filter( 'wp_head', 'add_itempromp_to_title', 99 );      I had try these: Manipulating wp_head content but isn't work anymore. have anyone a idea? The Yoast-Plugin-Version are 1.5.3.3 The WP-Version are 3.8.3


Get site owner meta to show publically on front end in multisite? using "user meta shortcodes" plugin

I've searched all over for a fix and have had no luck. Im using the "User Meta Shortcodes" plugin to display user meta. The plugin works fine, the problem is that it doesnt output the meta info from the site/blog owner, it only outputs the meta of the super admin. Im assuming that the "get" function that is being used in the plugin is only for single install not multisite install. PLEASE HELP! Also the user_meta that is being return only show up when someone is logged in but I would like it to show publically on each site in my network uniquely based upon site/blog owner. I am very new to php, so ANY assitance willl be greatly appreciated. Thanks! here is the code for the plugin:                     function userInfoSc ( $attributes, $content=null ) {              extract(shortcode_atts(array(         "field" => null, "if" => null, "nospan"=>false, "size"=>32, $default=>""     ), $attributes));          //use {{empty}} instead of nothing inside the shortcode     if('{{empty}}'==$content) $content="";          global $user_info, $user_ID;          get_currentuserinfo();          $user_info = get_userdata($user_ID);          //if we have a test, we print the content in case the test is true. otherwise we print the field value concatenated with the content of the shortcode     if (isset($if) && $field != "avatar") {         if ( $if == $user_info->$field ) return do_shortcode($content);     }     else {         if ( is_user_logged_in() ) {             if( $field != "avatar" ) {                 if ($nospan)                     return $user_info->$field . do_shortcode($content);                 else                     return "" . $user_info->$field . do_shortcode($content) . "";             }             else  {                 return get_avatar( $user_info->id, $size, $default, $user_info->first_name . " " . $user_info->last_name );             }         }     }          //return empty string in case we arrive here     return "";      } add_shortcode('userinfo','userInfoSc');


Is it possible to use line break in theme description?

I want to give linebreak on Wordpress theme's description in `style.css` (the one in here):               /*     Theme Name:      Theme URI:      Description:      Author:      Author URI:      Version:     Tags:      */      But it appears the formatting doesn't allow any linebreak. When I tried writing on the line below it, the text won't appear. I tried adding `/n` as a mean to add linebreak, but the `/n/` wasn't read as linebreak. Is it not possible to add linebreaks in Wordpress theme's description? I think linebreaks may be useful when theme designer wants to outline something in points/bullets (what I've been trying; that is I want to outline several features of the theme).


Shortcode with custom content attribute?

I am creating a shortcode for a client site that should display an image and a saying (mainly at the bottom of the page, but basically wherever the client wants to insert said image/saying). The image would remain the same, and there will be a "standard saying", but the client would like the potential to change the saying on a per-page basis. I have the following working code which works great when using the **[call_to_action]** shortcode:               <?php      function shortcode_call_to_action() {      $stylesheetdir = get_bloginfo('stylesheet_directory');     return '

Lorem ipsum dolor sit amet, jus ludus dignissim delenit incassum adipiscing, letalis ymo loquor populus sed saepius. Quod regula vulputate eum nulla, feugait foras ex ideo.
' ;     }     add_shortcode('call_to_action', 'shortcode_call_to_action');         ?>      What I'd like to do, somehow, is add an attribute in there, somewhere, so that the client can change/overwrite the call_to_action text by changing it right in the shortcode: **[call_to_action]This would be the new overwritten text that would show up if inserted here.[/call_to_action]** I would also like it to respect any html (paragraph and/or break) tags that might be used. Willing to re-write my previous function if necessary. I'm a php noob so I can't seem to figure this one out. Any help is greatly appreciated. Thanks SE!


Nicest way to 301 Redirect traffic when changing permalink settings

If I change my permalink structure, is there is a nice way to handle when people/bots go to the old structure? I presume I can add use .htaccess and write a rule to redirect based on a 301 but is it possible in my case? I currently have site.com/%year%/%month%/%day%/%postname% and I will just want site.com/%category%/%postname%


Search Users base on meta_value & meta_key

How can i use multiple meta_key and meta_value to search users? For example, i want to search & find user name is "David" & location in "London". I'm using this query, But nothings in result!               $query = "SELECT user_id FROM $wpdb->usermeta WHERE (meta_value LIKE '%%david%%') AND (meta_key = 'first_name') AND (meta_value LIKE '%%london%%') AND (meta_key = 'location')";          $rows = $wpdb->get_results($query);      Thanks


display featured image in RSS feed

Hay, does anyone know a way to display the featured image url within the RSS feed?


Any Hook Called When Post Becomes Published?

Posts may be published either immediately or in the future. Suppose a plug-in wants to do something at the moment when the post becomes published and visible on the blog (I don't mean when the post is saved as published in the admin panel with whatever date). Is there a hook like "post_visible" or something similar.


Recommendations for books/resource to get started with wordpress 3 development (plugins/themes)

i am looking for learning resources to get started with wordpress 3 (i'd like to learn the latest) plugin/theme development. i also looked at Recommendations for an In-Depth WordPress Book? i am looking for recommendations on which book i should get. considering i am looking for something for wordpress 3   * Professional Wordpress \- i am actually reading this because its the newest i can find on amazon and it got 5/5 rating at amazon!    * Digging into Wordpress (v3)   * Build Your Own Wicked WordPress Themes \- i found this on the other question supposedly this is more advanced   * WordPress Plugin Development – Beginner’s Guide \- also from the other question. but are they for wordpress 3? is there alot of differences in wordpress 2 vs 3? i guess since i am new to wordpress development, its better and less confusing to get a wordpress 3 book?


Showing sequences of related posts

I'm starting a Wordpress site similar to Khan Academy [*]. It'll be a series of blog-posts, one video per post, from multiple instructors, with each post providing the canonical place to discuss the topic explored in the video. An instructor is likely to put up several videos in an ordered sequence, although they may not be contiguous blog posts. I really want a way to show a navigation element to help users navigate the sequence, possibly just a "next" and "previous" link that take you to the next and previous video in the sequence [as opposed to the next and previous post chronologically]. (Even better would be to show the names of the next and previous posts, to show how many posts are in the sequence and which one you are on, or even to show some sort of map of the knowledge-base.) After some reseach, I see a couple of ways to do this:   * _Manually_. Ugh. You put in prev/next posts by hand. Tedious, error prone, and static.   * _Categorically_. I could create a category for every sequence to be created and tag the video with only that category, and then use something like `previous_post_link('« %link', 'Prev: %title', TRUE);` (and a corresponding next_post_link) in the loop. [Admittedly, I could use more than one category and an additional parameter to exclude them; if generally useful categories are added very often, though, it seems like I'll be tweaking the code a bit to exclude them.] While the second option seems reasonable, it does seem a little inelegant, and I can't help but think there might be a better approach (that doesn't require me to try to constantly come up with new, human-readable category names). I can't help but think that a plugin or other method to address this problem already exists. * * * [*] I am aware that Khan Academy provides an open-source implementation of their software to run on Google App Engine. That is phenomenal. It is designed to take all the playlists from a youtube channel and organize them for easy access through the main page, showing a video for each one you click on. I spent a few hours trying to get a grip on what it does and adjust it to run my site, with little success, and have decided not to put more time into it. Also, Wordpress will let me do things (like add links to pdf files) that I can not clearly do with the Khan engine.


Resizing images to the actual size used in the editor?

Is there a way to resize images to the actual size they will be shown in the post? I have users that import a large image and then resize it in the visual editor. This is easy, since they can just drag the image until it is the size they want, without first opening an image editor, resizing the image, saving it, and uploading it as a separate attachment. Of course, this sometimes results in an image that is 100px wide in the post, but 1500px in reality. Is there a plugin that does this when a new post is saved? I would like to keep the existing full-size image (for linking, or later resizes), but just add an extra size (and save it in the `_wp_attachment_metadata` object), so this post has the image in the correct size, and a reference to the full-size attachment. Of course, all existing posts should also be handled once. `<img>` tags there might have just a `width`, just a `height`, or none of them: this should all be cleaned up, so they all have the correct `width`, `height` and an image of that size.


Programmatically publish a post (custom post type) with custom fields

I have a custom post type 'Participant' with many custom fields. I also have a form with corresponding input fields for the user to fill out. When he submits the form, I want a new post to be generated with each custom fields containing the value chosen by the user. Is it possible to do and if so, how?


Using shortcodes in PHP

I'm trying to use shortcode in my page, I'm starting with a simple test. In `functions.php`:               function HelloWorldShortcode() {         return '
Hello World!
';     }     add_shortcode('helloworld', 'HelloWorldShortcode');      In `index.php`:               [helloworld]      This doesn't produce `<p>Hello World!</p>`. Instead I just get the text `[helloworld]`. How can I get shortcodes to work in a PHP document?


Header Slideshow

> **Possible Duplicate:**   >  Using short codes I want to add a slideshow in the header section of twenty eleven theme instead of header image. I have tried different plugin , but the only work into the post or int the widgets. they use the shortcode like [sample_slide id="1"] . But , if I could use them into the **header.php** i might be satisfied. But it doesn't work into the php code. What can I do ?


Broken image multisite

I've two wp sites (multisite) with the following config: > 1# > > (Main site) Home: http:// www.mysite.com > > Upload Path: wp-content/uploads > > Fileupload Url: http:// www.mysite.com/wp-content/uploads > > 2# > > Home: http:// www.mysite.com/en/ > > Upload Path: wp-content/blogs.dir/2/files > > Fileupload Url: http:// www.mysite.com/en/files My .htaccess has the following:               # BEGIN WordPress     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]          # uploaded files     RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]          # add a trailing slash to /wp-admin     RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]          RewriteCond %{REQUEST_FILENAME} -f [OR]     RewriteCond %{REQUEST_FILENAME} -d     RewriteRule ^ - [L]     RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]     RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]     RewriteRule . index.php [L]     # END WordPress      The first site is working 100%, i can upload images, view them on the media library & post edit and they show OK in the page The second site, when I upload the image, it shows a broken image: http://i.stack.imgur.com/EsMg4.gif But when I click the "edit image" button it shows OK: http://i.stack.imgur.com/5gMIH.gif I've checked and the image is on the right folder (http: //www.mysite.com/blogs.dir/2/files/honey.jpg) but it's broken in the admin panel and the site. The url of the broken image is: http: //www.mysite.com/en/files/honey.jpg I've lost hours trying to fix it through .htaccess and changing the wordpress config but nothing seems to work. Any ideas? Thanks!


custom walker to add iconfont to wp_nav_menu

I want to add the font awesome iconfont to my menu list items, so I need to make a custom Walker. Because the font per menu item will be different I was hoping to use the css class in the WP backend to add the name of the icon and then output that css class within the output of the walker. Example how it should become:               $item_output .= '<a'. $attributes .'><i class="icon-' . [output css class WP backend] . '"></i>';      Does anyone know how to filter the CSS class to be able to add it to the custom walker? Thanks and Merry Xmas!


Using pre_get_posts to filter by custom fields while using static front page

I'm trying to filter a custom post type loop by several custom fields using pre_get_posts. Category pages display just fine. I'm having trouble with the static front page which for some reason displays the blog posts template (with custom post type posts) instead of the custom page template I set as static front page. Hope someone can shed some light on this. Here's the code ...               function filter_posts( $query ) {         if (!is_admin() && $query->is_main_query() ) {             if ( get_query_var('paged') ) { $paged = get_query_var('paged'); }         elseif ( get_query_var('page') ) { $paged = get_query_var('page'); }         else { $paged = 1; }             $today = date('Y-m-d H:i:s');                   $metaquery = array(                             array(                                                  'key' => 'expire_date',                                  'value' => $today,                                      'type' => 'DATETIME',                                      'compare' => '>'                             ),                                  array(                                                  'key' => 'sold',                                  'value' => 'yes',                                      'type' => 'string',                                      'compare' => 'NOT EXISTS'                             )                     );                  $query->set( 'post_type', array( 'cpt' ) );             $query->set( 'meta_query', $metaquery );             $query->set('page_id', ''); //Empty                 $query->set( 'post_status', 'publish' );             $query->set( 'paged', $paged );             $query->is_page = 0;                 $query->is_singular = 0;              }              return $query;     }     add_filter( 'pre_get_posts', 'filter_posts',11 );


Allow guests comments on single post

I would allow guests comments who are not registered yet to comment only one single post. Other posts have to be commentable just for registered users.


How to make a page template to list all galleries?

I'm trying to code a theme where I'll have a universal gallery page. Basically like: http://www.engadget.com/galleries/ However I'm at a loss for what I'd use to call all the galleries. I need the galleries to be custom post types (so I have domain.com/gallery/title-of- gallery/), but the galleries also have to be able to be inserted into posts via [gallery] (or something like that). Also, the galleries have to have some sort of category assigned to them (like Reviews or Previews). I also need to be able to insert multiple galleries into one post for reviews (where multiple galleries may be needed). Does anyone have any way I'd be able to achieve this?


Setting up an API "listening" page

I need to create a PHP script that will receive data from another application via an HTTP post, process that data, and update the WordPress database. This script will run silently (i.e., no HTTP output). What is the best way to set up such a page? I thought about creating a custom template file with the PHP script and assigning that template to a blank WordPress page, but is there a better method I should use?


How to pass the current content of $wp_query to a new page?

I am developing a Wordpress theme that uses a lot of AJAX. It is composed of two main pages: the index, which displays a list of posts, and a viewer (similar to single.php). When a post is clicked in index.php, Wordpress takes the user to viewer.php, which displays the post. In viewer.php the selected post is displayed, and the links prev an next will load the previous or next posts with AJAX, instead of the current one. My problem is that in index.php, different category filters can be applied, so I would want the exact sequence of posts displayed in index.php passed to viewer.php, so the next and post will use the sequence of posts that was displayed in the homepage. I've been reading the docs to understand how WP handles the $wp_query info, but I am not sure I understand it, so I would appreciate your help.


How can I get the featured image or the first image for a post/page and display it as a banner?

I'm making a travel site and for each page/post I want to display a google map and an image of the place referenced in the post/page the image is kind of banner-size so I dont think that the post thumbnail would do (unless I can get the high-res image of which the thumbnail comes from) I thought of getting the first image of the post and wrap it in a div and display it alongside the google maps iframe so, is there any way to do this in the template? (I can always resort to cheap tricks like wrapping the image and the iframe in a special div while creating the page but I was wondering if there is any easier way that works for every first image without me having to do anything)


get_category_link() for custom post type does not include custom slug rewrite?

I am getting a list of categories for a custom post type `project` using `get_categories($args)` with the following arguments:               $args = array(     'type'=> 'project',     'orderby'=> 'name',     'order'=> 'ASC',     'hide_empty'=> 1,     'hierarchical'=> 1,     'exclude'=> '',     'include'=> '',     'number'=> '',     'taxonomy'=> 'category',     'pad_counts'=> false      );      Then I am iterating through the categories and linking to the archive with the following code: `<li><a href="<?=get_category_link( $category->term_id ); ?>" title="<?php sprintf( __( "View all posts in %s" ), $category->name ); ?>"><?=$category->name?></a></li>` The problem is, the resulting link is like: `http://domain.com/category/example_cat` which results in in a 404, rather than: `http://domain.com/projects/category/example_cat` I know I could do an `str_replace()` but it seems like there should be a proper way to do this, does anyone know how to ensure the category link is properly generated with the custom post type? EDIT: I am rewriting the slug in the custom post type declaration with `'rewrite' => array('slug' => 'projects')`


to create own conditional tags for business directory in wp

i want to create conditional tags for the business directory categories as the conditional tags which are provided are for normal categories.which do not work for the business directory categories.can i do ths? if yes, then how? thanks in advance.


Javascript not included

I have tried to include my javascript file in the following way:               function theme_scripts()     {              wp_enqueue_scripts( 'custom-script', get_template_directory_uri() . '/js/menu-fix.js',array('jQuery'), true);     }          add_action('init', 'theme_scripts');      This file is included in `functions.php` But for some reason the script does not get included. I have got `wp_head()` in `header.php` and `wp_footer()` in footer.php. ## Edit So I changed my script to:                   function theme_scripts()         {         wp_enqueue_scripts( 'custom-script', get_template_directory_uri() . '/js/menu-fix.js',array('jquery'), '1.0',true);         }     add_action('wp_enqueue_scripts', 'theme_scripts');      But still it isn't loaded. This is how my `footer.php` looks like:               <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>        <script src="<?php bloginfo('template_url'); ?>/js/bootstrap.min.js"></script>        <?php wp_footer();?>


How to generate a list of posts published on current day?

I want to create a page labeled "Today's News" which displays a simple bulleted list of all posts published on the current day and grab the current date based on the server's date/time. Is this feasible? Thank you for any help.


stuck with template hierarchy

I modified my category.php file to pull posts from all the categories that are posted to a main category parent. It's working perfectly. Now I need to get it so that when you click on the child category permalink, it will take you to that category and list all the posts from that category. That's not working perfectly. When I click on the permalink which is myDomain.com/?cat=12 I get a blank page. This is my category.php file as it is right now. Well, the relevant stuff, I left out the header and footer

             <img src="<?php bloginfo('stylesheet_directory');?>/images/menu.png" width="137" height="30" alt="Our Menu" />

              <?php      $allcats = get_categories(array('child_of' => get_query_var('cat'), 'number' => 9999,      'order'=> 'asc'));       ?>
<?php       foreach ($allcats as $cat) :        $args = array(       'category__in' => array($cat->term_id)      );            query_posts($args);       if (have_posts()) :       ?>
<?php      echo '
';              $terms = apply_filters( 'taxonomy-images-get-terms', '' );         if ( ! empty( $terms ) ) {         foreach( (array) $terms as $term ) {                 if($term->term_id == $cat->term_id) {                   echo wp_get_attachment_image( $term->image_id, 'menu' );                 }         }         }       $link = get_category_link( $cat->cat_ID );      echo '
'.$cat->name.'
';      echo '
';          while (have_posts()) : the_post(); ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
       <?php            endwhile;        echo '

';             ?>            <?php else : ?>       <?php if (have_posts()) : ?>     <?php while (have_posts()) : the_post(); ?>          <?php the_title(); ?>     <?php endwhile; ?>     <?php else : ?>     echo 'No post published in:'.$cat->name;        <?php endif; ?>      <?php       endif;        wp_reset_query();       endforeach;        ?>
      So is it possible to throw in another else loop? when I tried it, it didn't work. I had hoped the archive.php file would take care of it but it didn't. I tried a few loops with no luck. I need some good advice as to how to get this to work. Thanks for your time.


Custom Loop Using Shortcode in Custom Page Template

I am trying to output a custom loop created using shortcode in a custom page template. Here is the code I am using to generate the shortcode:               function archive_sc( $atts ) {              // Attributes         extract( shortcode_atts(             array(                 'cat' => '',                 'number' => 10,             ), $atts )         );                  $args = array(                  'post_type' => 'smr-product',                 'smr-product-category' => $cat, // 'taxonomy' => 'term',                 'posts_per_page' => $number,             );                 // The Query                 $the_query = null;                 $the_query = new WP_Query( $args );                      // The Loop                 if ( $the_query->have_posts() ) {                     while ( $the_query->have_posts() ) {                         smr_product_the_frontend_item();                     }                 } else {                     // no posts found                 }                 /* Restore original Post Data */                 wp_reset_postdata();     }     add_shortcode( 'pcats', 'archive_sc' );      And, here is the code in Custom Page Template:               <?php     /*     Template Name: Product Archive     */          get_header();     ?>
         <?php while ( have_posts() ) : the_post(); ?>
                 <?php the_content(); ?>
         <?php endwhile; ?>
               <?php get_footer(); ?>      The `smr_product_the_frontend_item()` is just a function for the HTML of each product. However, its returning infinite number of posts (although the blog has roughly 20 products) from nowhere. What I am doing wrong?


Custom user role still showing up after deletion, ideas?

I previously created a new user role called "Owner" which worked fine, however I decided to delete it afterwards from my functions.php since I found it to not be as useful for my project after all...Odd thing is though, the new custom user role is still showing up in wordpress' dropdown menu where you assign a role to a user in the dashboard. Any ideas whats going on here? I double checked my functions.php over and over and I deleted the function for sure so I have no ideas whats going on...My guess is its getting cached somehow but clearing the browser out makes no difference. Best


The alt="" attribute is empty

My WordPress installation creates empty `alt` attributes inside images. I also installed the plugin _SEO Friendly Images_ but it did not change anything.               <img     class="highmage" src="http://kringelhauser.lukaseichler.de/wp-content/themes/Reporter/timthumb.php?src=http://kringelhauser.lukaseichler.de/wp-content/uploads/2014/01/redtube-abmahnung.jpg&h=100&w=310&zc=1" alt="" />


BuddyPress: What is the use of is_default_option field in wp_bp_xprofile_fields table?

In BuddyPress, What is the use of is_default_option field in wp_bp_xprofile_fields table?


wp-admin produces a 302 redirect to itself

I'm running Wordpress (v3.5.2) in network mode. Any of the sites which try to access /wp-admin produce a browser error saying there is a redirect loop. A redirect checker tool says the page returns a 302 temporary redirect to the same URL. I have uploaded a default .htaccess file and the same thing happens. In cPanel, I have checked Domains > Redirects, and there is no such redirect listed. I have renamed /plugins to /plugins2, and the issue remains. In the wp_options table, the site_URL is set to www.example.com, which is correct. This matches the DOMAIN_CURRENT_SITE parameter in wp-config. Any ideas?


WordPress: force users to change password on first login

Users on my website sign up through a form (Gravity form) and after they are manually approved they are sent a username (their email address) and a randomly generated password. I would like these users to be forced to change their password when they first login, is this achievable? I took a look at the thread Can I force a password change? but that doesn't resolve my issue.


Get all posts by post_author

I am creating a back-end dashboard where I need to show all the post assigned to **current user** by the wp **admin**. > I assign user role to **Author** and while creating post (as a wp admin) > just assign this post to some author from Author drop-down. So I need to show posts with status **Publish**. I am now using simple query post but it is returning all posts.               global $current_user;     get_currentuserinfo();     $user_id = $current_user->ID;    // for current user it is 2          $query = array(             'post_type' => 'post',             'post_author' => $user_id,             'post_status' => array('publish')         );     $my_posts = query_posts($query);      I also hard-coded **post_author** to 2 I also tried `$my_post = new WP_Query(array( 'post_author' => '2' ));` but fail.


Submit button returns to index page instead of sending data

Here is the link for the website - http://zigzagadvertising.com.ph/aleemguiapal/97-2/ I have a problem regarding my forms in wordpress. Whenever i click on the submit button it returns to the index page instead of sending the data into an email address **This is my PHP code which i placed on top of the Header.php. This code is placed before the tag**               <?php      $error=false;     $sent=false;     if(isset($_POST['submit'])) {     if(empty($_POST['firstname']) || empty($_POST['email']) || empty($_POST['message'])) {     $error = true;     } else {           $to = "clestcruz@gmail.com";           $name = trim($_POST['firstname']);      $email = trim($_POST['email']);      $comments = trim($_POST['message']);           $subject = "Contact Form";           $messages = "Name: $firstname \r\n Email: $email \r\n Comments: $message";      $headers = "From:" . $name;      $mailsent = mail($to, $subject, $messages, $headers);           if($mailsent){          $sent= true;     }     }     }     ?>      **And this is my custom page(Contact Page)**

contact us

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras non lacus vel nulla molestie cursus quis a urna. Donec sodales venenatis consequat. Sed tristique elit nec diam rhoncus adipiscing

All fields marked with an asterisk(*) are required

          <form id="register-form" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">                    <?php if($error == true) { ?>
 There are some misisng fields.
          <?php } if($sent == true) { ?>
Thank you for sending your message
<?php } ?>
                   prefix              <input type="text"  />              *first name              <input type="text" name="firstname"/>              middle name              <input type="text" name="middlename"/>              last name              <input type="text" name="lastname"/>              *email address              <input type="text" name="email"/>

                   phone              <input type="text" />              street              <input type="text" />              zip              <input type="text" name="zip" />              city              <input type="text" name="city" />

                  subject             <input type="text" name="subject"/>             *message             <textarea name="message"></textarea>                       <input class="contact-button" type="submit" name="submit" value="submit" />             <input class="contact-button" type="reset" value="reset" />
               </form>

                     <?php get_sidebar(); ?>
                  <?php get_footer(); ?>                               I tried making a contact page and uploaded it into a free hosting site and it seem to be working properly. I even got the data or values in the forms. Not sure if the reason why my forms is not working properly is because of wordpress itself.


How to share user data across multiple Wordpress websites?

i have 3-4 sites which has content about traveling,and what i want is one site(main site content all the user data and) in all other sites, users can log in to the sites with that data ,how can i achieve that..,


How to hide plugin from WordPress Multisite admin plugin list

I use the following snippet to hide the plugins from my plugins list:               function hide_plugin_trickspanda() {       global $wp_list_table;       $hidearr = array('plugin-directory/plugin-file.php');       $myplugins = $wp_list_table->items;       foreach ($myplugins as $key => $val) {         if (in_array($key,$hidearr)) {           unset($wp_list_table->items[$key]);         }       }     }          add_action('pre_current_active_plugins', 'hide_plugin_trickspanda');      This works but when I used this on a WordPress MS, it works for all the sites, but the Network admin. I found out that Network Admin uses `active_sitewide_plugins` hook for this task, but I can't find any real way to do it. According to this site: > FYI => I was pulling an error with a plugin I developed and ended up > trolling around the bowels of WordPress, specifically WordPress multisite. > > WordPress single-site has a site get_option ‘active_plugins’. For WP > multisite it’s get_site_option ‘active_sitewide_plugins’. The issue is, > single-site uses an array with numbers—representing plugin load order—as > they key. Like this: > > [0] => hello-dolly/hello.php > > On the other hand, WP multisite uses an associative array with the plugin > name as the key and some integer as the value. Like this: > > [hello-dolly/hello.php] => 1369572703 > > The broader issue was to manipulate the load order of the plugins. Once I > understood the array types were different I added an is_mutisite() > conditional and manipulated the arrays appropriately. When I find out why > the array types are different I’ll let you know. Any ideas?


Update all posts automatically when using post_meta

I recently created a new site using wordpress but I'm a rookie - everything I know is trial and error with no formal training. So please, please, please keep your answers as simple as possible. Thanks in advance. I created custom fields and then uploaded a .csv file to create roughly 3,300 posts. I left the post_content field blank. I then developed the desired post content through the front-end using shortcodes that referenced the custom fields. Once I had what I wanted I UPDATED the poct_content field using MySQL. Every post_content for all posts is the same with the data from the custom fields being the variables. All was well to this point. When I attempted to preview in a browser I realized the custom field data is not displaying. I found that if I open a post through WordPress front-end and then click "update" the custom field data and the post content "sync" and then it will display properly through a browser. My concern is that I have nearly 3,300 posts and I really don;t want to "update" them all manually. Is there a way to write a php module to do this automatically? Is there a plugin that will do this? Is there some code that can be placed in the theme to update it when a post is opened? I am currently using the iFeature theme from cyberchimps but I'm not married to it. I'll change immediately if there as different theme that will make this work. The reason i mention the theme is this - there is no single.php file visible through wordpress but i can see it if I go to the server where the theme is saved. Example of working page: http://gunspecs.net/zastava/zastava-m70 Non-working page: http://gunspecs.net/ruger/ruger-sr40 Thanks in advance for your help. Dennis


Display Next/Prev when looping Custom post-types archive?

I'm trying to display the Next/Prev navigation buttons on my page which displays all of the pages within my 'events' custom post-type. The issue is that the buttons are not even displaying, but I have no idea why not. I have had this working with my Blog page posts, but I wonder whether there is something different I need to do with a custom post-type, considering that it's capability is set to 'page' instead of 'post'. Code:                   <?php         /* Queue the first post, that way we know          * what date we're dealing with (if that is the case).          *          * We reset this later so we can run the loop          * properly with a call to rewind_posts().          */         if ( have_posts() )             the_post();     ?>
         <?php _e( 'Results', 'twentyten' ); ?>

Displaying all of our Events:

     <?php          $paged = get_query_var('paged');         $paged = ($paged) ? $paged : 1;     ?>     <?php $loop = new WP_Query( array( 'post_type' => 'events', 'posts_per_page' => -1, 'paged' => $paged ) ); ?>     <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
         <?php if (has_post_thumbnail( $post->ID )): ?>             <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); ?>             <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><img src="<?php bloginfo('template_directory'); ?>/thumbs.php?src=<?php echo $image[0]; ?>&w=120&h=120&zc=1" alt="<?php the_title(); ?>" />         <?php endif; ?>

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

     <?php endwhile;?>

<?php next_posts_link('Next') ?>

<?php previous_posts_link('Prev') ?>

      Any help would be greatly appreciated! Thanks


How do I assign a particular post to a particular page in Wordpress?

I have created a separate page called `service.php` with following code               <?php /* Template Name: services */ ?>     ......//code     ......      So the above page now acts as separate static page.   Now I want to assign a particular post for this service page in WordPress. Is it possible to do that? Kindly advise me on this.


How to display recent posts on home page with custom HTML

I am looking to display `x` (undecided) number of recent posts (no more than 10) on my home page. For each post, I would like to display the title and a snippet of the content. I can whip up a SQL query myself to get this but I was wondering what the WordPress function is to get this. The closest I have gotten is `<?php wp_get_archives('type=postbypost&limit=10&format=html'); ?>`. I would also like to custom format the HTML. An example of the output I would like looks like this

[post title]

[post snippet]

[post title]

[post snippet]


I get "Cannot modify header information - headers already sent" when I change my theme

I get this error when I change theme in my wordpress. *Cannot modify header information - headers already sent by (output started at /home/mortgage/public_html/autoblogdemon.com/test/wp- content/plugins/test/test.php:28) in /home/mortgage/public_html/autoblogdemon.com/test/wp-includes/pluggable.php on line 866* Notice output started ar test.php:28 here is test.php and line 28 is the second opening               <?php     /*     Plugin Name: test     Plugin URI:      Description: is about to leave the page. make sure you check out the demo of the plugin.     Author: Ronny Kibet     Author URI:      version: 1.0     */          //html begins here.     function my_text_on_top(){          ?>          <!-- bar starts here -->     <div id="bar">hi there </div>               <?php // line 28 starts here.          }     add_action('init','my_text_on_top');      the plugin works fine by showing a "hi there" text inside of the div with id "bar". can somone help me get rid of the error and be able to change my themes when I activate the plugin. thanks.


More than one meta field in a single meta box?

I'm following this tutorial by Justin Tadlock on creating meta boxes. http://wp.smashingmagazine.com/2011/10/04/create-custom-post-meta-boxes- wordpress/ I can get a meta box with a single field to work without problem but I would like to create a meta box with several fields. For example a meta box called "Staff Details" with 2 fields called "Title" and "Experience". Does anyone know how I can do this please? Thanks!


Filter search posts by post meta?

I'm working with a custom post type with custom taxonomy and custom fields and trying to filter the displayed results (on admin post listing page) by the custom field values... I've been trying to modify a function i found here to do the job to no avail:               function wpg_filter_manage_quotes() {       global $typenow;       if($typenow != 'quotes') {         return;       }       $post_types = get_post_types(array( '_builtin' => false));       if(in_array($typenow, $post_types)) {         $filters = get_object_taxonomies($typenow);              foreach($filters as $tax_slug) {           $tax_obj = get_taxonomy( $tax_slug );           wp_dropdown_categories( array(             'show_option_all' => __('Show All '.$tax_obj->label ),             'taxonomy'        => $tax_slug,             'name'            => $tax_obj->name,             'orderby'         => 'name',             'selected'        => $_GET[$tax_slug],             'hierarchical'    => $tax_obj->hierarchical,             'show_count'      => false,             'hide_empty'      => true           ));         }       }     }     add_action('restrict_manage_posts', 'wpg_filter_manage_quotes');      The above function works as it should to add a dropdown to filter by custom taxonomy, but for the life of me I can't figure out how to modify it to work with custom field data... ![Custom Taxonomy Dropdown](http://i.stack.imgur.com/wcrXY.png) I'm wanting to add a dropdown to filter by Author as well, and the author is stored as a custom field value. I've also got a list of all authors currently being used in my options array in the database... It's stored as an array in a variable like so: `$wpgqs['used_authors']`. Any ideas? **EDIT:** The more I look at it, the more I think I'm going to have to hardcode the selectbox... If that's the case, then I guess I just need to know which filters/hooks I need to be using to add the hardcoded selectobx to that particular submit button's form?


Show similar category portfolio items?

I have a portfolio with categories. Portfolio-Items have featured image and are assigned to one category. Now when that Portfolio-Item is displayed, I want to display all other Portfolio-Items of that same category only next to it with its featured image. This line of code prints my current category:                echo get_the_term_list( $post->ID, 'portfolio_category', 'Cat: ', ', ', '' );       I want to show the featured image of that category only.


Upload specific images to specific folder

I am trying to find a way to upload few selective images to selective folders in WordPress but not able to find a way so far. I do not want to change default work press setting to upload images as that is needed in all cases. Working on a travel site where i need to show images of destinations on destination introduction page.Proposed structure.   1. Each Destination will belong to a state.   2. Each destinations can have multiple posts. So for e.g user want to see details about Taj Mahal, so there can be multiple posts about Taj Mahal but will going to have a common landing page for Taj Mahal with a list of posts/articles about the place. On landing page i want to show few images about that destination, and i want to store these images in following structure               wp-content\uploads\state-name\destination      _PS:For each destination, there will be few introduction images (2-3 max), and i want to upload them to specific folder._ Is it possible or do i need to create these folder structure manually


Add custom fields after post/page title

I am using the Headway theme, and I need to add custom field code to page & posttitles. This is what I need to be able to do. ![example](http://www.marbiedesign.nl/_img/customfield.jpg) The red button will be added through a custom field. It needs to be shown inline with the title. I have worked out I can do this using the `headway_after_entry_title` hook, but I can't seem to get the code right to retrieve the custom fields. I got this far :               //Add custom field image after entry title      function title_btn() {         echo '
[custom field code to go here]
';     }      add_action('headway_after_entry_title', 'title_btn');      and the outcome should be:                      where the xxx is the custom field url code Hope anybody can help me out with this.


How can i display in a archive page a number of post i want

How can i display in a archive themplate ( post type) page a number of post, Let say i want to display a number of 20 post....in archive page, under i want to display the pages... Please look here : http://cinema.trancelevel.com/trailer/aventuri/page/2/ I use post type pages... all the archive pages are now displayng 12 post.. I want to be able to display a number... let say 20 post for trailers - for the trailers category let say 10 post for actori- for actori category... Now i use :               <?php is_tag(); ?>     <?php if (have_posts()) : ?>     <?php while (have_posts()) : the_post(); ?>      Thanks in advance


Select Form Element Not Saving from Plugin Options

I am certain it is something silly. But I can't find it and with such simple code at a loss for anything else. Having looked at many other plugins doing settings in a lot of ways can't really see how it is different from those doing similar code. This is actually the select code from WordPress Codex. After my code didn't work I went and checked the codex and tried it. The really odd thing is that occasionally WordPress saves the selection. But mostly it doesn't. I can bypass the WordPress methods and use straight PHP, but then I learn nothing. Many plugins are bypassing the register_settings method to deal with POST and DB. Again as last time setup as a plugin. As always your help is greatly appreciated.                   <?php         /*         Plugin Name: myplug         Version: 0.1         Plugin URI: http://myplug.org         Author: ME         Description: Stupid plugin          */              add_action('admin_init', 'myplug_register_options');  // register options for the form         add_action('admin_menu', 'myplug_admin_links');  // register admin menu hyperlinks              /** Function to register form fields **/         function myplug_register_options(){                 register_setting('myplug_options_group', 'myplug_settings', 'myplug_validate');         }              /** Function to add hyperlinks to the admin menus using hooks and filters. **/         function myplug_admin_links() {           add_options_page('myplug Setup', 'myplug', 'manage_options', 'myplug', 'myplug_admin_page' );  // add link to settings page           add_filter( 'plugin_action_links', 'myplug_settings_link', 10, 2 );  // add link to plugin page         }              /** Function to create link for plugin_action_links filter **/         function myplug_settings_link($links, $file){                 if ( $file == plugin_basename( dirname(__FILE__). '/myplug.php')){                         $settings_link = '' .__('Settings') . '';                         array_unshift( $links, $settings_link ); // place before other links                 }         return $links;         }              /** Validate User Input **/         function myplug_validate($input) {                 $input['select_it'] = wp_filter_nohtml_kses($input['select_it']);         return($input);         }              /** Draw the Settings Page **/         function myplug_admin_page(){         ?>

Options
           <form method="post" action="options.php">           <?php settings_fields('myplug_options_group'); ?>           <?php $myplug_options = get_option('myplug_settings'); ?>             <select name="input[select_it]">                 <option value="1" <?php selected( $input['select_it'], 1 ); ?>>1</option>                 <option value="2" <?php selected( $input['select_it'], 2 ); ?>>2</option>                 <option value="3" <?php selected( $input['select_it'], 3 ); ?>>3</option>             </select>           <?php submit_button(); ?>           </form>
         <?php         }         ?>


how can I create a WP offline environment before releasing the websites?

GIT? SVN? WAMP? XAMP? MERCURIAL? BITNAMI? There are so many options that I am getting a bit cunfused. I just want to work without publishing and a need of an internet connection, and when all is ready, just release it


Shortcode question.... javascript

We want to create a short-code. The final output of the source code should be similar to the code mentioned below.               <script type="text/javascript" src="http://hosted.musesradioplayer.com/mrp.js"></script>     <script type="text/javascript">     MRP.insert({     'url':'http://streams.museter.com:8002/;',     'codec':'mp3',     'volume':65,     'autoplay':true,     'buffering':5,     'title':'Radio%20Vermont',     'welcome':'WELCOME TO...',     'bgcolor':'#FFFFFF',     'skin':'mcclean',     'width':180,     'height':60     });     </script>      the above mentioned code, when ever we insert shortcode, url and codec variable will change... we try with the following shortcode but its wrong... kindly help me...               <?     function playermp3($atts) {         extract(shortcode_atts(array(             "value" => 'http://',             "width" => '180',             "height" => '60',             "codec"=> 'mp3',             "volume" => '65',             "autoplay"=>'true',             "buffering"=> '5',             "title"=> 'Radio%20Vermont',             "welcome" => 'WELCOME TO...',             "bgcolor"=>'#FFFFFF',             "skin"=> 'mcclean',         ), $atts));         return '<script type="text/javascript" src="http://hosted.musesradioplayer.com/mrp.js"></script>     <script type="text/javascript">     MRP.insert({     'url':'.$value.',     'codec':'.$codec.',     'volume':'.$volume.',     'autoplay':'.$autoplay.',     'buffering':'.$buffering.',     'title':'.$title.',     'welcome':'.$welcome.',     'bgcolor':'.$bgcolor.',     'skin':'.$skin.',     'width':'.$height.',     'height':'.$width.'     });     </script>';     }     add_shortcode("playermp3", "playermp3");          ?>


How do I get the current edit page ID in the admin?

Most solutions I found are for front-end use. This is for a plugin, so the all activity is in the back-end. How do I get the page ID that's being currently use(edited) in the admin? **Note** I'm out of the loop. I just need to get the ID of page(not posts) that I'm currently seeing in the back-end.


Redirect to custom URL after registering from a page with registration form

I have this form in a page template               <form action="<?php echo site_url('wp-login.php?action=register', 'login_post') ?>" method="post">
Full Name         <input class="required" id="txt_FullName" title="Full Name. This is a required field" type="text" name="first_name" />

Email         <input class="required" id="user_email" title="Full Name. This is a required field" type="text" name="user_email" />

Password         <input class="required" id="pwd_Password" title="Password. This is a required field" type="password" name="user_pass" />

         <input class="" id="user_login" type="hidden" name="user_login"/>         <?php do_action('register_form'); ?>         <input type="submit" value="Submit form" />
          </form>      I need to redirect to a custom page so I have tried this filter from the question below. After registering from my custom page, I am not being redirected to `/my-page` but I have been being redirected to http://www.example.com/wp-login.php?checkemail=registered with the message `Registration complete. Please check your e-mail.`               function __my_registration_redirect(){         return home_url( '/my-page' );     }     add_filter( 'registration_redirect', '__my_registration_redirect' );      http://wordpress.stackexchange.com/a/19698/10413 How can I redirect to a custom URL when registrations are posting from a page with a custom template?


How can I rewrite old attachment URLs?

I recently converted my WordPress installation to use SSL on all pages, and now I'm getting mixed content warnings. I've cleaned up everything in my themes and admin pages, but I'm still having trouble with embedded/attached content. Most posts include uploaded images, and in the post_content those images are still referred to using an http:// URL. How can I permanently fix this and stop the mixed content warnings?   * Should I try to fix all of the posts in the database so that they have correct https URLS?   * Is there a way to dynamically rewrite posts as they are shown to use https URLS?


Changing logo image in header.php upon language detection

So i'm designing a website that will feature the Polylang plugin for automatic language detection, but I've run into a bit of a wall with the logo image. It resides in header.php, but I can't think of a way to develop a trigger to switch out that image when the browser detects a German visitor, etc. Any ideas would be greatly appreciated, the only fix I can really think of is to export the logo image as code using Adobe Illustrator CC, which I don't have. Thanks!


Calling Custom Post Meta

http://www.vooshthemes.com/blog/wordpress-tip/create-a-professional-portfolio- using-wordpress-3-0-custom-post-types/ I'm using the above tutorial to build custom portfolio pages. The custom portfolio pages are working... but I can't figure out how to display the Website URL I enter in my custom post meta field (website_url). Shouldn't `<?php echo $website_url; ?>` work? How do I call specific post meta? The normal call for all post_meta is `<?php the_meta(); ?>`, but what if I just want to call a specific piece of it (website_url in this example)?


How to Access Script Tags in Header

IN my Wordpress blog, I am looking to update a link in header that I believe is outdated: `<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js?ver=3.5.1'></script>` How do I get to this link? What file is it in? In my header.php file, I see `wp_head()` \-- I track that down and it doesn't lead me to anything that I can understand....


Insert a Custom Post type into my Loop

I have from my perspective a complicated loop. Code below.                                   <?php if (have_posts()) : ?>     <?php $new = 'first'; ?>     <?php while (have_posts()) : the_post(); ?>     <?php if( $new == 'first' && !is_paged() ) : $new = 'not-first';  ?>
<?php the_date('F jS, Y'); ?>
     <article id="post-<?php the_ID(); ?>" class="latest">
<?php the_category(', '); ?>
     <?php ($post == $posts[0] && !is_paged()) ? the_content('', 'FALSE') : the_excerpt() ; ?>
<?php the_tags('Tags: ', ', ', '
'); ?>

     <?php else : ?>
<?php the_date('F jS, Y'); ?>
     <article id="post-<?php the_ID(); ?>">
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"> <?php the_category(' '); ?>

     <?php $tags = get_the_tags();     $html = '
';     foreach ( $tags as $tag )     {     $tag_link = get_tag_link( $tag->term_id );          $html .= "name} Tag' class='{$tag->slug}'>
{$tag->name}
";     $html .= "
$tag->description
"."";     }          $html .= '
';     echo $html;?>     <?php ($post == $posts[0] && !is_paged()) ? the_content('', 'FALSE') : the_excerpt() ; ?>

     <?php endif; ?>         <?php endwhile; ?>
     <?php posts_nav_link(' • '); ?>
          <?php else : ?>

Not Found

Sorry, but the requested resource was not found on this site.
     <?php get_search_form(); ?>
     <?php endif; ?>      This loop as you may have read does the following: Displays the latest post made then goes on to display the older posts. The Latest post is displayed in another style as opposed to the older posts. I would like to add a 3rd check to this loop for a custom post type. So wordpress checks all 3 arguments then displays them based in the order on what date & time they were posted. Example of the output logic could be. July 5 - Latest, custom post type, other posts. July 6 - custom post type, newest post then oldest post. So everything works as my code shows in the sample. Only change would be the loop checks to see if a custom post type exists for that day and if it does it inserts it into the output. Edited*


Pages with 2 Columns

I've had a look at many of the available plugins but they all seem to be too difficult to use or do not provide enough flexibility. **Plugins I've already tried:**   * WP Post Columns   * Magazine Columns   * WP Columns   * WP Easy Columns I've also look at one that allowed for per-page sidebars which _could_ work but the column is separate for the content making it difficult to manage, and the lack of a WYSIWYG editor makes it difficult for those not familiar with HTML. **What I'm Trying Achieve:** The project I'm working on requires that the people responsible for entering the content be able to add content to a 3/4 column that is the main content and a 1/4 column that is informational content relating to the main content. The content of the 1/4 column will change depending on the page. To most developers, it's simple to write HTML to do that in the post's content but the people that will be adding/modifying the content don't know HTML so I'm looking for alternatives. I would prefer if they didn't have to remember codes (or short codes). To complicate things, I have 3 templates: "1 column", "2 columns (1/4, 3/4)" and "2 columns (3/4, 1/4)". **The Question:** Has anyone come up with a simple solution to this problem? Is there a plugin that I'm not aware of that would add the ability to have multiple content (column) for a single page? Or is there something that would allow me to add a WYSIWYG editor to widgets? I look forward to your thoughts and recommendations.


What to include to use jQuery UI Auto Complete

I was looking at the scripts included with WP and dont see what I can include to use jQuery UI Auto Complete. What do I use? I tried including the whole jQuery UI from Google CDN and auto complete works but some parts of the admin dashboard fails. eg. Custom Menus


What is the proper way to apply the login_form_bottom filter?

Here is my current code.               function custom_login_footer() {         return '
text text text
';     }     add_filter('login_form_bottom', 'custom_login_footer');      I am trying to add text below the submit button, but I do not know how to apply the `login_form_bottom` filter.


Ajax submit comments

I want to submit comments via ajax. CLick the comment submit button, comments gets posted via jquery's ajax method and the result ("Awaiting moderation...") is displayed on the page. I went into the scripts.js file and added a click handler for the button. It validates and then does an ajax submit but this is not working. Clicking to submit a comment still redirects to the wp-comments-post.php page. What's the secret to getting this to work? Here is what I have in scripts.js:               $("#my_comment_form").validate({             submitHandler: function(data){                 $.ajax({                     type: "POST",                     url: "../wp-comments-post.php",                     data: data,                     success: function(){                         $( ".form_success" ).dialog( "open" );                     },                     error: function(){                         console.log('oh snap!');                     },                     complete: function(){                         console.log('complete');                     }                 });             },            errorContainer: ".errors",            rules: {              email: {                email: true              }            }         });      * * * EDIT: My problem stemmed from the fact that the data being passed back was not complete or had errors. This caused the submitHandler to error which then let the built-in action (built into Wordpress' comment generation code) fire. By passing in correct data in the first place and handling any errors that may arise in the submitHandler's error method I was able to get things working with the above code.


Losing Nav Active State in Menu

In the following section:               http://www.zimmernutrition.com.php53-23.ord1-1.websitetestlink.com/learning-center/      In the sidebar, if you click "Health Articles" and click one of the categories, the active "orange" state of "Learning Center" is lost. Articles are a custom post type (CPT) and the categories are a related custom taxonomy. Not sure if the menu is coded incorrectly, the CPT, the custom taxonomy, or some combination.


Setting thumbnail featured image size not working properly

Hi I just started today on creating my first Wordpress Theme and I am trying to create a featured Image for each post.Aldo I have managed to acomplish that it seems that the sizes I am giving it are not taking effect.Here is my code:               if(function_exists('add_theme_support')){        add_theme_support('post-thumbnails' , array('post'));        set_post_thumbnail_size(200,120);     }          if(function_exists('has_post_thumbnail') && has_post_thumbnail()){           the_post_thumbnail();     }      It seems that my featured images are not always set to the same size.For example if the image is smaller then what size I set it will remain the same , for big images the width is the same but for some the height is different. What am I doing wrong here?


How to remove all the items under "Personal Options" on user profile page?

Under "Personal Options" on user profile page, there are: (1) disable visual editor (2) admin color scheme (3) keyboard shortcuts (4) show admin bar I can remove admin color scheme using remove_action, but not the rest. Is there a way to remove them all at once? Or one by one using remove_action or style or js?


How does one customize the table of listings for a custom post type?

For example, if I have a Custom Post Type called "Video" and I want to show the length of that video in the main (edit.php) table listing, how can I manipulated the columns shown in that table?


How do I call a function to use on a page?

I want to be able to use a function called DisplayAverageRating for each of all the posts I list on a page. The function can be found here: http://pastebin.com/iXym00QM How am I supposed to call it in my code for the average rating for each post to be shown? This is how far I've gotten but it's not working yet:

     <?php     $args = array( 'numberposts' => 200, 'orderby' => 'rand' );     $rand_posts = get_posts( $args );     foreach( $rand_posts as $post ) : ?>
     <a href="<?php the_permalink(); ?>"><?php the_title(); ?>          <?php if(function_exists('DisplayAverageRating'))      {      DisplayAverageRating();      }      ?>
     <?php endforeach; ?>

      Would really appreciate your help.


Problems with Wordpress Import

I have a VPS hosting account with Web Fusion and am migrating one of my Wordpress sites to it. The Wordpress export file is about 29 MB. At first i encountered an Internal Server Error after attempting the first upload. After doing some research and checking the server logs it appeared to be a problem with the FCGID and PHP ini settings. The Host is using a Plesk control panel through which I increased all the memory limits and restrictions to 64M and allowed file uploads. I have also gone through changing the FCGID limits in the Apache modules and another 2 config files on the VPS. It all seemed to go OK. I restarted the server to apply the changes, however now when I attempt to upload the XML file via the Wordpress Admin Panel I get is the Import Wordpress title and a blank page. No posts are uploaded and it does not give me any further options about the media import. There also no further loggs in the error_log file on the server to suggest any issues Any suggestions?


RSS Feed has no Items (Possible Plugins Conflict)

I am the webmaster of the German WordPress website http://www.kunstplaza.de. Recently, I have noticed that there are no items in the RSS feed, although there should be some as I am posting new articles on a regular basis. The Feed URL is: http://www.kunstplaza.de/feed/ As far as I remember, this feed did work in the past. I have already deactivated all plugins and themes (one by one) and tried to retrieve the feed after that. Unfortunately, this did not have an effect. Only when I rename the "plugins"-folder, the feed starts to show up. In the error log of my hosting provider I have found this line quite some times:               [error] You have an error in your SQL syntax; check the manual that corresponds to your       MySQL server version for the right syntax to use near ']posts.ID NOT IN ( )  ORDER BY wp_posts.post_date DESC' at line 1 f\xc3\xbcr Abfrage SELECT   wp_posts.* FROM wp_posts  WHERE 1=1  AND (wp_posts.ID = '296') AND wp_posts.post_type = 'page' AND $wpdb-]posts.ID NOT IN ( )  ORDER BY wp_posts.post_date DESC  von require('wp-blog-header.php'), wp, WP-]main, WP-]query_posts, WP_Query-]query, WP_Query-]get_posts, W3_Db-]query, W3_DbCache-]query, W3_DbCallUnderlying-]query, W3_Db-]query, W3_DbProcessor-]query, W3_Db-]default_query      I guess, this is the error that blocks the RSS feed from working in a correct way. It seems as if the W3Cache Plugin is causing this issue. I have already deleted the whole plugin and reinstalled it from scratch. This did not solve the issue. I am using this plugin on other sites with the same configuration without having any problems. I guess, the database needs to be repaired somehow. Unfortunately, as I am not a programmer, I do not have an idea of where to start or which db tables could be involved. Does somebody of you have a clue? What could be a potential source of this issue? Thanks a lot for your feedback!


Set featured image from external URL

I have been searching high and low for a work-around to set a featured image from an external URL. I understand by default the image must be on my server to get re-sized and displayed. Essentially I have a dozen live web cams that take pictures every 30 minutes, and I need to be able to set up a _wall_ of good sized thumbs like this so all images can be scanned on one page. Please let me know if you can provide a quick snippet that can help.


There's a way to scale media (images) at 50%?

I wonder if there is a way to scale down uploaded media exactly to 50%. From what I see, with `add_image_size` you can only specify a width and a height in pixel. The idea is to upload high resolution images for Retina displays and then let Wordpress generate a custom image size scaled down for standard displays. The best would be apply this to both the original image as well as all the others custom thumbnail generated. Thanks for the help.


Display future posts?

Is there a way to display posts, scheduled for the future? I want to use the published data as an event date and time, which is obviously in the future. I still would like to use these posts for a loop, and for single pages.


Hide wordpress plugins from list

I am using a couple of wordpress plugins for my theme, enabling them programmatically. I would not want the user of my theme to be bugged with plugin updates for these plugins, as well as viewing them in the wordpress admin panel plugins lists. Is there a way to exclude these plugins from automatic version checker and the plugins list ?


change the year on all of my custom post types?

I need to change the published year on all of a custom post type from 2010, to 2011. What is the quickest way to do it? I have 200 entries, so manual would take hours!!


User Login System with File Delivery?

I'm wondering if it's possible through a plugin, or otherwise, to allow people to register on my WordPress site for an account. And then through my control panel, I can manage their accounts. Here's a little backstory of what I'm trying to accomplish. My client runs a dance competition. They would like to be able to upload audio critiques, videos and media. And they'd like to be able to deliver that content just to specific accounts. For instance, a mother goes to the site and registers an account. She logs in and is able to get media related to her son or daughter from a control panel that my client uploaded specifically for them. Is this within the realm of possibility in WordPress? Does a solution already exist? And if not, if anyone could suggest a workaround that would be great. Any help would be greatly appreciated. Thanks!


How do I edit a plugin's core properly?

I'm a WP beginner. So I'm using a plugin called breadcrumb-trail. I'm about to upgrade it, but I noticed that I had tweaked `/breadcrumb-trail/breadcrumb-trail.php` a little bit in the past. How would I extract these changes to another file so that they won't be deleted when I upgrade breadcrumb-trail? here's an example of one of my changes (I commented out the 2nd line of the array): before:                   $defaults = array(             'separator' => '»',             /*'before' => '' . __( 'Browse:', $textdomain ) . '',*/             'after' => false,             'front_page' => true,             'show_home' => __( 'Home', $textdomain ),             'echo' => true         );      after:                   $defaults = array(             'separator' => '/',             'before' => '' . __( 'Browse:', $textdomain ) . '',             'after' => false,             'front_page' => true,             'show_home' => __( 'Home', $textdomain ),             'echo' => true         );      I'm asking more for general practices when editing a plugin's core. I have other plugins that I have modified.


Is there a author_update action?

Is there an action you can tie into whenever an authors information is updated. (ie they update their display name). If not is there any way to tie into this?


Better solution for managing media attachments with `wp_editor()`?

Currently using `wp_editor();` on the front-end of my website as a content submission form. All posts submitted are set as a "Pending", which will later be published or deleted by an administrator. The "Add Media" button has been allowed in the `wp_editor();` call. Users are required to be registered and logged in with a user role of "author". Authors are allowed to manage their own posts. However, when clicking the "Add Media" button as an author user, all uploads fail. Due to the fact that anything uploaded via `wp_editor();` is adding the attachments to that page. Which would require the user to have the following capabilities: `edit_pages`, `edit_published_pages`, and `edit_others_pages`, but as you know... the default capabilities for an "Author" user doesn't have these capabilities, which in-turn, causes the upload to fail. **My work around solution:**               public function modify_author_role(){         if(is_page('submit-content')){             $role = get_role('author');             $role->remove_cap('read');             $role->add_cap('edit_pages');             $role->add_cap('edit_published_pages');             $role->add_cap('edit_others_pages');         } else{             $role = get_role('author');             $role->add_cap('read');             $role->remove_cap('edit_pages');             $role->remove_cap('edit_published_pages');             $role->remove_cap('edit_others_pages');         }     }     add_action('template_redirect', array($this, 'modify_author_role'));      So when the Author user is logged in, and viewing the content submission page, they are temporarily granted the capabilities: `edit_pages`, `edit_published_pages`, and `edit_others_pages`, while removing the capability: `read` (denying access to the dashboard -- if attempted to access while on the content submission page) If the author user is on any other page of the website, or directly accesses the dashboard, they will have normal access, and normal author capabilities. So the author user is only temporarily granted higher privileges while submitting content on the front-end of the website. I just feel like this is a huge security risk. There's GOT to be a more elegant solution than this. Is there some way that I can tell the uploads made via `wp_editor();` on the content submission page to just allow the author user to upload the file and not attach it to the content submission page (remaining unattached)?


Internal Linking Plugin or code

IS there a plugin or code that I could do the following   1. Choose a term, lets say Apple Ipad   2. Then that Apple Ipad term would automatically link to a post that also has those terms   3. The ability to pick terms and posts it links too be cool such thing out there?


How to build custom WP admin with custom URLs

I would like to create a custom WP admin area, that uses custom URLs to navigate thought it and have a custom generated HTML. A member will be able to login via a custom URL, for example: mysite.com/dashaboard or my.mysite.com When logged in a member will be able to see custom admin area where she/he can create pages, view/edit profile and so forth. I know this is doable in WP. However, I can't find anything that would explain the whole process well and take me through the steps in more detail. Currently, I don't know at all how to start tackling this. What's the best URL structure as a subdomain or not? What other considerations should be thought about? How to seamlessly integrate login/logout/password reminder WP functionality? How to integrate WP page and post creation (I'm guessing via URL masking)? I know this is a massive task. I would hugely appreciate if someone could explain a general picture of how to achieve this and what should be considered and help me to go through it step by step. Maybe someon can give me some pointers/links to research first, then I will get back to for help for the next step and so on. This might be a massive task for the stackexchange, perhaps someone will consider becoming my programming mentor and we can communicate via email/skype. I really much want to learn this. Please help me :) I'm ready to invest time into research and learning, but I need guidelines and mentoring. What do you guys think? Any ideas and pointers are much appreciated. Thank you, Dasha


Help Structuring Query for Archive Pages

I'm building a site with several different post types (blog posts, products, informational articles, etc.). On archive type pages (search results, tag pages, etc.), I want to display content from the different post types in visually distinct sections. Then, the user could either select the specific page we he wants, or click a link to see all of the results from a specific post type. How should I go about structuring my Loop? Should I use multiple `WP_Query` objects (one for each post type), or grab everything with one query and then separate it out with PHP? I can think of a couple ways to make this work, but I'm not sure what the best practice for performance and future proofing my code would be. Thanks. **Update:**   I wound up using Alex Lane's advise, and running multiple queries. I'm circumventing the main query for these archive pages (there's no need for it) by using the technique described on the wp-hackers list, and then I'm looping through all relevant post types and running a new `WP_Query` for each of them. It gets the job done, but it feels pretty kludgy and inelegant to me. **Update 2:**   As I think about this more, I'm wondering if it might be faster to just grab all of the posts, and then separate them into post type categories with PHP. I'm not an expert on database performance, though, so I don't know. I'm just imagining having to run a somewhat complicated search query 5-6 times (several of which will likely get no results) before the page loads. That seems really slow to me. On the other hand, pulling a massive data set from the database after just one query might be even slower. I guess the only way to know for sure would be to benchmark it, but I'm only one person, and I can't really afford the time to build and test both systems. Are there any MySQL performance experts out there that have any thoughts on this?