Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

quietthunderdesigns on "Adding additional category option for posts on homepage"

$
0
0

I'm working with a theme that allows for only two types of posts to be displayed on the frontpage - fresh (newest) and hot (most liked). I'd like to add another category specifically for homepage posting called "homepage".

In the front-page.php, I found these instances of fresh and hot:

<?php
                    /* if hot or new  */
                    if( isset( $_GET[ 'fp_type' ] ) ){
                        switch( $_GET[ 'fp_type' ] ){
                            case 'hot' : {
                                post::hot_posts();
                                break;
                            }
                            case 'news' : {
                                post::new_posts();
                                break;
                            }

                            default : {

                                if(is_user_logged_in() ){
                                    if( $_GET['fp_type'] == 'like' ){
                                        post::like();
                                        break;
                                    }
                                }
                                if( options::get_value( 'front_page' , 'type' ) == 'hot_posts' ){
                                    post::hot_posts();
                                }
                                if( options::get_value( 'front_page' , 'type' ) == 'new_posts' ){
                                    post::new_posts();
                                }
                                if( options::get_value( 'front_page' , 'type' ) == 'new_hot_posts' ){
                                    post::new_hot_posts();
                                }
                                break;
                            }
                        }
                    }else{
                        /* if not set params for hot or new */
                        if( options::get_value( 'front_page' , 'type' ) != 'page' ){
                            if( options::get_value( 'front_page' , 'type' ) == 'hot_posts' ){
                                post::hot_posts( false );
                            }
                            if( options::get_value( 'front_page' , 'type' ) == 'new_posts' ){
                                post::new_posts( false );
                            }
                            if( options::get_value( 'front_page' , 'type' ) == 'new_hot_posts' ){
                                post::new_hot_posts( false );
                            }
                            $post_id = 0;

Can I just add in extra lines replacing hot_posts with homepage_posts?

I'm new to php so any help is much appreciated - thanks!


Viewing all articles
Browse latest Browse all 8245

Trending Articles