• Resolved egable

    (@egable)


    I’m trying to put together a Web site for a college newspaper, and I’m having trouble making the homepage do anything other than just display all the latest posts, regardless of category, in chronological order.

    I’ve already tried things like excluding categories from the front page; this caused problems with the category posts plugin, which I’m also using, and a few other issues.

    I finally ended up creating a category titled “Top Stories,” figuring that I could just make the front page redirect to “/category/top-stories” — but apparently I can’t. The only options available are “show static page” and “show most recent posts,” and I don’t want to do either. I tried downloading the Redirection plugin, creating a new page, setting that page to be a static front page, and then adding a redirect from that page to “/category/top-stories” in Settings –> Reading, but that doesn’t work.

    Is there any plugin that will allow me to set a specific URL as the front page? It’s so easy in Drupal that it seems weird that WordPress wouldn’t allow a way to do this.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Is there any plugin that will allow me to set a specific URL as the front page?

    Not that I know of. But you could edit your theme’s index.php file to only display posts from a single category:

    <?php if (is_home() || is_front_page() ) query_posts("cat=-3");?>

    http://codex.wordpress.org/Template_Tags/query_posts

    Thread Starter egable

    (@egable)

    That did it … thanks!

    (Note to anyone trying to duplicate: Looks like to include a specific category rather than exclude, you remove the minus sign.)

    I added the code between

    <?php
    	if(!stristr($_SERVER['REQUEST_URI'],'/page/')) {
    		if(get_option('uwc_latest_story') == "on") { echo '<h5>Latest Story</h5>'; }

    and

    if(get_option('uwc_post_layout') == 1) { include (TEMPLATEPATH.'/layout/option1.php'); }
    		if(get_option('uwc_post_layout') == 2) { include (TEMPLATEPATH.'/layout/option2.php'); }
    		if(get_option('uwc_post_layout') == 3) { include (TEMPLATEPATH.'/layout/option3.php'); }
    		if(get_option('uwc_post_layout') == 4) { include (TEMPLATEPATH.'/layout/option4.php'); }
    	} else {
    		include (TEMPLATEPATH.'/layout/default.php');
    	}
        ?>

    … of course, that might be theme-specific. (I’m using Magazine Basic.)

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Can I make my homepage redirect to a specific category?’ is closed to new replies.