can someone help me with this please....

Discussion in 'jQuery' started by quatto, Jan 12, 2011.

  1. #1
    http://webhostmaven.com

    Here is the code I used and I almost have what I want...but what I need to do is, have a certain category on the front page only and on my "blog" page a different category.

    I was able to get the right post on the front page but it is also showing on the blog page.



    function display_one_featured_on_spanish(){
    if(is_front_page()){
    $godhammer_custom_loop = new WP_Query('posts_per_page=1&category_name=latest news and website tips&offset=0&orderby=date');
    if ( $godhammer_custom_loop->have_posts() ) :
    while ( $godhammer_custom_loop->have_posts() ) : $godhammer_custom_loop->the_post();
    echo '<div class="post type-post hentry post_box top"><div class="headline_area"><h2 class="entry-title"><a href="' . get_permalink() . '">' . get_the_title() . '</a></h2>';
    echo '<p class="headline_meta"><abbr title="" class="published">' . get_the_date() . '</abbr></p></div>';
    echo '<div class="format_text entry-content">' . get_the_content() . '</div></div>';
    endwhile;
    wp_reset_query();
    endif;
    }
    }
    add_action('thesis_hook_after_content', 'display_one_featured_on_spanish');

    function display_teasers_on_spanish(){
    if(is_front_page()){
    $teaser_count = 1;
    $my_query = new WP_Query('posts_per_page=2&category_name=Spanish&o ffset=1&orderby=date');
    while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID;
    if (($teaser_count % 2) == 1) {
    $top = ($post_count == 1) ? ' top' : '';
    $open_box = "\t\t\t<div class=\"teasers_box$top\">\n\n";
    $close_box = '';
    $right = false;
    }
    else {
    $open_box = '';
    $close_box = "\t\t\t</div>\n\n";
    $right = true;
    }
    if ($open_box != '') {
    echo $open_box;
    thesis_hook_before_teasers_box($post_count);
    }
    thesis_teaser($classes, $post_count, $right);
    if ($close_box != '') {
    echo $close_box;
    thesis_hook_after_teasers_box($post_count);
    }
    $teaser_count++;
    endwhile;
    if ((($teaser_count - 1) % 2) == 1){
    echo "\t\t\t</div>\n\n";
    }
    }
    }
    add_action('thesis_hook_after_content', 'display_teasers_on_spanish');
     
    quatto, Jan 12, 2011 IP
  2. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #2
    Completely wrong place
     
    stephan2307, Jan 13, 2011 IP