WordPress.org

Forums

[resolved] WPFolio styling Home page (11 posts)

  1. jeremycherfas
    Member
    Posted 5 years ago #

    Trying to style the static front page in WPFolio theme, I can see that there is a style defined for images on the home page, like this:

    div.Home p img {
    	border : 1px solid #c0c0c0;
    	padding:  5px;
    	}

    But I cannot see the div being called anywhere on the home page. That makes it hard to style!

    I don't see any options in WPFolio to determine that I am using a static home page. The site gives instructions for using a static front page, but says nothing about any options either.

    Anyone out there know what to do?

    Jeremy

  2. esmi
    Forum Moderator
    Posted 5 years ago #

    A link to your site would help.

  3. jeremycherfas
    Member
    Posted 5 years ago #

    Sorry esmi, but at the moment it is password protected because it isn't ready for public consumption. Are there some other diagnostics I could give you that might help?

  4. patrickcarey
    Member
    Posted 5 years ago #

    You have to select a specific page to set as the home page.
    In the WordPress dashboard under Settings -> Reading there is the option to set a static page as the the home page.

    Create a page named home and set that as the home page. Then add images or style that page.

    Thanks for using the theme.

  5. jeremycherfas
    Member
    Posted 5 years ago #

    Thanks Patrick. I had indeed selected a specific page, following the instructions on the WPFolio wiki. That is how I knew that there was no div class of Home being called on the home page.

    Does the page literally need to be called "home" all in lower case?

    I love the theme, and want to get it just so!

    Jeremy

  6. jeremycherfas
    Member
    Posted 5 years ago #

    I think I have solved the problem. In the original pages.php of WPFolio, this section seems to have been intended to insert a div class="Home" on a static home page, if there is one.

    <div class="pages">
    <div class="<?php wp_title('',true,''); ?>">

    It did not work.

    I replaced it with a conditional, like this

    <div class="pages"> 
    
    <?php if (is_page('home')) {
    
    	echo '<div class="';
    	echo the_title('','');
    	echo '">'; } 
    
    	else if (is_page("")) {
    	echo ''; }
    ?>

    Now it seems to work fine. If the page is the home page, it adds an extra division. If the page is not the home page, it does nothing.

    Someone better at PHP than me could probably clean it up further, but as I say, it works for me.

    And yes, the static home page, if you want one, needs to be called Home for this to work. But of course you could call it anything, as long as your CSS reflected that.

    Jeremy

  7. slambert
    Member
    Posted 5 years ago #

    Jeremy,

    Looks like a smart change. Coincidentally we added the code to github last night so if you want to add your changes and make more, we can work together and roll them into a future version.

    here's the link:
    http://github.com/slambert/WPFolio/tree/master

  8. jeremycherfas
    Member
    Posted 5 years ago #

    Thanks Steve. I'm not really that much of a coder to be joining github. Feel free to use the change, if it helps. It could also be modified to output a DIV specific to every page, which some people might like.

    On other sites I use a theme called Thesis, which has a very well developed approach to custom styles, keeping them separate in a Custom folder. That could be a good way to go.

    I'll see how other projects work out and then maybe try and do something similar with WPFolio.

  9. slambert
    Member
    Posted 5 years ago #

    Ah but you've already proved otherwise! Github just makes it easier to track changes everyone is making. And you are making good changes!

    I'm not really a coder either,

    SL

  10. jeremycherfas
    Member
    Posted 5 years ago #

    Thanks again Steve. Having taken a look at the complexities of Thesis -- which is absolutely brilliantly built -- I'm going to pass.

    I just do not have the time to delve that deeply into theme building. I've got what I need, and I hope I've improved things a little for other users of WPFolio. I'll be sure to add the site to the WPFolio list when it goes live.

  11. slambert
    Member
    Posted 5 years ago #

    fair enough! If you make any other smart changes be sure to let us know!

Topic Closed

This topic has been closed to new replies.

About this Topic