Community Forums › Forums › Archived Forums › Design Tips and Tricks › Styling blog pages
Tagged: Altitude Pro, styling
- This topic has 3 replies, 3 voices, and was last updated 10 years, 7 months ago by
pgleave.
-
AuthorPosts
-
June 12, 2015 at 9:51 pm #156050
ghog
MemberI would like to create a global style for my blog pages but I'm not sure how to achieve this. all I really want to do is ad a header image that will appear on all blog pages. So I started by defining the blog page in settings and then thought I would be able to style the blog page with visual composer but once I assign the blog page in settings the editor in the page settings goes missing.
Can anyone please help me with this? I am using Altitude Pro.
Thanks
http://thistrackisdope.com/chameleon-manipulations-vol-1/June 21, 2015 at 5:49 am #156977ghog
Memberanyone able to help me with this please?
June 21, 2015 at 10:08 pm #157094Christoph
MemberHi,
do you want the header image to appear on the blog page and single posts only or on the whole website?
June 22, 2015 at 12:44 am #157109pgleave
MemberIf it's what I think (header to appear on blog page and single post page only), you can create template files for each in the theme, and add a widget to those templates to hook into the header so that it appears on those pages only (globally).
If you try this - make sure to back up your theme / site first - this works but comes with no guarantee.
Eg: This is how you can do this on the single post view:
1. Add the widget to the theme functions.php (these are at the end), and add this straight after the //* Register widget areas comment:
genesis_register_sidebar( array(
'id' => 'blog-widget',
'name' => __( 'Blog Widget', 'altitude' ),
'description' => __( 'This is a widget to appear on blog pages.', 'altitude' ),
) );If you go to appearance -> widgets you'll have a new widget called blog widget. You can add the image to that.
2. Now you need to call up that widget to the single post template and hook into Genesis for display.
Theme doesn't have one, as it uses the one from Genesis - so you need to create it. Create a file called single.php.
Add this code:
<?php
/**
* This file adds a single post template to the Altitude Pro Theme.
*
*/add_action( 'genesis_before_content_sidebar_wrap', 'ttid_blog_widget', 5);
function ttid_blog_widget() {
genesis_widget_area( 'blog-widget', array(
'before' => '<div class="blog-widget">',
'after' => '</div>',
) );}
//* Run the Genesis loop
genesis();You then have a widget that appears globally on single post pages of your site - you can style it with css.
NB; The function above has to be unique but can have any name. I chose 'ttid_blog_widget' (ttid prefix to stand for This Track Is Dope). It just needs to have a unique name.
I love to design
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.