Forum Replies Created

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

    (@jacksometer)

    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.

    Thread Starter jacksometer

    (@jacksometer)

    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 ?

    Thread Starter jacksometer

    (@jacksometer)

    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!

    Thread Starter jacksometer

    (@jacksometer)

    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)