Forums

  • # March 18, 2013 at 11:02 am

    working with a theme that shows homepage blog post on the homepage towards the bottom just above the signup for newsletter section.
    http://inkthemes.com/wptheme/blackbird-interior/

    The homepage section shows everything from the blog, I need to be sure passworded posts do not show at all. The theme options panel only has off or on for that section.
    Solution options are to show only a certain category like Featured-News, or to add something to exclude the passworded posts.
    Right now a password posts appears with the text asking for the password.

    Thanks for any suggestions guidance and/or code suggestions.


    < ?php
    $home_page_blog = inkthemes_get_option(‘inkthemes_home_blog_option’);
    $home_page_blog_on = “on”;
    if ($home_page_blog === $home_page_blog_on) {
    ?>

    < ?php if ( inkthemes_get_option('inkthemes_blog_heading') !='' ) { ?>

    < ?php echo stripslashes(inkthemes_get_option('inkthemes_blog_heading')); ?>

    < ?php } else { ?>

    NEWS IN BLOG

    < ?php } ?>
    < ?php
    $args = array(
    ‘post_status’ => ‘publish’,
    ‘posts_per_page’ => -1,
    ‘caller_get_posts’ => 1,
    ‘order’ => ‘DESC’
    );
    $query = new WP_Query($args);
    $count=0;
    ?>
    < ?php while ($query->have_posts()) : $query->the_post(); ?>
    < ?php
    $content = $post->post_content;
    $searchimages = ‘~]* />~’;
    /*Run preg_match_all to grab all the images and save the results in $pics*/
    preg_match_all( $searchimages, $content, $pics );
    // Check to see if we have at least 1 image
    $iNumberOfPics = count($pics[0]);
    if (($iNumberOfPics > 0) && ($count <5) ){
    $count++;
    ?>

    < ?php
    }
    endwhile;
    ?>
    < ?php
    // Reset Query
    wp_reset_query();
    ?>

    < ?php } else { } ?>

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

icon-anchoricon-closeicon-emailicon-linkicon-logo-staricon-menuicon-nav-guideicon-searchicon-staricon-tag