WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: flshow Manager] How do you add code to PHP template to display carousel (11 posts)

  1. cramermark
    Member
    Posted 5 years ago #

    I am very new to WordPress. I have completed all the steps to use the carousel except I don't understand the last step:

    To display the carousel on your site, add the following code to your PHP templates where you want the carousel to appear: <div style="height:200px"><?php flshow( $id ); ?></div>.

    Where or how do I add this code?

    I tried downloading index.php, opening it in an editor, and pasting the code in, changing the ID, and uploading it again. Is this what is meant?

    Thanks!

  2. sunburntkamel
    Member
    Posted 5 years ago #

    Yes, that's pretty much it. did it work for you?

  3. cramermark
    Member
    Posted 5 years ago #

    Thanks for your response. It didn't work for me.

    I received this error message:
    Parse error: syntax error, unexpected '<' in /home/content/c/r/a/cramermark/html/Blog/index.php on line 15

    Here's what I FTP'd to replace the index.php file:

    \
    <?php
    /**
    * Front to the WordPress application. This file doesn't do anything, but loads
    * wp-blog-header.php which does and tells WordPress to load the theme.
    *
    * @package WordPress
    */

    /**
    * Tells WordPress to load the WordPress theme and output it.
    *
    * @var bool
    */
    define('WP_USE_THEMES', true);
    <div style="height:200px"><?php flshow( $21 ); ?></div>

    /** Loads the WordPress Environment and Template */
    require('./wp-blog-header.php');
    ?>
    \

  4. sunburntkamel
    Member
    Posted 5 years ago #

    hokay.
    that's the wrong file.
    you want to just delete that line, or re-upload the original file.
    then you want to go to your dashboard, and go to Design > Theme Editor, and edit "Main Index Template"

    Decide where you want to insert the flash, and place the code there. You shouldn't edit templates if you're not familiar with HTML.

  5. elizabethrichardson
    Member
    Posted 5 years ago #

    Hello...I love this plugin and know how and where to add it to my website...I'm just not familiar with changing the ID.

    Pardon my ignorance, but exactly which part of <div style="height:200px"><?php flshow( $id ); ?></div> do I change?

    Thanks for your assistance...

  6. sunburntkamel
    Member
    Posted 5 years ago #

    for example, on our site, the code from the example would be <div style="height:200px"><?php flshow(54) ?></div> since 54 is the id shown at the left of the management page.

  7. elizabethrichardson
    Member
    Posted 5 years ago #

    Thanks sunburntkamel...I appreciate you taking the time to answer. All the best...Elizabeth

  8. lovingwp
    Member
    Posted 5 years ago #

    hi, this answered two of my first newbie questions...now for the 3rd and hopefully last. so i made a carousel, and using
    <div style="height:200px"><?php flshow(54) ?></div>
    i was able to insert it above the footer by modifying the index.php in the main index template.

    but i want the carousel to display only on one page beneath the title in the main body, for example if i have a page http ://mysite/?page_id=98

    how and where do i do this?
    thanks in advance

  9. lovingwp
    Member
    Posted 5 years ago #

    ok i figured out a solution, probably not the most elegant way but it worked.
    i installed plugin exec-php which allows php in posts and pages.
    turned off my visual editor in my profile settings and then went to the page (or post if you want it there) i wanted the carousel to display and pasted in
    <div style="height:200px"><?php flshow(100) ?></div>
    saved and my gallery is there

    cheers

  10. sunburntkamel
    Member
    Posted 5 years ago #

    Glad you sorted it out. the other way to do it would be to use this template code:

    <?php if ( is_page('98') ) { ?>
    <div style="height:200px">
    <?php flshow(54) ?>
    </div>
    <?php } ?>
  11. lovingwp
    Member
    Posted 5 years ago #

    that's even better, and is what i tried at first, but my php wasn't quite up to the task...cheers

Topic Closed

This topic has been closed to new replies.

About this Topic