Title: jacksometer's Replies | WordPress.org

---

# jacksometer

  [  ](https://wordpress.org/support/users/jacksometer/)

 *   [Profile](https://wordpress.org/support/users/jacksometer/)
 *   [Topics Started](https://wordpress.org/support/users/jacksometer/topics/)
 *   [Replies Created](https://wordpress.org/support/users/jacksometer/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/jacksometer/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/jacksometer/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/jacksometer/engagements/)
 *   [Favorites](https://wordpress.org/support/users/jacksometer/favorites/)

 Search replies:

## Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[W3 Total Cache] [Plugin: W3 Total Cache] alert to change .htaccess AFTER the code has been added](https://wordpress.org/support/topic/plugin-w3-total-cache-alert-to-change-htaccess-after-the-code-has-been-added/)
 *  [jacksometer](https://wordpress.org/support/users/jacksometer/)
 * (@jacksometer)
 * [14 years ago](https://wordpress.org/support/topic/plugin-w3-total-cache-alert-to-change-htaccess-after-the-code-has-been-added/#post-2194028)
 * I have the exact same problem. I did the install as described on the plugin page(
   changin chmod for /wp-content and /wp-content/upload to 777 before install), 
   gave chmod 777 to .htaccess and even changed manually the code in the .htaccess
   file when the auto-change didn’t work but nothing worked: I’m still getting the
   warnings on the performance page in the admin.
 * It should be noted I had WP Super Cache installed before that, which I uninstalled
   before trying to install W3TC. I’m also in the same situation as squidz, i.e.
   using the ip address rather than the domain as the new install is a relaunch 
   and the website is not ready to go live yet.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Display custom field value in sidebar](https://wordpress.org/support/topic/display-custom-field-value-in-sidebar/)
 *  Thread Starter [jacksometer](https://wordpress.org/support/users/jacksometer/)
 * (@jacksometer)
 * [14 years ago](https://wordpress.org/support/topic/display-custom-field-value-in-sidebar/#post-2690677)
 * Gah, I was being so stupid…
 * This finally worked, like so:
 *     ```
       <?php
       global $wp_query;
       $current_id = $wp_query->get_queried_object_id();
   
           $my_query = new WP_Query( array(
               'post_type'=>'portfolio',
               'posts_per_page'=>'5',
               'post__not_in' => array($current_id),
               ));
   
               if( $my_query->have_posts() ) {
               while ($my_query->have_posts()) : $my_query->the_post();
   
       $image = get_post_meta($post->ID, 'tz_portfolio_thumb', true);
       ?>
               <a href="<?php the_permalink() ?>" title="Project for <?php the_title(); ?>">
                   <img src="<?php echo $image; ?>" alt="Project for <?php the_title(); ?>" />
               </a>
   
       <?php
       endwhile;
       }
   
       wp_reset_query();
       ?>
       ```
   
 * Now, how do I turn this into a condition for sidebar.php ?
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Display custom field value in sidebar](https://wordpress.org/support/topic/display-custom-field-value-in-sidebar/)
 *  Thread Starter [jacksometer](https://wordpress.org/support/users/jacksometer/)
 * (@jacksometer)
 * [14 years ago](https://wordpress.org/support/topic/display-custom-field-value-in-sidebar/#post-2690674)
 * Managed to exclude displaying the current post custom field value by changing
   the first part to this:
 *     ```
       global $wp_query;
       $current_id = $wp_query->get_queried_object_id();
   
           $my_query = new WP_Query( array(
               'post_type'=>'portfolio',
               'posts_per_page'=>'5',
               'post__not_in' => array($current_id),
               ));
   
               if( $my_query->have_posts() ) {
               while ($my_query->have_posts()) : $my_query->the_post();
   
           $thumbnail = get_posts( array('post_type' => 'portfolio','numberposts' => 5,'meta_key' => 'tz_portfolio_thumb', 'post__not_in' => array($current_id)) );
       ```
   
 * Still not displaying the actual thumbnails though, just the alt text. Irritating!
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Display custom field value in sidebar](https://wordpress.org/support/topic/display-custom-field-value-in-sidebar/)
 *  Thread Starter [jacksometer](https://wordpress.org/support/users/jacksometer/)
 * (@jacksometer)
 * [14 years ago](https://wordpress.org/support/topic/display-custom-field-value-in-sidebar/#post-2690622)
 * A bump with the next step I’ve been able to take so far. Problem is, it only 
   displays the alt text instead of the actual thumbnails, and I don’t get why!
 *     ```
       <!--BEGIN #sidebar .aside-->
       <div id="sidebar" class="aside">
   
       <?php
           $my_query = new WP_Query('showposts=5&orderby=post_date&order=desc&post_type=portfolio');
               if( $my_query->have_posts() ) {
               while ($my_query->have_posts()) : $my_query->the_post();
       ?>
   
       <?php
           $thumbnail = get_posts( array(
               'post_type' => 'portfolio',
               'numberposts' => 5,
               'key' => 'tz_portfolio_thumb'
           ) );
   
           if($thumbnail) : ?>
               <a href="<?php the_permalink() ?>" title="Project for <?php the_title(); ?>"><img src="<?php echo $thumbnail; ?>" alt="Project for <?php the_title(); ?>" /></a>
           <?php endif; ?>
   
       <?php
       endwhile;
       }
   
       wp_reset_query();
       ?>
       <!--END #sidebar .aside-->
       </div>
       ```
   

Viewing 4 replies - 1 through 4 (of 4 total)