Insert Columns using a Hook and Responsive

Community Forums Forums Design Tips and Tricks Insert Columns using a Hook and Responsive

This topic is: not resolved

This topic contains 10 replies, has 3 voices, and was last updated by  Anita 1 year, 5 months ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #32217

    Anita
    Participant
    Post count: 7496

    There may be an occasion where I need to stick in several columns on all pages and posts. Would I be able to code the columns using Column Classes and then apply it once to a hook so that the columns show up on all pages and posts? Also, would the columns be responsive if I am using a responsive theme?


    When asking for help, please provide a link or screen shot showing your problem!
    Let me help you customize your theme, responsive header, Buddypress, Agentpress or technical issue!
    Visit me here: Cre8tiveDiva.com | Tweet Me!

    #32227

    Robert Neu
    Participant
    Post count: 90

    The short answer to this is yes. You could definitely do that. Bill Erickson outlines how to create a better, easier grid loop using column classes in this post:  http://www.billerickson.net/a-better-and-easier-grid-loop/

    What you’re talking about is similar to what he’s doing there. If the content that you wanted to include was static, it would be even easier to include. You’d just need to set up some conditional statements to include your content on the pages/sections that you wanted.

    If you need some help figuring it out, let me know and I’ll give you a hand.


    Co-Founder of Audit WP, a WordPress SEO audit service and Flagship, a new WordPress theme company launching soon!

    #32228

    braddalton
    Participant
    Post count: 9313

    Thanks for the hard question Anita!! hahaha

    Maybe this code (forked from Bill Erickson) will help and i will try and modify it at some stage.

    I am sure you can paste the HTML for content columns into the Simple hooks field to display content columns in any genesis_hook location so you must be able to add a conditional tag and use the code in a custom function also.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #32229

    Anita
    Participant
    Post count: 7496

    Thanks guys! This is wonderful. I will give both of these a try today on my demo site. If I have some trouble, I will post back here.


    When asking for help, please provide a link or screen shot showing your problem!
    Let me help you customize your theme, responsive header, Buddypress, Agentpress or technical issue!
    Visit me here: Cre8tiveDiva.com | Tweet Me!

    #32235

    braddalton
    Participant
    Post count: 9313

    Here’s the code i wrote which displays 2 content columns using the genesis_before_footer hook which you can change.

    https://gist.github.com/braddalton/5280346

    You can also add a conditional tag to this custom function.

     


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #32237

    braddalton
    Participant
    Post count: 9313

    I changed the hook for this code so it displays before the post on single posts and archives.

    I’ll add the code to Github for single posts with a conditional tag so it doesn’t display on archives shortly.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #32238

    Anita
    Participant
    Post count: 7496

    So Brad, in the last code you posted, I would just insert that in the functions or add that to the Hook area? Because the columns will have a lot of rows, i.e, 2 columns with 20 lines, 10 each column… I would hate to add that directly to the functions file.


    When asking for help, please provide a link or screen shot showing your problem!
    Let me help you customize your theme, responsive header, Buddypress, Agentpress or technical issue!
    Visit me here: Cre8tiveDiva.com | Tweet Me!

    #32239

    braddalton
    Participant
    Post count: 9313

    This code applies to the Genesis content columns code.

    You’ll need to add the CSS code for content column classes in your child themes style.css first. This code is a large block of CSS written by Brian Gardner. http://my.studiopress.com/tutorials/content-column-classes/

    Then you can add the HTML for the columns in the code. It already has it for 2 columns.

    I think what you’ll need is to create a custom widget area and use the HTML for your tables in the text widget.

    Or add the HTML between the content column divs where i have placed the sample text.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #32240

    Anita
    Participant
    Post count: 7496

    I am familiar with the Content Column Classes. I am confused now Brad but all of your writings and options. I just want to create the columns using the content column classes and insert them so that they show up below the content on pages or posts. If I have 20 pages but want the same columns on all 20 pages – use a hook to only have to code the columns once. So which option would serve me better?


    When asking for help, please provide a link or screen shot showing your problem!
    Let me help you customize your theme, responsive header, Buddypress, Agentpress or technical issue!
    Visit me here: Cre8tiveDiva.com | Tweet Me!

    #32241

    braddalton
    Participant
    Post count: 9313

    There’s more than one way to do this.

    1. You can use the Simple Hooks plugin

    2. Create a custom function as above.

    3. Create a custom widget.

    If you don’t want to add a lot of code to functions.php, add it in a widget. It has to go somewhere.

    Adding content columns using custom functions can conflict with other code in certain hook locations which is why i think its best to use a widget for the after post/page location.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #32251

    Anita
    Participant
    Post count: 7496

    Ok! Now your talking! I love talking these things out with you guys. It really challenges me to LEARN. So, looking at one of the themes that already has the “After Post Ad” or the “After Content Ad” widgets – I could actually start with those and add the columns in one of those.


    When asking for help, please provide a link or screen shot showing your problem!
    Let me help you customize your theme, responsive header, Buddypress, Agentpress or technical issue!
    Visit me here: Cre8tiveDiva.com | Tweet Me!

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.