• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Insert Columns using a Hook and Responsive

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

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

This topic is: not resolved

Tagged: column classes, hooks, responsive

  • This topic has 10 replies, 3 voices, and was last updated 10 years, 6 months ago by Anita.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • March 31, 2013 at 3:57 am #32217
    Anita
    Keymaster

    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?


    Love coffee, chocolate and my Bella!

    March 31, 2013 at 5:00 am #32227
    Robert Neu
    Member

    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!

    March 31, 2013 at 5:06 am #32228
    Brad Dalton
    Participant

    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.


    Tutorials for StudioPress Themes & WooCommerce.

    March 31, 2013 at 5:15 am #32229
    Anita
    Keymaster

    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.


    Love coffee, chocolate and my Bella!

    March 31, 2013 at 5:49 am #32235
    Brad Dalton
    Participant

    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.

     


    Tutorials for StudioPress Themes & WooCommerce.

    March 31, 2013 at 6:02 am #32237
    Brad Dalton
    Participant

    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.


    Tutorials for StudioPress Themes & WooCommerce.

    March 31, 2013 at 6:02 am #32238
    Anita
    Keymaster

    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.


    Love coffee, chocolate and my Bella!

    March 31, 2013 at 6:16 am #32239
    Brad Dalton
    Participant

    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.


    Tutorials for StudioPress Themes & WooCommerce.

    March 31, 2013 at 6:25 am #32240
    Anita
    Keymaster

    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?


    Love coffee, chocolate and my Bella!

    March 31, 2013 at 6:56 am #32241
    Brad Dalton
    Participant

    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.


    Tutorials for StudioPress Themes & WooCommerce.

    March 31, 2013 at 8:07 am #32251
    Anita
    Keymaster

    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.


    Love coffee, chocolate and my Bella!

  • Author
    Posts
Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Insert Columns using a Hook and Responsive’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble