Community Forums › Forums › Archived Forums › Design Tips and Tricks › Prose – Static widgetised areas between posts
- This topic has 28 replies, 2 voices, and was last updated 10 years, 9 months ago by rfmeier.
-
AuthorPosts
-
July 2, 2013 at 6:18 am #48808middayminerMember
Hi, this is what my website looks like now: http://www.foundwonders.com
I'd like to have this functionality:
http://i.imgur.com/n1hDoqA.png
I read that google punishes your ranking for short posts so that's what I'll be mostly using those areas for, some arbitary text etc 🙂
July 2, 2013 at 8:59 am #48820rfmeierMemberHello,
I threw together some code that would be pasted within your functions.php file.
You could probably do the same with the Genesis Simple Sidebars plugin mixed with the Genesis Simple Hooks plugin.
Additionally, there will probably be a need for css styling after the sidebar have been added to the website too.
I hope this helps.
July 2, 2013 at 10:55 am #48840middayminerMemberedit: Woah thanks, trying it out now!
Taking a look at simple hooks.July 2, 2013 at 11:04 am #48841middayminerMemberrfmeier, I've added the code to my custom function section but it doesn't seem to modify the site in any way. Is there some extra step I'm missing?
July 2, 2013 at 11:05 am #48842rfmeierMemberWhen you look at the widget section within the dashboard, do you see new widget areas?
July 2, 2013 at 11:24 am #48843middayminerMemberNope, just these: http://i.imgur.com/VdLG3Z9.png
the final two are ones I've added via the content aware sidebars and widgetise pages plugins.
July 2, 2013 at 11:28 am #48844rfmeierMemberI see the After Post widget area is there, but I am not sure why they Before Post widget.
Was the code added to the functions.php file within the child theme?
July 2, 2013 at 11:34 am #48846middayminerMemberAh no, I've added it to the input boxes in Genesis -> Custom Code -> Custom Functions. Are the two methods processed differently?
July 2, 2013 at 11:38 am #48847rfmeierMemberJuly 2, 2013 at 11:39 am #48848rfmeierMemberJuly 2, 2013 at 11:40 am #48849middayminerMemberI'll try editing the child theme's functions.php after this post.
Also, I've found that the after posts sidebar activates only within the post. : http://www.foundwonders.com/2013/06/extraordinary/ (I would like to keep this particular functionality however!)
It doesn't show on the homepage:
http://www.foundwonders.com/July 2, 2013 at 11:55 am #48853rfmeierMemberHmmmm,
I am seeing the before and after posts on the home page.
https://www.diigo.com/item/image/40chg/r904
and archive pages
https://www.diigo.com/item/image/40chg/x68j
I am not seeing this on the single post page. As it shouldn't, because of the code.
https://www.diigo.com/item/image/40chg/1nah
Are you seeing different?
July 2, 2013 at 12:07 pm #48856middayminerMemberHey thanks for the help, it works great now after editing functions.php directly! 🙂 Also, I'm not sure but I think that 'After Post' widget area came by default with genesis or prose. The ones you created have shown up now as 'Before Posts Widget Area' and 'After Posts Widget Area'.
There's a problem with bottom padding, but I fixed it with specifc css for the text widget.
Question though, is there a way to have yet another widget area appear every X number of posts? If I'm not wrong the default is ten simultaneous posts on the homepage, so I'd like another area in the center of that grouping.
Thanks again!
July 2, 2013 at 3:02 pm #48879rfmeierMemberYou are welcome.
As for your second question. The code below will create a widget area and display it around the middle of your posts ( total posts / 2 ) on the home page or archive pages. If the page does not contain a full page of posts, it will not display the widget area.
Again, this will go in your child theme functions.php file.
July 2, 2013 at 3:31 pm #48880middayminerMemberJust set it up, and as with the others it works perfectly. 🙂 Last question and I'll stop taking up your time: Is it possible to specify different font settings for different layouts?
Why I'm asking is because my current line heights are optimised for the homepage(http://www.foundwonders.com/), but for individual posts and category areas I remove the secondary sidebar, like so: http://www.foundwonders.com/category/visuals/ , where the increased width breaks the balance for both posts and the new widget boxes.
I would like to tweak the line height and possibly font size for the main body text for that layout.
July 2, 2013 at 7:36 pm #48915rfmeierMemberGenesis actually adds css classes to the body element for whatever layout you use.
Ex: content-sidebar, sidebar-content, full-content-width
Your home page body element has the sidebar-content-sidebar css class, while the other pages have content-side css class.
I hope that clears it up a bit.
Good luck.
July 3, 2013 at 8:44 am #48964middayminerMemberAgain, appreciate the tip. I installed firebug and rooted around. Cobbled out the following code which works, but I'm not certain if this method was what you were referring to.
/* homepage post text settings */ body.home p { font-size:14px; line-height:22px; } /* category view text settings */ body.archive p { font-size:15px; line-height:24px; }
In any case, I've run into a brick wall as to how to specify modifying an element (the content page widgets, in this case) only when it's in a certain class (the wider category view).
July 3, 2013 at 9:44 am #48979rfmeierMemberYour home page is using the content-sidebar-content layout, so for css styling you could try;
body.sidebar-content-sidebar p{ /* styling goes here */ }
For your archive pages, you are using the content-sidebar layout;
body.content-sidebar p{ /* styling goes here */ }
Is this a better example?
July 3, 2013 at 10:09 am #48989middayminerMemberAh, so the code I created is for fixed homepage/category targeting, while yours attaches to specific layouts. Is this interpretation correct? Is there a resource anywhere for genesis-specific css stuff, because I don't know how I would have found the latter even with firebug.
I figured out the widget thing btw, just had to add the element after the class. I am very much learning on the go here. 🙂
July 3, 2013 at 10:16 am #48991rfmeierMemberYou are correct. Either way works depending on how you use the site. As for resources outside of StudioPress, I am not sure. I have a habit of looking at the source and browser inspection. Although, there may be some css documentation for Genesis layouts somewhere... you may have to do some Google searching.
Learning on the go is how we learn.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.