Forums

Promotion Slider
Custom urls not working (9 posts)

  1. smoo
    Member
    Posted 1 year ago #

    Hi,
    I'm trying to get my promotion images to link to custom urls, so, I'm adding my desired url to the 'Destination URL:' field in the 'Change Linking Behaviour' section of my promotion editing screen.

    However, no matter what I put in there, - full url (http://mysite.com/desired_page/) or relative url from root (/desired_page/) the promotion always links to the promotion page (http://mysite.com/promotions/promotions-page/)

    I'm updating/saving the promotion after I've added my url, so I can't see what else I can change..
    Can anyone help?
    Thanks

  2. smoo
    Member
    Posted 1 year ago #

    Update:
    Have discovered that if I enable 'Promotion Title Display' and 'Display Fancy Title' in 'Promotion Slider Options' then the title links to the url I've specified, but the image itself still links to a promotions page.

    I then tried checking 'Disable all links for this promotion' and it appears to have no effect at all, the image still links to a promotion page.

    It seems like this plugin is great in so many ways, -so am I missing something?
    Thanks for any help

  3. smoo
    Member
    Posted 1 year ago #

    Just to be clear: I don't want to use the promotions pages at all; I'd just like the images in the slider to link to different sections of my site.

    Thanks again!

  4. Micah
    Member
    Posted 1 year ago #

    I tested out the issue you described and was unable to duplicate the problem on my end. Have you added any custom filters?

  5. smoo
    Member
    Posted 1 year ago #

    Bingo!
    I'm using several custom filters, but it turns out that it's the one posted here: http://wordpress.org/support/topic/making-post-thumbnail-link-to-post?replies=13
    with the comment "// THIS LINKS THE THUMBNAIL TO THE POST PERMALINK"
    which is causing the conflict.

    I'd really like my thumbnails to link to their respective articles as well as use your great slider (I know, I want it all!) but am relatively new to working with filters. In your opinion, do you think there may be a way around this? Or is the way that each of these work mutually exclusive?
    Thanks for your time

  6. Micah
    Member
    Posted 1 year ago #

    If you are using that filter to link your post thumbnails to your posts, but don't want to apply that to your slider images, you just need to do a post type check in your filter.

    Use the get_post_type() function to do the check.

    For example:

    add_filter( 'post_thumbnail_html', 'my_post_image_html', 10, 3 );
    
    function my_post_image_html( $html, $post_id, $post_image_id ) {
      if( get_post_type($post_id) != 'ps_promotion' ){
    	$html = '<a href="' . get_permalink( $post_id ) . '" title="' . esc_attr( get_post_field( 'post_title', $post_id ) ) . '">' . $html . '</a>';
      }
    
      return $html;
    }
  7. smoo
    Member
    Posted 1 year ago #

    Praise be!
    Thank you so much for your time, it's very much appreciated.
    Also great to be slowly getting to understand WP's general awesomness :o)

  8. Bradford
    Member
    Posted 1 year ago #

    This is kind of related. The "Continue Reading" link that is displayed when an excerpt is used links to the promotion link, not the custom URL. In the end it goes to the custom URL, but I would like it to be consistent. Any thoughts?

  9. Micah
    Member
    Posted 1 year ago #

    You will want to customize the excerpt_more filter to change the "Continue Reading" link in TwentyTen.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic