• Resolved jayant26

    (@jayant26)


    Hi all,

    I’m a novice at WordPress, and am trying to create front page with the Supersized plugin where I don’t want to show the body or contents except for the side menu, which I want to get to float at the left end of the screen.

    Been trying to use the conditional tag ‘<?php is_front_page(); ?>’ but don’t really know how to use it and which file to put it in – header or index?

    I’ve created a copy of the home.php and am trying to get the conditional tag to use that. So in theory, if one lands on the home page, one would only see the slide show, logo and the menu on the left for navigation. Once inside, the rest of the template takes over.

    Any help would be greatly appreciated.

    Many thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • <? if (is_front_page()) {?>
    Leave this blank if you want nothing to show
    <? } else { ?>
    put the stuff here to show when it’s not the front page
    <? } ?>

    Thread Starter jayant26

    (@jayant26)

    Thanks for that. Tried to put that in the header.php but get errors and and don’t know which code to put in to keep the logo and side bar.

    Made a copy of the home.php and called it home1.php and used the code above and put this in " title="<?php bloginfo('name') ?>" before the <? } else. It’s incorrect, but how do I ask wordpress to call for the modified home1.php?

    Many thanks<

    in home.php, at the very top

    <? if (is_front_page()) ?>
    include("home1.php");
    <? else { ?>
    the rest of home.php goes here

    then, at the very end of the file:

    <? } ?>

    Thread Starter jayant26

    (@jayant26)

    Hey,

    Thanks so much for your help. I tried that, but can’t get it to work. Did some searching and have used get_template_part function but now it loads up the home1.php and home.php. Don’t think I’m using the ‘else’ function right?

    Anyway, I’ve posted the home page below and your help would be greatly appreciated. Many thanks.

    [Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

    Thread Starter jayant26

    (@jayant26)

    Sorry, it wiped the code off. Didn’t realise there was a maximum number of lines. Here are the first few from what I have added on to the top up until the else function –

    <?php if (is_front_page()) get_template_part('homeo'); ?>
    <? else { ?>
    <?php        
    
    if( ( is_home() || is_front_page() ) && get_option( 'show_on_front' ) == 'posts' ) {
        get_template_part( 'blog', 'home' );
        die;
    }

    [Moderator Note: Please post code or markup snippets between backticks or use the code button.]

    Thread Starter jayant26

    (@jayant26)

    Hi there,

    Thanks for all the help. In case anyone is looking this is what I did eventually –

    Just edited the home.php file as that was set up as a static home page. There were too many calls in that page for if (is_front_page() ) so I had to get rid of all that and stylise the page to what I wanted it.

    I then created a header-home.php file (in essence, a copy of the header.php file and edited that so that if it was the front page everything but the logo didn’t appear.

    The last thing was to call this header in the home page so I used this – get_header('home') ?> in the home.php. So this serves up the header for the home page, and the rest of the pages get served up just the normal header.

    Hope I’m clear and that this helps someone if they are looking to make a site with just a slide show in the front page.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Hide entire content on front page’ is closed to new replies.