Forums

How can I have a static HTML front page? (35 posts)

  1. OM2
    Member
    Posted 8 months ago #

    I've developed a website for a client with a theme

    Everything is very nice - except they now want to have a static HTML front page - the WordPress website is just fine

    How do I do this?

    I thought it was simple - just stick a index.html page in the root
    And have all links point to index.php from there

    That doesn't work

    Without moving the whole installation to a sub directory, what are my options?

    Thanks

    Omar

  2. Roy
    Member
    Posted 8 months ago #

    The easiest way is to install WP in a subfolder and make your html page in the root.

    Alternativelly, go to settings->reading and set a static page as index. This static page can even have a template with no sidebars, etc. Have a look at militia.be, a website I made. From the first screen it's all WP.

  3. OM2
    Member
    Posted 8 months ago #

    thanks for the reply
    i should have said, i can't set a specific page as being the front page because the front page has settings that can only be applied if using the front - not sure if that makes sense

    i think i'll have to move to a sub directory
    this may or may not be a pain - because of some of the other plugins used

  4. Roy
    Member
    Posted 8 months ago #

    i can't set a specific page as being the front page because the front page has settings that can only be applied if using the front - not sure if that makes sense

    No :-)

    Read the 'moving wordpress' article in docs. Moving can be quite a pain, but it's easy when you do it correctly.

  5. esmi
    Theme Diva & Forum Moderator
    Posted 8 months ago #

    i can't set a specific page as being the front page because the front page has settings that can only be applied if using the front

    How? Perhaps that coding could be changed?

  6. OM2
    Member
    Posted 8 months ago #

    i can't show the website itself as it's under construction - and has lots of dummy data - don't want it getting traffic

    i can show the theme being used though: http://j.mp/oaxks5

    i was thinking: yes it could be changed - but then that might mean a lot of hassle - maybe it would be easier simply to move instead

    let me know what u think

  7. esmi
    Theme Diva & Forum Moderator
    Posted 8 months ago #

    It really depends upon how these settings are being plied to the front page. We'd need to see the relevant code.

  8. OM2
    Member
    Posted 8 months ago #

    i'm happy to give the code - not sure how best to do this - would the contents of index.php be what's required? what other files do u nee to look at?

    let me know

    thanks

  9. Roy
    Member
    Posted 8 months ago #

    From what I see I can't imagine what the problem is making a static website.

    Just make your static page and another page for the blog. One gets a special template (no sidebars or whatever you want), the other the normal template.

    http://codex.wordpress.org/Creating_a_Static_Front_Page

  10. esmi
    Theme Diva & Forum Moderator
    Posted 8 months ago #

    would the contents of index.php be what's required?

    Initially, yes. Drop a copy of the file into the WordPress pastebin and post the pastebin url here.

  11. OM2
    Member
    Posted 8 months ago #

    no, that won't - but let me know if u think i'm wrong

    when people develop themes, they put specific things ONLY for the front page
    like the image slide show and the formatting and layout

    i've got other themes, where u can create the front page by adding components

    this them, i know u can't off the shelf make a duplicate front page elsewhere

    i'll ask the creator though

    creating a blank page would be much easier for me

    thanks

  12. OM2
    Member
    Posted 8 months ago #

    wow!
    pastebin is awesome!

    see the following link: http://pastebin.com/2ZHfYFzp
    let me know what u think

    thanks - i'm happy to have learnt about pastebin :)

  13. esmi
    Theme Diva & Forum Moderator
    Posted 8 months ago #

    The only thing that seems to set this page up for special content is the $postIndex = true; statement,. In theory, you could copy the code from this template file and turn it into a custom static page template. Or try just copying it and calling the new copy front-page.php - a reserved file name for a template that is applied to a static front page only.

  14. OM2
    Member
    Posted 8 months ago #

    awesome :)
    thanks for that
    i'm going to give that a go
    i'll let u know if i have any success

  15. OM2
    Member
    Posted 8 months ago #

    ok, tried that - nearly working - not quite

    everything shows - apart from the main slide show

    any ideas?

  16. esmi
    Theme Diva & Forum Moderator
    Posted 8 months ago #

    Do we know which part of the code generates the main slide show? It's difficult to tell from the code when you haven't seen the site.

  17. OM2
    Member
    Posted 8 months ago #

    i'd be happy to pm u the address

    i've been through the code and can't see clearly where the call is made to get the slideshow - it's definitely not the index page

    in the end html code, the slide show is called above <div id="Showcase">

    it must get called here in the code somewhere i assume:

    $postIndex = true; // special case variable for index paging bug		  
    
    		  // setup the showcase
    		  if (get_theme_var('showcaseColumns') !== '' && get_theme_var('showcaseColumns') !== 'off') {
    
    			// get default settings
    			parse_str(get_theme_var('showcaseColumns', 'showcase_left=true&showcase_right=true'), $showcaseAreas);
    			$showcaseColumns = count($showcaseAreas);
    			$showcaseClass1 = "two-thirds";
    
    			// update 1st column class
    			if ($showcaseColumns == 3) {
    				$showcaseClass1 = "one-third";
    			} elseif ($showcaseColumns == 1) {
    				$showcaseClass1 = "full-page";
    			}
    			?>

    so, i guess it get's called here: parse_str(get_theme_var('showcaseColumns', 'showcase_left=true&showcase_right=true'), $showcaseAreas);

    ??

    let me know what u think

    thanks

  18. esmi
    Theme Diva & Forum Moderator
    Posted 8 months ago #

    in the end html code, the slide show is called above <div id="Showcase">

    Got it. Line 23 of the pastebin code. So - yes - everything from Line 6 to Line 20 seems to be part of the slide show set up but there's noting in that block of code (or the section below) that makes it conditional to the front (main posts) page or any specific template. The showcase itself is being populated via a widget, yes? If so, is this a custom theme widget?

  19. OM2
    Member
    Posted 8 months ago #

    showcase isn't populated via a widget - it's part of the theme - for which u add slides for the images

    the <div id="Showcase"> part isn't where you have the slideshow

    in the html code of the website this is contained in <div id="Slideshow">

    i sent u an email directly giving the website

    let me know what u think

    thanks

  20. esmi
    Theme Diva & Forum Moderator
    Posted 8 months ago #

    Got to go out for an hour or so but before I do... look at line 35. It's a call to a dynamic sidebar called "Home - Showcase Middle".

  21. OM2
    Member
    Posted 8 months ago #

    thanks for the reply. the "Home - Showcase Middle" simply refers to a column below the main slideshow

  22. OM2
    Member
    Posted 8 months ago #

    i just noticed something in the code
    lines 6 - 20: the comment refers to the setup of the 'showcase'
    therefore i would assume that the slideshow is not setup here

    that only leaves get_header()
    question: what's the best way of checking if something is a wordpress function or not?
    i assume in this case get_header() is defined by the theme developer

    EDIT: i just looked it up get_header() is a wordpress function - calls the themes header.php file
    thanks

  23. OM2
    Member
    Posted 8 months ago #

    ok, i think i found the answer
    in header.php for the theme they have:

    if (theme_var('slideShowDisabled', 'return') != true && is_home()) {

    so, i guess it's the is_home() that's causing me my problem

    QUESTION: how would i best add an additional check to see if is_home or my new template page?

    1. maybe i can set a variable in the new template page?
    2. or should i check if that specific file is being called?

    the first way seems to be too much of a hack to me and not an optimal way of doing it
    AND i'd rather not change header.php if at all possible - if the them is updated, then it might affect things

    let me know what u think

    thanks

  24. esmi
    Theme Diva & Forum Moderator
    Posted 8 months ago #

    Try:

    if (theme_var('slideShowDisabled', 'return') != true && (is_home() || is_front_page()) {

  25. OM2
    Member
    Posted 8 months ago #

    the definition says "This Conditional Tag checks if the main page is a posts or a Page."

    i don't want the slide show showing if we have any ordinary page - it should ONLY show when we have the specific template page that we setup

    in any case: i tried that - didn't work :(

    i actually tried my hack solution suggested - that didn't work either

    i have:

    <?php $is_homepage_file = true; ?>
    
    <?php get_header(); ?>

    and in header.php i have:

    if (theme_var('slideShowDisabled', 'return') != true && (is_home() || $is_homepage_file))

    unfortunately the scope of $is_homepage_file isn't seen

    why is this?

    i suppose i could fix by making a global variable
    but then i have to go to the trouble setting the variable to be false - else it may be true for other pages as well?

    any help would be great
    thanks

  26. esmi
    Theme Diva & Forum Moderator
    Posted 8 months ago #

    You can't just add a $homepage conditional. If you only want the slide show to appear on a static front page, use:

    if (theme_var('slideShowDisabled', 'return') != true && ( is_front_page()) {

  27. OM2
    Member
    Posted 8 months ago #

    the is_front_page() check didn't work - just tried again, i tried echoing the value of is_front_page() and it gives nothing

    any other suggestions?

  28. esmi
    Theme Diva & Forum Moderator
    Posted 8 months ago #

    This is a static front page, yes? What's the name of the file?

  29. OM2
    Member
    Posted 8 months ago #

    erm... yes it is
    it wasnt before - but i've now made it be a static page
    the page is called 'z-test-page'
    you'll see if you go tot the page
    i'm echoing the value of is_front_page() - it's giving a value of 1so, i think there must be another check for is_home() somewhere

    header.php can be seen here:

    http://pastebin.com/0PHBRFqh

  30. OM2
    Member
    Posted 8 months ago #

    edit: i think i've got it working now
    there was somewhere else i missed :)

Reply »

You must log in to post.

About this Topic

Tags

No tags yet.