• I know there’s a plugin “ShowOneCategory” that seems to do what I want, but I can’t get it to work. I think I’ve followed the directions properly. This is the code (+ ‘post paged’ set):
    <?php
    /* Don't remove this line. */
    /* index.php hacks */
    //Set index.php to only show one category on main page
    if ('/' == $_SERVER['REQUEST_URI'] || '/index.php' == $_SERVER['REQUEST_URI'])
    $cat = 1;
    /* --------------- */
    require('./wp-blog-header.php');
    ?>

    Is wrong?
    Is there another way to show just a specified category on my front page? Please help me, I’m really desperate.
    Thanks

Viewing 15 replies - 31 through 45 (of 48 total)
  • Notepad++
    https://notepad-plus.sourceforge.net/

    Less than 1 meg, open source, great windows editor – and it shows line numbers – essential ??

    I can’t get this sucker to work.

    Figured I would share my little coding victory as far as WordPress goes, here.

    I have a blog setup with multiple authors. I have two categories called “Front Page” and “Personal Page”. I wanted users to be able to post on the front page, but also have it so that some posts only appeared on their own pages (index.php?author=x type of links).

    With information gathered from this article and ones related, I cam up with this:

    if (!isset($author)) {
    $cat = “X”;
    } else {
    $cat = “X”;
    }

    Figured I would share my little coding victory as far as WordPress goes, here.

    I have a blog setup with multiple authors. I have two categories called “Front Page” and “Personal Page”. I wanted users to be able to post on the front page, but also have it so that some posts only appeared on their own pages (index.php?author=x type of links).

    With information gathered from this article and ones related, I cam up with this:


    if (!isset($author)) {
    $cat = "X";
    } else {
    $cat = "X";
    }

    OK, tried code here in forum, and kittens. None worked. Is there a code I can use in ver 1.5 to show only one category on main page? Anyplace? One that doesn’t make the main page look like a category page with no links hardly in menu. The code here removed the links and meta from main page.

    I was here:
    https://www.ads-software.com/support/topic.php?id=3370#post-20268
    it said to go heres:
    https://wiki.www.ads-software.com/show-one-category-on-front-page
    So I did and it said:
    To solve this problem, it was suggested that the hack be placed in index.php. This solution remedied the problem nicely and efficiently. Please visit https://wiki.www.ads-software.com/index.php/ShowOneCategory for the updated solution.

    So I went there:
    NOTE: this page is out of date. See this thread for a newer version of this hack: https://www.ads-software.com/support/topic.php?id=10759

    So I came here. I tried what was here.

    I have searched google and here all day. Kittens plugin didn’t work. The code on forums didn’t work. I am using version 1.5. I am willing to pay someone for the code if I have to. I just switched from Movable Type, and am wondering about going back to it. Such a simple little common thing and it is soooo time consuming and frustrating.

    A main page limited to the posts from one category should be as commonplace as blogs are…. Is this possible on WordPress at all??? If so could it please please be made findable?

    OK.

    For anyone else in this boat.
    I went back to https://wiki.www.ads-software.com/show-one-category-on-front-page. I IGNORED the “out of date” stuff.
    I created my-hacks.php and included the code on that page. Uploaded it, enabled myhacks in admin/options/misc…
    I am using a non standard template and stylesheet.

    It works but in my menu I have categories, archives (showing Feb 2005) and nothing else. Grrrrrr also now when I edit the theme and save it, I get a blank page. Deleting myhacks fixes that. Any programmers for hire to do one simple thing? Then I will post the fix on my front page so it can be found by others

    This is nuts
    Oh yes, I must remember to save a shortcut to this page so I can find it again, and check back to see if there are any answers. WP needs an updated forum, like Movable Types.

    Well, I hate all the rantings above, maybe someone can delete them. All day at this was frustrating and that was the result. This place is way too disorganized. I tried 40 different searches here and google, and looked at 4,000 websites (me exagerate? noooo)

    Took six or seven hours to find there is a plugin to do this. (And not out of not searching!!!!)
    https://www.ads-software.com/support/topic.php?id=20047
    Dropped it into plugins, activated it, and it works.

    Note:

    There are quite a few posts around looking for something like this. I know, cause I read them all! Make this easier to find maybe?
    ?? tomorrow a better day for playin with my shiny new wordpress!

    Is there any way to implement this on WP 1.5?

    Thanks

    The “Front Page Categories” plugin don’t seems to work on 1.5, when I activate from panel control, I get this error on top of the page (the control panel page):

    Warning: Cannot modify header information – headers already sent by (output started at /var/www/wordpress/wp-content/plugins/front_page_cats.php:2) in /var/www/wordpress/wp-admin/admin.php on line 6

    Warning: Cannot modify header information – headers already sent by (output started at /var/www/wordpress/wp-content/plugins/front_page_cats.php:2) in /var/www/wordpress/wp-admin/admin.php on line 7

    Warning: Cannot modify header information – headers already sent by (output started at /var/www/wordpress/wp-content/plugins/front_page_cats.php:2) in /var/www/wordpress/wp-admin/admin.php on line 8

    Warning: Cannot modify header information – headers already sent by (output started at /var/www/wordpress/wp-content/plugins/front_page_cats.php:2) in /var/www/wordpress/wp-admin/admin.php on line 9

    It Works!!!!!!!!!!!

    Thank You very much

    So there is only this one solution :

    Editing the index.php file AND OR the wp-blog-header.php. There you CAN exclude categories to be displayed in the home site of your WP Blog.

    There is no way to say :

    Leftbody should display posts from the “news” section.
    and the leftbody (let it be a frame or a div tag or the side menue) should only display posts from category “Film” for instance.

    I’m going on looking for this soution.
    …..

    please report any know solutions for the latest WP 1.5 Version.

    Thank you in advance

    Did you have any luck with this sobr? (if you ever read this?)

    Have to echo Bruce21’s comments on this forum – nice to roll your own and all that but I guess you never foresaw it getting this busy? RSS is cool but sometime an old fashioned email alert works wonders. I always get the feeling (usually after 3-4hrs of searching for something relatively simple) that vbulletin would have halved the support requests here.

Viewing 15 replies - 31 through 45 (of 48 total)
  • The topic ‘Show one category on index.php’ is closed to new replies.