WordPress.org

Ready to get started?Download WordPress

Forums

Slideshow
[resolved] Insert slideshow on homepage on top of posts (9 posts)

  1. proxio
    Member
    Posted 1 year ago #

    Hi, and thx for the plugin :)

    I d like to insert the slideshow on top of all articles AND only the the homepage of the website http://www.jsuisprof.fr

    Is that possible ?

    Ive already tried to insert the code in content.php but the slideshow appeared on top of every post...

    Any help ?

    Thx a lot !

    http://wordpress.org/extend/plugins/slideshow-jquery-image-gallery/

  2. Stefan Boonstra
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    Inserting the code snippet in your theme's 'content.php' is alright. You can use WordPress' 'is_home()' function to test wether or not you're on the homepage of your website.

    if(is_home())
        do_action('slideshow_deploy', 'the ID of your slideshow');

    Best regards,
    Stefan

  3. proxio
    Member
    Posted 1 year ago #

    Hi,

    I did insert the code on content.php but the slideshow appears on top of every post.... bad !

    I just want it to show on top of the first post (with some space before the first post)

    Like this

    slideshow
    space
    post
    post
    post
    post

    Any idea?

  4. Stefan Boonstra
    Member
    Plugin Author

    Posted 1 year ago #

    I'm sorry, I misunderstood that.

    You should insert the slideshow's PHP snippet outside of the WordPress loop, which means placing it in your theme's 'index.php' file.

    A good place to add the PHP snippet is probably after the line with '<div id="content" role="main">' in your theme's 'index.php' file. Depending on wether or not you'd like to show it just on the home page, you can keep or remove the 'is_home()' check on the slideshow's PHP snippet.

    It's possible to adapt the slideshow's stylesheet on the 'General Settings' page, then selecting the customized stylesheet as style setting on the slideshow's settings page. You can of course also add this space in the 'index.php' file itself.

  5. proxio
    Member
    Posted 1 year ago #

    <?php
    /**
     * The main template file.
     *
     * This is the most generic template file in a WordPress theme
     * and one of the two required files for a theme (the other being style.css).
     * It is used to display a page when nothing more specific matches a query.
     * E.g., it puts together the home page when no home.php file exists.
     * Learn more: http://codex.wordpress.org/Template_Hierarchy
     *
     * @package Catch Themes
     * @subpackage Catch_Box
     */
    
    get_header(); ?>            	
    
    			<?php if ( have_posts() ) : ?>
    
    				<?php /* Start the Loop */ ?>
    				<?php while ( have_posts() ) : the_post(); ?>
    
    					<?php get_template_part( 'content', get_post_format() ); ?>
    
    				<?php endwhile; ?>
    
    				<?php catchbox_content_nav( 'nav-below' ); ?>
    
    			<?php else : ?>
    
    				<article id="post-0" class="post no-results not-found">
    					<header class="entry-header">
    						<h1 class="entry-title"><?php _e( 'Nothing Found', 'catchbox' ); ?></h1>
    					</header><!-- .entry-header -->
    
    					<div class="entry-content">
    						<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'catchbox' ); ?></p>
    						<?php get_search_form(); ?>
    					</div><!-- .entry-content -->
    				</article><!-- #post-0 -->
    
    			<?php endif; ?>
    
    			</div><!-- #content -->
    		</div><!-- #primary -->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Here is my index.php code, ive tried to pud the code almost everywhere but nothing worked, at best the slideshow appeared at the bottom of the page after content...

  6. Stefan Boonstra
    Member
    Plugin Author

    Posted 1 year ago #

    Alright, perhaps the '<div id="content" role="main">' is in the header file of your theme. Have you already tried placing the code below the 'get_header();' function? It would look something like this:

    get_header();
    
    if(is_home())
        do_action('slideshow_deploy', 'the ID of your slideshow'); ?>

    Mind that you can only use the code within the '<?php' and '?>' PHP opening and closing tags.

  7. proxio
    Member
    Posted 1 year ago #

    GOOOOOOOOOD !!!!

    Thx a lot Stefan...

    Just one last thing... as i am not expert in code, would be kind and tell me how to insert some space between the slideshow and the first post ?

    (same space as between the posts) !

    That would be great !

    Thanks a lot

  8. Stefan Boonstra
    Member
    Plugin Author

    Posted 1 year ago #

    With a space added in HTML it would look like this:

    get_header();
    
    if(is_home())
        do_action('slideshow_deploy', 'the ID of your slideshow'); ?>
    
    <div style="width: 100%; height: 20px;"></div>

    That will create a space of 20 pixels heigh, you can put any number of pixels you want here.

    The other way is setting a margin (spacing) at the bottom of the slideshow by going to the 'Custom Styles' tab on the 'General Settings' page, then click 'Customize' on (probably) the 'Light' default stylesheet. Add 'margin-bottom: 20px;' to the 'slideshow_container { }' class (between the brackets: '{ }'). After that you'll have to select the customized stylesheet in your slideshow.

  9. proxio
    Member
    Posted 1 year ago #

    This is it !!!!

    Thx a lot Stefan, never seen such a goood support for a plugin :)

    Thx again !

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.