• 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

Adding 3-column text to home page

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 › Adding 3-column text to home page

This topic is: not resolved

Tagged: footer, generate theme

  • This topic has 19 replies, 3 voices, and was last updated 9 years, 9 months ago by jtintner.
Viewing 20 posts - 1 through 20 (of 20 total)
  • Author
    Posts
  • June 17, 2013 at 9:58 pm #46483
    Patrick
    Member

    Hi, I'm trying to add 3 columns of text to my home page under the generate box, but above my blog articles (in the same style as the footer, but without the background). Any suggestions?

    Thank you!

    http://officeliberator.com
    June 18, 2013 at 7:50 am #46519
    Brad Dalton
    Participant

    The easiest way to do this is to add a new widget and use content columns in a text widget.

    Please copy and paste the code from the view raw link and paste it at the end of your child themes functions.php file using a text editor like Notepad++.

    You could also hook in 3 widgets however that would require a fair amount of custom coding knowledge.

    You will need to add CSS code for padding etc.


    Tutorials for StudioPress Themes.

    June 18, 2013 at 10:17 am #46546
    Patrick
    Member

    Great, looks like this got me 50% there. I added the php and it did add the Home Columns widget, but when I add 3-columned text in a text widget, from the example you showed, nothing appears on my home, as you can see (I left the widget active so you can see). I am very grateful for your help thus far - any further suggestions?

    June 18, 2013 at 10:27 am #46547
    Brad Dalton
    Participant

    Did you also add the CSS to your child themes style.css file? http://my.studiopress.com/tutorials/content-column-classes/

    The HTML alone will not work without the CSS.


    Tutorials for StudioPress Themes.

    June 18, 2013 at 10:28 am #46548
    Patrick
    Member

    Yes, I checked to make sure my child theme had it built in and it did.

    June 18, 2013 at 10:38 am #46551
    Brad Dalton
    Participant

    Yes sorry. My bad. I changed the code in Github after posting it here for another tutorial.

    I thought you already had it copied.

    Try the PHP again please.


    Tutorials for StudioPress Themes.

    June 18, 2013 at 10:43 am #46558
    Patrick
    Member

    Got it! Exactly what I was hoping for. Your the man - thanks a ton for your help!

    June 18, 2013 at 10:51 am #46562
    Brad Dalton
    Participant

    No worries.

    You can easily style your widget using an existing class from your footer or other CSS.

    Link to pro tip in the code.


    Tutorials for StudioPress Themes.

    June 18, 2013 at 4:15 pm #46632
    jtintner
    Member

    I get an error when I add this code above to my functions.php file in my child theme

    Fatal error: Call to undefined function genesis_register_sidebar() in C:\xampp\htdocs\routinechaos\wp-content\themes\blueeel\functions.php on line 41

    here is my functions file
    `
    <?php
    /**
    * Functions
    *
    * @package BlueEel
    * @author Josh Tintner
    * @copyright Copyright (c) 2031, Josh Tintner
    * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
    *
    */

    /**
    * Theme Setup
    *
    * This setup function attaches all of the site-wide functions
    * to the correct actions and filters. All the functions themselves
    * are defined below this setup function.
    *
    */

    add_action('genesis_setup','child_theme_setup', 15);
    function child_theme_setup() {

    // Add Nav to Header
    add_action('genesis_before_header', 'be_nav_menus','genesis_header' ,'genesis_after_header' ,'be_nav_menues_seconday' );

    }

    /**
    * Add Nav Menus to Header
    *
    */

    function be_nav_menus() {
    echo '';
    wp_nav_menu( array( 'menu' => 'Primary' ) );
    echo '';
    }
    genesis_register_sidebar( array(
    'id' => 'custom-widget',
    'name' => __( 'Home Columns', 'wpsites' ),
    'description' => __( 'Adds Home Page Widget For 3 Columns', 'wpsites' ),
    ) );
    /**
    * @author Brad Dalton - WP Sites
    * @learn more http://wp.me/p1lTu0-a0y
    */
    add_action( 'genesis_before_content_sidebar_wrap', 'wpsites_home_widget', 5 );
    function wpsites_home_widget() {
    if ( is_home() && is_active_sidebar( 'custom-widget' ) ) {
    echo '';
    dynamic_sidebar( 'custom-widget' );
    echo '';

    }

    }

    `
    But I have no errors in the PHP file, any thoughts here?

    June 18, 2013 at 4:24 pm #46636
    Brad Dalton
    Participant

    The code is tested and works. Whats on line 41?

    Can you please paste the code on Github Gists or Pastebin and link to it from here please.


    Tutorials for StudioPress Themes.

    June 18, 2013 at 4:41 pm #46641
    Brad Dalton
    Participant

    You've missed some of the code:

    //This works
     echo '<div class="custom-widget">';
    dynamic_sidebar( 'custom-widget' );
    echo '</div><!-- end .custom-widget -->';
     
    }}
    //This doesn't
     echo '';
    	dynamic_sidebar( 'custom-widget' );
    	echo '<!-- end .custom-widget -->';
     
    }}
    

    Please copy the code from the view raw link and paste it at the end of your child themes functions.php file.


    Tutorials for StudioPress Themes.

    June 18, 2013 at 4:43 pm #46643
    jtintner
    Member

    sorry don't know how to copy and paste the block in from github so here is the direct link to the file

    https://github.com/jtintner/routinechaos/blob/master/functions.php

    line 41 appears to be where your code starts.

    normally I'm pretty good with php massaging but actually building PHP from scratch is not my strong suite, hence why I'm taking this challenge on 🙂

    P.S since I'm building this on local host its going to be really hard to provide a URL but if it works best to move this to a URL I can do so and share links if your willing to help me along with some of this

    June 18, 2013 at 4:50 pm #46647
    jtintner
    Member

    @branddalton

    Check the github link I sent, for some reason when I copied and pasted it into the response window it removed some of the PHP so take a look at that instead of what I posted in the comment I will go ahead and delete it

    June 18, 2013 at 5:46 pm #46651
    Brad Dalton
    Participant

    Code looks fine on Github so please try again


    Tutorials for StudioPress Themes.

    June 18, 2013 at 8:23 pm #46673
    jtintner
    Member

    I can't seem to get this code to work so I'm not really sure where the problem is 🙁 DOHH!!!

    June 19, 2013 at 5:33 am #46707
    jtintner
    Member

    I've been fumbling with this for the last several hours this morning, I'm starting to get frustrated with why I can't register a new sidebar as you have shown here.

    I have been watching numerous videos and have read quite a few blog posts in the last 2 hours with little success.  While I was able to play around a bit with adding some stuff to specific areas on the page I want to do some more of this dynamic stuff you are talking about.

    It seems that when I add any of the

    genesis_register_sidebar anything the site bombs out.  Here is what I have added to my functions.php file

    https://github.com/jtintner/routinechaos/blob/master/functions.php

    I've been trying to debug this for hours with little success.

    For some reason I cant even register the sidebar at all.  I can do other simple minded tasks like trying to add in some echo text and point it to above or below content no problem.

    Am I missing something on how to register a new sidebar? Is there an added step I'm missing?

     

    Sorry for all the random flusterd posts, I will try to keep those to a minimum

    P.S I actually created a live site, (which right now wont work unless I remove the registering of the sidebar in my github code) Which  I have done temporarily just so you can see the site.

     

    http://www.myplaysandbox.com

    June 19, 2013 at 5:45 am #46710
    Brad Dalton
    Participant

    The link above does not include the entire code i pasted for you to use.

    It also does not include all your functions.php file code.

    All code i paste on these forums works because i test it. I have tested the code 3 times now on 3 separate themes.


    Tutorials for StudioPress Themes.

    June 19, 2013 at 6:48 am #46719
    jtintner
    Member

    You are 100% correct in that it does work, I downloaded the sample Genesis theme and stuck your code on there and it worked.  For some reason it didn't work in my functions.php file that I created, I'm not really sure why but it didn't.

    Something on the top of my functions file was making it not function properly, not to sure why since as I said PHP has never really been my strong suite.  In any case, I never doubted you more or less trying to trouble shoot with some help.  I will just use the sample theme and modify this functions.php file instead of creating my own, but this did work now

    June 19, 2013 at 6:55 am #46722
    Brad Dalton
    Participant

    Good idea Josh.

    The Genesis 2.0 sample theme supports HTML 5 and i actually use it on my own site. You will need Genesis 2.0 to run this theme unless you use the 1.92 version.

    I think you have a problem with the PHP in your old themes functions file.


    Tutorials for StudioPress Themes.

    June 19, 2013 at 7:02 am #46724
    jtintner
    Member

    Brad

    I was actually running the 1.92 version of the Genesis framework but now I think I have everything figured out.  I was about 2 seconds away from even going down this endeavor 🙂 but thanks for all your help honestly!

     

    one last question what does the '5' do?

    add_action( 'genesis_before_content_sidebar_wrap', 'wpsites_home_widget', 5 );

  • Author
    Posts
Viewing 20 posts - 1 through 20 (of 20 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and 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