How to add a widget at the top of each post

  • ABCDiamond

    #8979

    I want to create a widgett that will allow me to add some code at the top of each post.

    I used the “graphene_before_post_content” hook, but the appearance is not the same as if I put the code directly into the post.

    The code I am using creates a right aligned box.

    If I place the code in the post, then the rest of the post content aligns to the left of the box that is created created in the widget

    But if I use the “graphene_before_post_content” widget then the post content appears under the box that is created created in the widget, leaving a lot of white space on the left above the content

    Any suggestions please.

    Mod

    Kenneth John Odle

    #42514

    Target that widget’s id with the css float:right property.

    ABCDiamond

    #42515

    Thank you, I added this to CSS, and it worked fine

    #graphene-dynamic-widget-graphene_before_post_content .widget_text {
    position: relative;
    float: right;
    }

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

  • You must be logged in to reply to this topic.