[Resolved] php & shortcode help

Home Forums Support [Resolved] php & shortcode help

Home Forums Support php & shortcode help

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #106360
    Heath

    First, thank you Tom for awesome support and helping me before with displaying header images based on post category!! Also, the add-ons are great.

    I’m stumped trying to use GP Hooks with the Advanced Post Slider plugin. I read several other forum posts, and what worked for them doesn’t seem to be working for me.

    So, if I use just the shortcode, it works fine! ( shortcode: [advps-slideshow optset=”1″] ) But, if I try to use the php below, it does not work. Strange.

    <?php echo do_shortcode(‘[advps-slideshow optset=”1″]’); ?>

    Obviously I need to solve this before I combine it with additional php “if” commands.

    Thanks in advance for your continued support!

    #106362
    Tom
    Lead Developer
    Lead Developer

    Are you checking the Execute PHP checkbox while using PHP?

    <?php echo do_shortcode('[advps-slideshow optset="1"]'); ?>

    Out of curiosity, why not just use the shortcode?

    #106363
    Heath

    Thanks for the super quick reply!

    I do have the execute box checked. I want to use php so I can add an “if” condition for home page only.

    #106369
    Tom
    Lead Developer
    Lead Developer

    And this doesn’t work?

    <?php if ( is_front_page() ) : ?>
          <?php echo do_shortcode('[advps-slideshow optset="1"]'); ?>
    <?php endif; ?>

    How about this?

    <?php if ( is_front_page() ) : ?>
          [advps-slideshow optset="1"]
    <?php endif; ?>
    #106375
    Heath

    The second one worked! Isn’t that strange that I can’t use “do_shortcode”??

    One last question, how do I add space after the slider element? I would use your element spacing add-on, but I only want the extra space to occur when the slider is present (front page).

    Thanks Tom!

    #106377
    Tom
    Lead Developer
    Lead Developer

    That is strange – not sure what would cause that.

    You can wrap the slider in a div which you can add spacing to:

    <?php if ( is_front_page() ) : ?>
          <div class="slider-spacing">
                [advps-slideshow optset="1"]
          </div>
    <?php endif; ?>

    Then add this CSS:

    .slider-spacing {
          margin-bottom: 20px; /* or whatever */
    }
    #106378
    Heath

    You’re the man. The margin spacing worked, but now I see the problem is the spacing IN the slider itself. http://www.notwrittenby.com See the thumbnails being cut? I could ask the plugin support forum.

    #106379
    Tom
    Lead Developer
    Lead Developer

    Was that not happening before adding the spacing above?

    #106380
    Heath

    The thumbnails were always cut off. But, I thought adding the margin spacing you helped me with would solve the problem. It only added more gray space.

    #106382
    Tom
    Lead Developer
    Lead Developer

    Hmm, you may have to ask them.

    You can try:

    #advps_container1 #bx-pager {
          position: relative !important;
          bottom: auto;
    }

    Then you may have to adjust some more spacing etc..

    #106385
    Heath

    Wow, that worked. I just had to adjust the bottom margin to negative px.

    Thanks for your time!

    #106432
    Tom
    Lead Developer
    Lead Developer

    No problem 🙂

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.