Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

customizing header #163

Closed
randomfreeform opened this issue Dec 11, 2014 · 7 comments
Closed

customizing header #163

randomfreeform opened this issue Dec 11, 2014 · 7 comments

Comments

@randomfreeform
Copy link

Where is it best to modify the header?

I'd like my header to have:
a bg image (and ideally assign a different image per page!),
a few items like share icons and a search field at the top,
and the nav.top-bar menu at the bottom.

I poked around the header.php file..
not sure if with this theme I should consider modifying things there..
or simply add everything to my actual page body.

Btw, is there a forum somewhere for this theme to ask newby mod questions?
Thanks for any tips!!!

@braginteractive
Copy link

The best route would be to create a child theme for your changes. In this child theme, you can target the header and set a background image.

Within this child theme you can also duplicate the header.php file and make any customization your would like.

@olefredrik
Copy link
Owner

I am amazed how many people go wrong with child-themes. This theme is basically intended as a platform to build on, as a skeleton that can be adapted to any requirement. The best way to build on (in my opinion), is to use the power of Foundation, SASS and Grunt.

The Foundation Forum is a good place for general questions about the use of Foundation. At the forum you will also find a separate thread about FoundationPress

Good luck! :)

@Aetles
Copy link
Contributor

Aetles commented Dec 12, 2014

Yeah, as I remember it the initial description for this theme said that it was not meant to be used as a parent theme but instead to be the starting point for further modifications (just like the popular Underscores theme).

@randomfreeform
Copy link
Author

Thanks for replies! Yeaaaa.. I didn't think a (dreaded) child theme was the way to go here..

So I'm fine addressing my needs using F & Sass but still wonder where in this WordPress theme I should do it? In the Header.php, or via sass to the header, or make new page templates (1 per header image) or more extremely simply skip the header and put it all in the body including a nav.top-bar.
THANKS for any details!
R

@braginteractive
Copy link

Oh, I didnt realize using child themes were so frowned upon with FoundationPress. Using child themes is one of the first questions I normally get on themes I have released. People want to keep their theme updated and in this case I can see people wanting the latest Foundation goodies as they are released. If its meant to be a starter theme, then all is well.

@randomfreeform you could target a body class for each page to set a different. So an example might be..

.body-class-page1{
    .header-whatever-background{
        background: ...
    }
}

.body-class-page2{
    .header-whatever-background{
        background: ...
    }
}

Another option I have seen in the past is to use the featured image section on each page. Upload the image into the featured image and then in the page.php template write a statement to display the image. Something like:

  <?php $background = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); ?>
    <div class="header-class" style="background-image: url('<?php echo $background[0]; ?>');">

As for adding things to the top bar.. Depending on where you will probably want to add the markup to /parts/top-bar.php

For the "nav.top-bar menu at the bottom" you will probably just need to add whatever you are looking to do to the footer.php

@randomfreeform
Copy link
Author

Thanks Brad! Hope we weren't being too snotty.

Ha... your css code suggestion to add 'header images PER page' is exactly what I did last night, I thought I was being bad... good to know that it's 1 way to approach this!

I guess the other need to add items above the menu can simply be added to the headers.php file since they're on every page.

Thanks all for the prompt replies!!! Love the theme!

@Aetles
Copy link
Contributor

Aetles commented Dec 12, 2014

Don't now if it's really frowned upon, it's just that the child theme support was not meant to be from the beginning (if I remember correctly) and support is something that has been slowly added, often by pull requests from others. I've thought of FoundationPress as a theme for web developers since it uses grunt, sass etc that maybe not all WordPress users know how to use.

Also, having a child theme to a parent theme that moves forward fast and changes stuff can sometimes be a lot of work, especially if support for child themes is not a high priority to begin with.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants