[Resolved] Conditionals inside hook

Home Forums Support Conditionals inside hook

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #324160
    Jamal

    Hi

    Hope you can help me out a little here, i’m trying to show a cf7 form inside a hook on a specific category. The form shows but somehow i keep breaking the sidebar which goes below the post while on desktop. Thanks !

      add_action ( 'generate_after_entry_content', 'sommar_bookings' );
    function sommar_bookings() {
    if ( in_category( 'sommarlov-categ' ) ){ ?>
      <?php
    echo do_shortcode( '[contact-form-7 id="2857" title="Booking form"]' );
      ?>
    
    <?php }
    }

    Agressively support the kind of work you want to see. Buy it. Talk about it. Review it.

    #324250
    Tom
    Lead Developer
    Lead Developer

    Is there any HTML in your contact form? If so, you might have some elements no closed properly in there.

    #324300
    Jamal

    Thanks dude ! Spent hours trying to make this to work.

    Agressively support the kind of work you want to see. Buy it. Talk about it. Review it.

    #324302
    Tom
    Lead Developer
    Lead Developer
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.