WordPress.org

Ready to get started?Download WordPress

Forums

Portfolio Slideshow
[resolved] Bypassing short codes... embedding directly into single.php (5 posts)

  1. Hotcoffee
    Member
    Posted 3 years ago #

    If I wanted to avoid having to enter the short code in onto each post to display the images/slideshow by editing my single.php file what code would I need to add? Thanks for any suggestions.

  2. Dalton
    Member
    Plugin Contributor

    Posted 3 years ago #

    You need to use the do_shortcode function. Something like this:

    <?php do_shortcode('[portfolio_slideshow]');?>

  3. Hotcoffee
    Member
    Posted 3 years ago #

    Thanks for the quick reply...

    I was also having problems getting the slideshow to actually slide... I removed all of the other plug-ins that were using jquery and it still didn't want to slide... I uploaded three new picture is specifically into that post and when I viewed the source code the images were there along with the Google hosted jquery script. I couldn't get it running so I switched to http://wordpress.org/extend/plugins/slideshow-gallery/

    It is sliding correctly.

    Thank you for the short code function tip... I'm sure I will make use of that somewhere else.

  4. Dalton
    Member
    Plugin Contributor

    Posted 3 years ago #

    I saw a problem recently where the Cycle portion of the plugin wasn't loading properly. (The plugin requires both jQuery and the jQuery Cycle plugin to work). It was because their theme did not have <?php wp_footer() ?> in the footer, which is where the cycle script is placed.

    If you still want to run the plugin, check your theme for this line. It's very important and should be in every theme.

  5. newportcreativegroup
    Member
    Posted 3 years ago #

    I was just doing the same thing. Just a heads up that do_shortcode returns the output but DOESN'T display it. So you need to use:

    <?php echo do_shortcode('[portfolio_gallery]');?>

    Another tip that might come in useful. If you want to display portfolio galleries on pages or posts via template tags, try using a Custom Field. For example, add a custom field called Portfolio and for value put [portfolio_gallery].

    On the page template, add the following :

    $portfolio = get_post_meta($post->ID, 'Portfolio', 'true');
    if($portfolio){
    echo do_shortcode($portfolio);
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic