WordPress.org

Ready to get started?Download WordPress

Forums

Show one category on index.php (49 posts)

  1. LukeCollison
    Member
    Posted 9 years ago #

    line 256?
    hmm,
    where is that in the code?
    do i haev to count the lines?

  2. Mark (podz)
    Support Maven
    Posted 9 years ago #

    Notepad++
    http://notepad-plus.sourceforge.net/

    Less than 1 meg, open source, great windows editor - and it shows line numbers - essential :)

  3. LukeCollison
    Member
    Posted 9 years ago #

    I can't get this sucker to work.

  4. GarrettC
    Member
    Posted 9 years ago #

    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";
    }

  5. GarrettC
    Member
    Posted 9 years ago #

    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";
    }

  6. Bruce21
    Member
    Posted 9 years ago #

    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.

  7. Bruce21
    Member
    Posted 9 years ago #

    I was here:
    http://wordpress.org/support/topic.php?id=3370#post-20268
    it said to go heres:
    http://wiki.wordpress.org/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 http://wiki.wordpress.org/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: http://wordpress.org/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?

  8. Bruce21
    Member
    Posted 9 years ago #

    OK.

    For anyone else in this boat.
    I went back to http://wiki.wordpress.org/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.

  9. Bruce21
    Member
    Posted 9 years ago #

    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!!!!)
    http://wordpress.org/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!

  10. iamarock
    Member
    Posted 9 years ago #

    Is there any way to implement this on WP 1.5?

    Thanks

  11. iamarock
    Member
    Posted 9 years ago #

    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

  12. Kafkaesqui

    Posted 9 years ago #

  13. iamarock
    Member
    Posted 9 years ago #

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

    Thank You very much

  14. sobr
    Member
    Posted 9 years ago #

    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

  15. kinomuto
    Member
    Posted 9 years ago #

    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.

  16. kinomuto
    Member
    Posted 9 years ago #


  17. kinomuto
    Member
    Posted 9 years ago #

    hmm like that - 404's when submitting/editing - leading to multiple posts...

  18. berry24
    Member
    Posted 8 years ago #

  19. Vistronic
    Member
    Posted 7 years ago #

    Follow this link no plugin needed
    insert in index.php of your theme after header call...
    <!-- cat one only home page -->
    <?php query_posts('orderby=title&cat=1');
    ?><!-- post order home page -->

    Displays Cat one only on homepage and sorts by title
    works for me
    lots of options follow this link
    static home page and post static and all the goodies
    this is the page book mark it!

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.