WordPress.org

Ready to get started?Download WordPress

Forums

Twenty Ten insert slider in the header (4 posts)

  1. gio.ferre
    Member
    Posted 3 years ago #

    Is it possible to insert a slider (as vslider) in the header for display featured posts or pages?
    I have made many attempts in the header.php at 68 line but witouth success.
    I deleted this

    <?php
    // Check if this is a post or page, if it has a thumbnail, and if it's a big one
    if ( is_singular() &&
    has_post_thumbnail( $post->ID ) &&
    ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) &&
    $image[1] >= HEADER_IMAGE_WIDTH ) :
    // Houston, we have a new header image!
    echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
    else : ?>
    <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
    <?php endif; ?>

  2. Digital Raindrops
    Member
    Posted 3 years ago #

    Something like this to center it in the header and hide the overflow, this would be how I would add cu3er, I have just written this as an example so it is untested.

    <div style="text-align: center">
       <div class="my-slider-block" style="display:inline; width:100%; overflow:hidden">
       <?php if( function_exists('install_cu3er')) {install_cu3er();} ?>
       </div>
    </div>

    HTH

    David

  3. gio.ferre
    Member
    Posted 3 years ago #

    By deleting all php in my post?

  4. Digital Raindrops
    Member
    Posted 3 years ago #

    NO! this would be instead of the code above, but you should not delete code just make it conditional, this untested example is for cu3er you need to change the function name to your own, start with the condition to see if the plugin is active, this is a way that leaves the WordPress code.

    <?php /* Start Function Added by DSC on 03.08.10 */ ?>
    <?php if(function_exists('install_cu3er')): ?>
    <div style="text-align: center">
       <div class="my-slider-block" style="display:inline; width:100%; overflow:hidden">
       <?php install_cu3er(); ?>
       </div>
    </div>
    <?php else: ?>
    <?php /* End Function Added by DSC on 03.08.10 */ ?>

    >>
    Then the un-edited Wodpress code is here, and after you add
    <<

    <?php endif; //added by DSC on 03.08.10 ?>

    If you plan to edit themes then some online research into child themes, articles and tutorial would be a good start.

    HTH

    David

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags