Strict Standards: Redefining already defined constructor for class bbdb in /home/themes/public_html/forums/bb-includes/db-mysql.php on line 12

Strict Standards: Declaration of BB_Walker_Blank::start_lvl() should be compatible with BB_Walker::start_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_lvl() should be compatible with BB_Walker::end_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::start_el() should be compatible with BB_Walker::start_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_el() should be compatible with BB_Walker::end_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127
Show excerpts of latest posts on front page « ThemeShaper Forums

ThemeShaper Forums » Thematic

[closed]

Show excerpts of latest posts on front page

(4 posts)
  • Started 3 years ago by gino
  • Latest reply from gino
  • This topic is resolved

Tags:

  1. gino
    Member

    Hi everybody

    Is there a way to show a limited number of post excerpt (2 for example) from the latest posts of a specific category onto the front page, just before the footer?

    I have other content on the page which I need to keep and that is why I am having problems.

    Thanks!

    Gino

    Posted 3 years ago #

  2. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512


    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512
    ScottNix

    Member

    // display 2 recent posts from cat=9 (category 9), see link below for full list of parameters.
    // http://codex.wordpress.org/Class_Reference/WP_Query
    function childtheme_recent_posts_query () {
        if ( is_front_page() ) {
            echo '<div class="recent-posts">';
            $my_query = new WP_Query( array( 'cat=9', 'posts_per_page' => 2 , 'ignore_sticky_posts' => 1) );
                echo '<ul class="featured-posts">';
                    while ($my_query->have_posts()) : $my_query->the_post(); ?>
                        <li>
                        <?php
                            $posttitle = '<h3><a href="';
                            $posttitle .= get_permalink();
                            $posttitle .= '" title="';
                            $posttitle .= the_title_attribute('echo=0');
                            $posttitle .= '" rel="bookmark">';
                            $posttitle .= get_the_title();
                            $posttitle .= "</a></h3>\n";
                            echo $posttitle;
    
                            if ( has_post_thumbnail() ) { ?>
                            <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail(); ?></a>
                            <?php }
                            else { ?>
                            <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute('echo=0'); ?>"><img height="120" width="210" src="<?php bloginfo('stylesheet_directory'); ?>/images/testimage.png" /></a>
                            <?php }
    
                            the_excerpt();
    
                            echo '<a href="'. get_permalink() . '">' .__('View &raquo;', 'thematic') . '</a>';
                            ?>
                        </li>
                    <?php
                    endwhile;
                echo '</ul>';
            echo '</div>';
        }
    }
    add_action ('thematic_abovefooter', 'childtheme_recent_posts_query');

    Don't say I never did anything nice for you. Just Kidding. Obviously needs styling and you can heavily modify this however you want, but it should include enough to get you started.

    Posted 3 years ago #

  3. Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512


    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 440

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 510

    Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/themes/public_html/forums/bb-includes/kses.php on line 512
    Jagst3r15

    Member

    ^works well.

    Posted 3 years ago #
  4. gino
    Member

    Hi Scott

    Many thanks for this- I shall remember that!

    Regards,

    Gino

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.


Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method GA_Filter::spool_analytics() should not be called statically in /home/themes/public_html/forums/bb-includes/wp-functions.php on line 586

Strict Standards: Non-static method GA_Filter::spool_this() should not be called statically in /home/themes/public_html/forums/my-plugins/googleanalytics.php on line 183