WordPress.org

Ready to get started?Download WordPress

Forums

Adding header via include file to my wordpress home page (7 posts)

  1. Thyde
    Member
    Posted 11 months ago #

    Hey guys this might be a really stupid question, but my whole website uses a header bar and I want to add it to the wordpress page for continuity but as the whole page is /blog I'm not sure what file to add the include line to?

    My website is http://www.alonetogether.co.uk/newindex.php and the wordpress site is http://www.alonetogether.co.uk/blog or you can click the 'Articles' link near the bottom of the page

    This might even be in the wrong topic so sorry if it is!

    Thanks

  2. keesiemeijer
    moderator
    Posted 11 months ago #

    Consider creating a child theme first, instead of editing your theme directly - if you upgrade the theme all your modifications will be lost. Or download one here: http://quirm.net/themes/twenty-twelve-child/

    Copy the header.php file from Twenty Twelve to your child theme and add your header bar HTML there. You probably need to add the style rules for the header bar to your child theme's stylesheet style.css as well.

  3. Thyde
    Member
    Posted 11 months ago #

    Okay thanks :-) I've done that now, but instead of just including the parent style.css I just copied everything below the header. Is that cool?

    Edit: Actually, do you think it'd be a good idea to copy all of the files from the parent folder to the child? There are some things I'd like to change, for example I'd like to rename 'Home' to Articles so it's not confused with the Home in the header bar - but would that be overwritten with an update?

  4. keesiemeijer
    moderator
    Posted 11 months ago #

    I see you've created a child theme but can't see the changes to header.php.

    Is that cool?

    Depends if it need javascript. WordPress has it own ways of adding javascript files.

  5. keesiemeijer
    moderator
    Posted 11 months ago #

    You can create your own navigation menu to remove "home":
    http://codex.wordpress.org/WordPress_Menu_User_Guide

  6. Thyde
    Member
    Posted 11 months ago #

    I've just added the include's into the header.php but nothing's coming up. I have a feeling I've tried to get around all of the nested folders wrong in the include line.
    would <?php include('/header2.php'); ?> look in htdocs? or would I need to use include('../../../../header2.php');

    the path is currently htdocs/blog/wp-content/themes/twentytwelve-child
    I'm a massive newbie when it comes to php :D

    Edit: I think if I could find out how/where the template includes all of the php/css files I could figure out how to change everything, but at the minute it's baffling me haha.

  7. Thyde
    Member
    Posted 11 months ago #

    I've tried adding the line include('/htdocs/header.php'); in the template's header.php and it's not working. I've tried it in page.php and index.php but they don't work either. It's supposed to make a green bar appear at the top of the page like on the rest of the site, it's really frustrating haha

Reply

You must log in to post.

About this Topic