Adding Double Rectangular Widgets After Post in Minimum

Community Forums Forums Design Tips and Tricks Adding Double Rectangular Widgets After Post in Minimum

This topic is: not resolved

This topic contains 4 replies, has 1 voice, and was last updated by  eluviis 1 year, 2 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #36981

    eluviis
    Participant
    Post count: 115

    I have seen a number of tutorials on how to add widgets after  post. I’m currently using one hold a subscribe form like on Brian Gardner’s tutorial.

    But, what if I wanted to add two 336px square widgets side by wide, right after the post content in the content column. The cotent column in minimum fits up to 740px, so a pair of 336px boxes should be fine with room for padding to spare.

    I’d rather they be 2 widgets so that I can easily replace content. One will contain an Adsense ad and the other would contain an image banner likely with a link to an article or page I would like to promote periodically.

    Here is a perfect example of how I would like the boxes to look:

    http://dannycruz.com/forums/tech/widgets_sample.jpg

    And below is a post sample that would contain the boxes.

    http://rallyways.com/2450/bella-italia-exotic-car-show-in-san-diego-california/
    #36995

    eluviis
    Participant
    Post count: 115

    I suppose the code needed for those two boxes would be similar to that of the eNews widget. Right now I’m using this code to register the eNews email sign up widget and display it:

    //** Register newsletter signup widget area for the after post content form */
    genesis_register_sidebar( array(
    ‘id’ => ‘newsletter’,
    ‘name’ => __( ‘Newsletter After Post’, ‘custom-theme’ ),
    ‘description’ => __( ‘This is the newsletter section.’, ‘custom-theme’ ),
    ) );

    /** Display newsletter signup widget after the post content */
    add_action( ‘genesis_after_post_content’, ‘custom_add_newsletter_box’ );
    function custom_add_newsletter_box() {
    if ( is_singular( ‘post’, ‘quickblog’ ) )
    genesis_widget_area( ‘newsletter’, array(
    ‘before’ => ”,
    ) );
    }

    And for styling it I’m using this:

    /* Search Form / eNews and Update Widget
    ———————————————————— */

    .enews-widget {
    background-color: #333333;
    line-height: 1.5;
    margin: 11px 0px 0px 0px;
    padding: 2.5rem 3rem 3rem;
    }

    .enews #subbox, #subbox1, #subbox2, .s {
    -moz-box-shadow: 0 0 5px #ccc inset;
    -webkit-box-shadow: 0 0 5px #ccc inset;
    background-color: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 0 5px #ccc inset;
    box-sizing: border-box;
    color: #999;
    font-family: ‘Open Sans’, sans-serif;
    font-size: 12px;
    line-height: 1.5;
    padding: 15px;
    text-transform: uppercase;
    width: 50%;
    }

    #nav .searchform {
    margin: 3px 0 0;
    }

    .enews .searchsubmit {
    display: none;
    }

    .enews p {
    margin: 0 0 10px;
    color: #ffffff;
    }

    .enews h4 {
    margin: 0 0 10px;
    color: #CAAD23;
    }

    —————————–

    Now, using those 2 snippets as samples, how do I create my 2 side by side 336px widgets after the content, but before the signup form, and style them to sit side by side?

    #38645

    eluviis
    Participant
    Post count: 115

    Anybody feeling helpful?

    #40908

    eluviis
    Participant
    Post count: 115

    After much trial and error, this is the code I used to display the 2 boxes:

    `

    /** Display custom content box 1 widget after the post content – Needs debugging */
    add_action( ‘genesis_after_post_content’, ‘add_custom_content_box_1′ );
    function add_custom_content_box_1() {
    if ( is_singular( array( ‘post’, ‘quickblog’, ‘specialty’, ‘show’ ) ) )
    genesis_widget_area( ‘custom-content-box-1′, array(
    ‘before’ => ‘<div id=”custom-content_box_1 widget-area”>’,
    ) );
    }

    /** Display custom content box 2 widget after the post content – Needs debugging */
    add_action( ‘genesis_after_post_content’, ‘add_custom_content_box_2′ );
    function add_custom_content_box_2() {
    if ( is_singular( array( ‘post’, ‘quickblog’, ‘specialty’, ‘show’ ) ) )
    genesis_widget_area( ‘custom-content-box-1′, array(
    ‘before’ => ‘<div id=”custom-content-box-2 widget-area”>’,
    ) );
    }

    `

    Unfortunately, it’s not working right. The boxes display… but what happens is, whatever I put in the first widget gets repeated in the 2nd widget.

    I’ve tried to contract some people to hire them to help me debug this, but everyone’s super busy.

    #40909

    eluviis
    Participant
    Post count: 115

    I also don’t understand why pasting the code here strips out some of the code. Whether I use the code tags or not. (There should be more code on after the ‘before’ that gets stripped out when I post it here. This is so frustrating. I’m going to be giving this one up soon…

     

    EDIT: There. I finally got it to display all the code.

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

You must be logged in to reply to this topic.