• Resolved andreycheks

    (@andreycheks)


    Happy New Year! Thanks for designing a great theme. I also appreciate the great feedback and support you’ve given everyone.

    You’ve addressed this issue before, but I’m having some problems getting the fix to work correctly.

    I’m trying to remove the box on the feature slider that contains the text of the post title and associated link. I’m running a child theme and have added your code from the link provided above. I’ve also opened and closed a post and hit update, as this seems to have fixed similar issues before, but to no avail. I’m still getting the box.

    The site is: https://teague.brian.andreychek.com/

    Here’s the contents of my current functions.php file:

    <?php
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'child-style', get_stylesheet_uri(), array( 'parent-style' ) );
    }
    
    if ( ! function_exists( 'sparkling_featured_slider' ) ) :
    /**
     * Featured image slider, displayed on front page for static page and blog
     */
    function sparkling_featured_slider() {
      if ( is_front_page() && of_get_option( 'sparkling_slider_checkbox' ) == 1 ) {
        echo '<div class="flexslider">';
          echo '<ul class="slides">';
            $count = of_get_option( 'sparkling_slide_number' );
            $slidecat =of_get_option( 'sparkling_slide_categories' );
            $query = new WP_Query( array( 'cat' =>$slidecat,'posts_per_page' =>$count ) );
            if ($query->have_posts()) :
              while ($query->have_posts()) : $query->the_post();
              echo '<li>';
                if ( (function_exists( 'has_post_thumbnail' )) && ( has_post_thumbnail() ) ) :
                  echo get_the_post_thumbnail();
                endif;
                  echo '<div class="flex-caption">';
                      if ( get_the_title() != '' ) echo '<h2 class="entry-title">'. get_the_title().'</h2>';
                      if ( get_the_excerpt() != '' ) echo '<div class="excerpt">' . get_the_excerpt() .'</div>';
                  echo '</div>';
                  endwhile;
                endif;
              echo '</li>';
          echo '</ul>';
        echo ' </div>';
      }
    }
    endif;
    
    ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter andreycheks

    (@andreycheks)

    Never mind, I got it. It //’ed out the two lines about get_the_title and get_the_excerpt. This solved it.

    Thanks again for a great product!

    marta.turchetto

    (@martaturchetto)

    Sorry, I don’t understand your last post. What I have to do to correct the code?
    thanks

    Thread Starter andreycheks

    (@andreycheks)

    Sorry. what I did was I took these lines `if ( get_the_title() != ” ) echo ‘<h2 class=”entry-title”>’. get_the_title().'</h2>’;
    if ( get_the_excerpt() != ” ) echo ‘<div class=”excerpt”>’ . get_the_excerpt() .'</div>’;`

    and put // in front of both of them. // just makes it so that those lines of code aren’t read. You could just delete them as well.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Remove link/Post title from feature slider’ is closed to new replies.