Home › Forums › Pro Support › Custom URL
- This topic has 24 replies, 3 voices, and was last updated 2 years, 3 months ago by
Tom.
-
AuthorPosts
-
October 6, 2020 at 1:19 am #20726
Samuel
ParticipantHi 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
October 8, 2020 at 7:59 am #20809Samuel
ParticipantHello there, any change you had a look at this ?
October 8, 2020 at 5:59 pm #20826elvin
ModeratorHi,
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.
October 9, 2020 at 12:51 am #20831Samuel
ParticipantMy 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 ?
ThanksOctober 9, 2020 at 9:34 am #20853Tom
KeymasterYes, you shouldn’t run into any issues. If you do, please let us know and we’ll resolve them 🙂
October 10, 2020 at 3:49 am #20905Samuel
ParticipantOk thanks a lot !
October 10, 2020 at 4:38 am #20909Samuel
ParticipantSorry,
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 ?
October 10, 2020 at 7:03 am #20916Samuel
ParticipantAdding 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 ?
October 11, 2020 at 11:45 am #20968Samuel
ParticipantFor 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.
October 13, 2020 at 11:11 am #21104Tom
KeymasterDisabling 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!
-
AuthorPosts
- You must be logged in to reply to this topic.