Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Contributor dudo

    (@dudo)

    Hi, thank you for using YASR!

    1) Is your plugin using the_excerpt or the_content? YASR works with the_content

    2) No, at the moment this is not possible, sorry!

    Best,
    Dario

    Thread Starter whatsworthseeing

    (@whatsworthseeing)

    Hi Dario.

    1. My home page displays manual excerpts – so I’m guessing the short-code doesn’t work with that? Does it work in archive pages only if you use the automatic excerpt that uses part of the content?

    2. Oh well. Thanks.

    In that case, if the manual excerpt can’t interpret the short-code and the stars can’t be superimposed over the photos, can you think of any other way that I might be able to get the star ratings to appear on the home page?

    Thanks.
    Jason K

    Thread Starter whatsworthseeing

    (@whatsworthseeing)

    Thinking about it – the only elements to appear on the home page are the image (we can’t superimpose), the excerpt (can’t read the short-code) and the title – is there any way to get the post title to display the star rating?

    JK

    Plugin Contributor dudo

    (@dudo)

    You can try this:

    In the plugin dir, open file yasr-shortcode-functions.php and on line 34 (should be an empty one) add this:

    global $post;
    $postid = $post->ID;

    Let me know.
    Best,
    Dario

    Thread Starter whatsworthseeing

    (@whatsworthseeing)

    Oh no.
    I’m having a bit of a crisis.
    I saw your message first on email and pasted it into the functions editor, but on email, it appeared like this:

    global $post;
    $postid = $post->ID;

    Now, I cannot access my website – neither the public facing pages nor the dashboard – as every page I attempt to go to returns this message:

    Parse error: syntax error, unexpected ‘&’ in /home/ukscreen/public_html/whatsworthseeing.com/wp-content/plugins/yet-another-stars-rating/lib/yasr-shortcode-functions.php on line 35

    I tried to delete the addition, with the &, but I cannot revive the website – any ideas?

    Thread Starter whatsworthseeing

    (@whatsworthseeing)

    I think my hosting provider has fixed the problem so I can now try again.
    To be clear – is this where the new code goes:

    extract( shortcode_atts (
    array(
    ‘size’ => ‘large’,
    ‘postid’ => FALSE
    ), $atts )
    );
    global $post;
    $postid = $post->ID;

    if(!$postid) {

    $overall_rating=yasr_get_overall_rating();

    Plugin Contributor dudo

    (@dudo)

    Yes, right there.

    I don’t know why you got thet error before, be sure to paste this

    global $post;
    $postid = $post->ID;
    Thread Starter whatsworthseeing

    (@whatsworthseeing)

    Hi again Dario.

    So – I’ve added that code to line 34 of the shortcode functions file.

    But I don’t understand how this code can help me get the stars visible on my home-page or archive pages – if I paste [yasr_overall_rating] into the post titles or excerpt, it just reproduces the shortcode.

    Having put that code into the file as you suggested, what should I do next?

    Thanks.
    Jason K

    Plugin Contributor dudo

    (@dudo)

    if you’re using the shortcode directly into the template, you’ve to use the do_shorcode function, eg:

    echo do_shortcode( ‘[yasr_overall_rating]’ );

    The code I pasted above on line 34 is to get the post id even outside the_loop.

    I never tested before, so we can just try!

    Thread Starter whatsworthseeing

    (@whatsworthseeing)

    Hi again,
    Thanks for this.

    Unfortunately, I don’t know enough about coding to know what to do with this.
    I’ve built my website using the most appropriate plugins I can find to adapt the theme.

    I’m not sure what it means to “get the post id outside the loop” – I’m not even sure what the loop is! I had a quick skim through the link you attached, but I think you need to understand more about coding for it to make sense.

    Is

    echo do_shortcode( ‘[yasr_overall_rating]’ );

    something else that I need to paste somewhere – and if so, where?

    Or is it not that simple?

    Thanks.
    JK

    Plugin Contributor dudo

    (@dudo)

    How do you generate the excerpt in your homepage?
    Is that a plugin or the theme?
    you’ve just to paste that code in the file of plugin or theme that create the excerpt

    Thread Starter whatsworthseeing

    (@whatsworthseeing)

    OK – I’ve been playing around and I found both some a plugin and a code (add_filter(‘the_title’, ‘do_shortcode’); that allow me to get the stars into the title.

    HOWEVER

    While it works on the page:

    https://whatsworthseeing.com/mission-impossible-rogue-nation-review/

    And it works on the archive pages (I’ve only added shortcode to 3 posts so far):

    https://whatsworthseeing.com/category/reviews/film-review/

    But, while it works on the slider and the stars do appear by each thumbnail, the home-page itself is thrown off kilter. Can you think why this might be? Could be it be something in the YASR code or would it be a problem with the theme?

    https://whatsworthseeing.com/

    Plugin Contributor dudo

    (@dudo)

    Look this screenshoot https://www.anony.ws/image/DGyj seems like you dind’t closed fine some tag

    Thread Starter whatsworthseeing

    (@whatsworthseeing)

    Hi again.
    Yes – I’ve noticed that rogue “> but I don’t know what it is or where it was generated so I don’t know what caused it or how to get rid of it.

    I’ve since noticed that the problem occurs only when I use the short-code in a widget, but there’s nothing wrong with the home-page if the short-code is not in the post-title.

    So the “> is generated (and the images misplaced) when the YASR short-code is used in the post title and when that post features in a widget.

    The short-code works in every other situation and the widgets work in every other situation, so it seems to be a problem with having the short-code in the widgets in the Awaken theme.

    I’ll ask the theme developers if they have any ideas!
    Thanks.
    Jason K

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘No stars on homepage & can they be superimposed on image’ is closed to new replies.