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  anitac 1 year ago.

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

    anitac
    Participant
    Post count: 6488

    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?


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

    #32227

    FAT Media
    Participant
    Post count: 87

    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.


    CEO + Lead Developer at FAT Media. We also run a cool WordPress Podcast over at WP Bacon. Check us out! :)

    #32228

    braddalton
    Participant
    Post count: 7470

    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.


    WordPress Developer & Consultant
    Brad Dalton400+ StudioPress Tutorials & 1200+ Code snippets

    #32229

    anitac
    Participant
    Post count: 6488

    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.


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

    #32235

    braddalton
    Participant
    Post count: 7470

    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.

     


    WordPress Developer & Consultant
    Brad Dalton400+ StudioPress Tutorials & 1200+ Code snippets

    #32237

    braddalton
    Participant
    Post count: 7470

    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.


    WordPress Developer & Consultant
    Brad Dalton400+ StudioPress Tutorials & 1200+ Code snippets

    #32238

    anitac
    Participant
    Post count: 6488

    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.


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

    #32239

    braddalton
    Participant
    Post count: 7470

    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.


    WordPress Developer & Consultant
    Brad Dalton400+ StudioPress Tutorials & 1200+ Code snippets

    #32240

    anitac
    Participant
    Post count: 6488

    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?


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

    #32241

    braddalton
    Participant
    Post count: 7470

    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.


    WordPress Developer & Consultant
    Brad Dalton400+ StudioPress Tutorials & 1200+ Code snippets

    #32251

    anitac
    Participant
    Post count: 6488

    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.


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

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

You must be logged in to reply to this topic.