WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Disabling right hand columns on front page (9 posts)

  1. denzel2364
    Member
    Posted 4 years ago #

    Hi there,

    Im creating a concept for a client but i need to know a mod.

    Is it possible to turn off the right hand column(s) so that the main body expands 100% only on the front page?

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    Try replacing <?php get_sidebar();?> with <?php if( !is_home() && !is_front_page() ) get_sidebar();?> to drop the sidebar on the front page. Then in header.php, try changing <body> with <body <?php if (function_exists('body_class')) body_class(); ?>>. This will give you access to a whole stack of classes that are automatically applied to the body tag by WP. Full list on:

    http://quirm.net/2009/08/07/changing-headers-with-wordpress-body_class/

    You should be able to use the home class to then re-style the width of your page content area on the home page only using CSS.

  3. denzel2364
    Member
    Posted 4 years ago #

    That sounds interesting and definately a step in the right direction.

    Ill have a look into that.

    Cheers

  4. denzel2364
    Member
    Posted 4 years ago #

    hey there,

    tried it but it hasnt worked. http://www.pebbledesigns.co.uk/blog

  5. esmi
    Forum Moderator
    Posted 4 years ago #

    If you're using a static page as your front page, you'll need to make the changes in page.php - not index.php.

  6. denzel2364
    Member
    Posted 4 years ago #

    doh! editing the wrong file :-)

    Thanks for your help.

    Just would like some advice. Im normally used to Joomla and want a new challenge. The support and FAQ/information is fantastic and wondered if i wanted to start coding for the front page or similar what would i do?

    I require 4 modules each displaying Latest comments, Latest articles etc. Where would i start building that? Does this handle code via the page input wysiwyg?

  7. denzel2364
    Member
    Posted 4 years ago #

    "If you're using a static page as your front page, you'll need to make the changes in page.php - not index.php."

    That was exactly my problem :-) Hadn't realised that

  8. esmi
    Forum Moderator
    Posted 4 years ago #

    I require 4 modules each displaying Latest comments, Latest articles etc. Where would i start building that?

    For a site with a static front page, I'd suggest copying page.php and using the new copy as the framework for a custom page template.

    http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

    Once the new custom template is uploaded, you can assign it to your front page and start work on customising it further without impacting on your underlying pages in any way.

    Does this handle code via the page input wysiwyg?

    That depends upon how you approach it. You could make the new front page template widget-capable:

    http://codex.wordpress.org/Widgetizing_Themes

    You can then use either some of the native widgets in Admin/Appearance/Widgets or some 3rd party widgets to add functionality. But that is only going to give you limited wysiwyg capabilities at best.

    Another approach would be to create child Pages of your front page and then use either get_posts or query_posts to pull the content of those children onto your front page as needed. That would give you full wysiwyg capabilities.

  9. denzel2364
    Member
    Posted 4 years ago #

    thank you kindly for the reply. i have duplicated page.php and now have a nice page to edit for my front end.

    However, the problem is with the following modules:
    Latest articles
    Latest comments
    Popular posts
    and categories.

    I've been researching but still miffed about what code to use to display five titles from each section. More importantly, fix the line length.

    Has anyone got ideas of what WordPress code to use?

Topic Closed

This topic has been closed to new replies.

About this Topic