Black Friday Sale! Get $20 off GP Premium, $40 off our new Lifetime license, and 45% off license renewals/extensions! Learn more

[Resolved] bottom div

Home Forums Support bottom div

  • This topic has 5 replies, 3 voices, and was last updated 6 years ago by Tom.
Viewing 6 posts - 1 through 6 (of 6 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
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.