Updates from RSS Toggle Comment Threads | Keyboard Shortcuts

  • Cory 2:00 pm on December 19, 2011 Permalink | Reply  

    Remove WordPress featured image from attached images 

    I Recently worked on a project where we setup a custom post type for a client’s portfolio items. The main portfolio page had a grid of the featured images for each project and would allow the user to click through to view the portfolio item. When you landed on the portfolio item, all images that were attached to the post were displayed using the jquery cycle plugin.

    Problem is the featured image is part of these group of images because it is attached.

    Here is how we displayed the images and removed the featured image.

          <?php
              $thumb_ID = get_post_thumbnail_id( $post->ID );
              if ( $images = get_children(array(
                      'post_parent' => get_the_ID(),
                      'post_type' => 'attachment',
                      'post_mime_type' => 'image',
                      'order' => ASC,
                      'orderby' => menu_order,
                      'exclude' => $thumb_ID
                  ))) : ?>
    
                  <?php foreach( $images as $image ) :  ?>
                      <div><?php echo wp_get_attachment_link($image->ID, 'portfolio_image'); ?></div>
                  <?php endforeach; ?>
    
          <?php else: ?>
            Nothing added yet
          <?php endif; ?>
     
  • Cory 3:46 am on December 17, 2011 Permalink | Reply  

    Remove Items from WordPress 3.3 Admin Bar 

    The good people of Automattic recently introduced version 3.3 of WordPress. I have noticed that one of the new features is a new, always present admin bar.

    The admin bar allow you to quickly view your site’s comments and add new posts, pages etc. A lot of the client WordPress sites I build don’t actually make use of the blogging functionality of WordPress. We often use custom post types to display information.

    Here is a way of removing the comment link and + new options.

    Pop this bit of code into your themes functions.php file to remove.

    function remove_admin_bar_links() {
        global $wp_admin_bar;
        $wp_admin_bar->remove_menu('comments');
        $wp_admin_bar->remove_menu('new-content');
    }
    add_action( 'wp_before_admin_bar_render', 'remove_admin_bar_links' );
     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel