Adding Read More to Embedded Review
-
Here’s what I want > https://www.dropbox.com/s/6iz6c2zzd03gu6n/2019-01-03_174402.png?dl=0
Is it possible?
-
I also wanted to know the custom field name of the book cover.
Hello,
There is a filter for the book description called
rcno_book_description
, so it is possible to append text to the end of that text.For example:
add_filter( 'rcno_book_description', function( $description ) { return $description . '<a href="' . get_the_permalink() . '">Read more</a>'; });
The file path the book cover is stored to the post_meta as
rcno_reviews_book_cover_src
. Is that what you are referring to?Thank you so much.
Just confirming, I’ll add my custom filter to the child theme’s functions.php file. Is that correct?
I implemented it but it’s pointing to the current blog post where that review has been embedded.
I want it to point to the original review post.
The Fetch button too is now not working. It worked fine for 2 days. Now after entering ISBN number, pressing fetch button does nothing.
The embedded review’s star rating
<div>
has an attributedata-review-id="7317"
(example)The number (value) for that attribute is the post ID of the embedded review. Can I grab that attribute’s value/number in the filter to use in
get_the_permalink()
?Or simply, can I get the embedded review’s post ID inside the filter to use in
get_the_permalink()
?-
This reply was modified 6 years, 3 months ago by
Rajeev Edmonds.
ok, I inspected the plugin’s shortcode PHP file and got
$GLOBALS['review_id']
That’s what I needed for
get_the_permalink()
Problem solved.
Sorry to trouble you again.
How to show complete synopsis in the embedded review?
At present, it just shows a partial synopsis with 3 ellipses in the end
for example, xxxxxxxx…
Any filter for the same?
ok used the
rcno_book_description_word_count
filter.Got what we wanted.
Hey,
Sorry about the delay, I am in the -5:00 GMT timezone so these messages came in when I was asleep. I am going to have you make an adjustment to a function for now and I patch it in my next update.
In the file
class-rcno-template-tags.php
go to line 652. The should be the line$out .= apply_filters( 'rcno_book_description', $book_description );
Change it to
$out .= apply_filters( 'rcno_book_description', $book_description, $review_id );
The change the function I gave you to
add_filter( 'rcno_book_description', function( $description, $review_id ) { return $description . '<a href="' . get_the_permalink( $review_id ) . '">Read more</a>'; });
Hello again,
About your question on fetching data via ISBN, that feature will be unavailable for a while as Yahoo has shutdown there YQL service.
See here: https://wordpress.org/support/topic/fetching-data-via-isbn-is-no-longer-working/
I just remembered that the function is missing some params.
It should be
add_filter( 'rcno_book_description', function( $description, $review_id ) { return $description . '<a href="' . get_the_permalink( $review_id ) . '">Read more</a>'; }, 10, 2 );
I’m aware of the timezone differences 🙂
Thanks for providing a better and correct version.
You can mark this thread as resolved.
Thanks!
You’re welcome
-
This reply was modified 6 years, 3 months ago by
- The topic ‘Adding Read More to Embedded Review’ is closed to new replies.