[Resolved] Custom URL

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Custom URL

Viewing 10 posts - 16 through 25 (of 25 total)
  • Author
    Posts
  • #20726
    Samuel
    Participant

    Hi Tom,

    I made a staging of my website to test things safely and here are the results :

    – I don’t understand why but first function for title is not working anymore.
    – Function for image is working well.
    – Function for button is breaking everything on page.

    To be sure it wasn’t a theme or plugin conflict I deactivated every plugins except WP Show post, it didn’t changed anything. And I switched to Twenty Twenty Theme, same result.

    You can check the test page here : https://test.monvoyageencolombie.com/test-wp-show-post-with-custom-link/

    Here are the filters I put in my child theme function.php :

    /*** AJOUTER FILTRE WP SHOW POST ***/
    
    add_filter( 'wpsp_title_href', function( $href ) {
        $custom_url = get_post_meta( get_the_ID(), 'url-booking', true );
    
        if ( $custom_url ) {
            return $custom_url;
        }
    
        return $href;
    } );
    
    add_filter( 'wpsp_image_href', function( $href ) {
        $custom_url = get_post_meta( get_the_ID(), 'url-booking', true );
    
        if ( $custom_url ) {
            return $custom_url;
        }
    
        return $href;
    } );

    I did’t let the Button function as it’s breaking the page.

    Can you see a light in the darkness ?

    Thanks for your help

    #20809
    Samuel
    Participant

    Hello there, any change you had a look at this ?

    #20826
    elvin
    Participant

    Hi,

    By any chance, have you done any plugin version revert? Can you check w/c version of WPSP is installed?

    The wpsp_title_href filter is a new addition to WPSP v1.2. It is not used on older versions(v1.1.3 or older).

    Perhaps you’ve reverted to an older version which causes the snippet to not work.

    #20831
    Samuel
    Participant

    My bad !
    When it crashed I put the old version back…
    And I installed v1.2 again everything is working great on staging, Image, Title AND Button are redirected to custom url.
    Do you think it’s safe to install it live ?
    Thanks

    #20853
    Tom
    Keymaster

    Yes, you shouldn’t run into any issues. If you do, please let us know and we’ll resolve them 🙂

    #20905
    Samuel
    Participant

    Ok thanks a lot !

    #20909
    Samuel
    Participant

    Sorry,

    I have 2 other questions :

    1 / Is it possible to remove link from Image, Title and Categories ? And just keep the “read more” button as a link ? But just for this type of list with custom url ?

    2 / I have custom categories for these custom posts such as “price” or “type of hotel”. To display my hotel WPSP list I’m using “Towns” as the selected category but is it possible to display the other categories associated ?

    #20916
    Samuel
    Participant

    Adding a 3rd question :

    3 / I found in the forum a script to open link in a new tab, but is it possible to make it work only for my lists with custom url ?

    #20968
    Samuel
    Participant

    For my 1/ and 3/ questions I found a CSS solution : apply class to all my “custom URL” WPSP lists and use the “pointer-events: none” to disable link to title and image.

    #21104
    Tom
    Keymaster

    Disabling the image link can be done like this: https://wpshowposts.com/support/topic/disable-title-links-on-certain-pages/#post-18927

    Disabling the title link isn’t possible at the moment (unless you use CSS like you mentioned above).

    For your other question, just to confirm, you’re wanting to display terms from multiple taxonomies? Any chance you can open a new topic for this?

    Thanks!

Viewing 10 posts - 16 through 25 (of 25 total)
  • You must be logged in to reply to this topic.