[Resolved] bottom div

Home Forums Support [Resolved] bottom div

Home Forums Support bottom div

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #46932
    Chad Biggs

    Hello, how can I place a div on on the bottom of every blog and page?  This would be used like a signature, except I will be using two images, one floating left and one floating right.

    #46933
    Tom
    Lead Developer
    Lead Developer

    Your best bet would be to use GP Hooks in the “After Content” area.

    You may need a PHP conditional if you only want it to show up on certain pages.

    If you want it to show up on all static pages, and single blog posts, you would do this:

    <?php if ( is_single() || is_page() ) : ?>
          YOUR DIV AND HTML IN HERE
    <?php endif; ?>

    Let me know if you need more help 🙂

    #47052
    Chad Biggs

    I have never used a hook before. The line you gave me works with text in the div but I have two issues.

    Q1 – How do I use the hook to put it only on post and pages, but not on excerpts?

    Q2 – I tried using a div class and placing it in the child theme but it doesn’t work. How is the best way to style a hook?

    #47061
    Tom
    Lead Developer
    Lead Developer

    1. The PHP conditional I provided should keep it away from excerpts – did you include the entire snippet I provided? I just tried it on my localhost and it didn’t include the div in my excerpts. Make you check the “Execute PHP” checkbox.

    2. You can do this:

    
    <?php if ( is_single() || is_page() ) : ?>
          <div class="your-class-here">
                YOUR DIV AND HTML IN HERE
          </div>
    <?php endif; ?>

    And then in your CSS:

    .your-class-here {
          .. your styles in here
    }
    #47130
    Chad Biggs

    Got it. Thank you so much.

    #47192
    Tom
    Lead Developer
    Lead Developer

    You’re welcome!

    #1691789
    Butch Pornebo

    @tom

    What variable/parameters are pass to the “after-content” hook?

    Any documentation available?

    #1691910
    Leo
    Staff
    Customer Support
Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘bottom div’ is closed to new replies.