• Resolved msyachrial

    (@msyachrial)


    Hello,
    How to remove title text, description text, button text and make slider picture clickable to uploaded page?

    Thanks.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter msyachrial

    (@msyachrial)

    i still can’t figure out slider picture clickable to uploaded page?. anyone?

    Thread Starter msyachrial

    (@msyachrial)

    anyone? 🙁 i still can’t make clickable slider to spesific post and remove caption and btn.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    In future try to avoid bumping your thread because you’ll remove yourself from the no-replies list, a list where volunteers can track threads with no replies and prioritise them accordingly.

    This should get you started:

    .carousel-caption h1,
    .carousel-caption,
    .carousel-caption p,
    .carousel-caption .btn {
    display:none;
    }

    Thread Starter msyachrial

    (@msyachrial)

    thanks for info andrew

    @rdellconsulting
    where i can put <a href="<?php echo $admin_link; ?></a> for clickable active image?

    To put a link on the image you need a little regEx magic that captures the link from the button and dynamically wraps it around the corresponding image. Please note that, even if you won’t show it, the button has to have a text (set in slider settings, on picture edit screen). If it doesn’t have a text, it won’t be rendered in the source, and my function won’t find the link so it won’t wrap anything around the image. So put this in your child theme’s functions.php:

    add_filter('tc_slider_display', 'link_my_slider_images');
    function link_my_slider_images($output) {
    return preg_replace('/<img(.*?)>(.*?)<a(.*?)href="(.*?)"/sm', '<a href="$4"><img$1></a>$2<a$3href="$4"', $output, -1);
    }

    Next, in order to hide the caption you need to add this to your child theme’s style.css (or in the Custom CSS panel, in theme options):

    .carousel-caption {display: none;}

    Please note that if you do not hide the caption, the link won’t work inside it, because the image is below. If you need link over picture and the caption you’d have to mod the regex above and make it wrap the link around the whole slide instead of just the image.

    I inserted the above two codes, and while the second one DID hide by button text, the first one didnt make my slider image clickable.

    @carissawp: That’s very… informative, Carissa.

    I can assure you it works, as I never post code I haven’t [link moderated] tested myself.

    But I only code a bit and design a bit. I don’t do fortune cookies nor mind reading.

    Unless you help me help you by providing a link so I can take a look and see why it doesn’t work in your case, I guess you won’t be putting links on slider images very soon… Not using this method, anyway.

    Have a happy day.

    Why was the link moderated? It’s a subdomain I made specifically to have a testing environment for different solutions and mods to Customizr theme I provide on this forum. I have used it in the past and there was no problem. Also, in this specific case, it shows that the solution provided above works.

    Please tell me what rule have I been breaking.
    Thank you.

    @carissawp: some WP moderator doesn’t want me to show you this thing works. you’re gonna have to take my word for it.

    Thread Starter msyachrial

    (@msyachrial)

    I use this:

    on class-header-slider.php (parts/class-header-slider.php)

    search: “//attachment image” (without using quote)

    looks like:

    //attachment image
                            $slide_to_display   =  wp_get_attachment_image( $id, $img_size, array( 'class' => 'slide' , 'alt' => $alt ) );
                          ?>

    and change it to:

    //attachment image
                            $slide_to_display   =  wp_get_attachment_image( $id, $img_size, array( 'class' => 'slide' , 'alt' => $alt ) );
    			// custom changes for clickable image
                            $button_perm        =  get_permalink($button_link);
                            $slide_img          =  wp_get_attachment_image( $id, $img_size, array('class' => 'slide', 'alt' => $alt ) );
                            $slide_to_display   =  '<a href="'.$button_perm.'">'.$slide_img.'</a>';
                          ?>

    and puts this on Stylesheet (style.css)

    .carousel-caption {
      display: none;
    }

    @msyachrial: If applied in parent theme, your solution will get deleted on theme update. If used in a child theme, whenever the parent theme will change file structure, due to new features being added, your solution will either not show the new features or just break the website.

    Filtering the output of functions is a much safer solution for any mod.

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Clickable slider to uploaded page’ is closed to new replies.