• Resolved pisang20

    (@pisang20)


    Hello

    I’ve been using your plugin since you created it and loveing every minute/day of it. so simple =) At the moment I’m using this snippet

    function thumbs_rating_print($content)
    {
    	return $content.thumbs_rating_getlink();
    }
    add_filter('the_content', 'thumbs_rating_print');

    Its in my child function.php Its small website so i’ve been hiding these buttons on pages with css, but I thought I should learn more coding than simple css and would like your help how to find the place where my website outputs posts and put the code there. my website is http://www.ajuvaba.ee

    Any help is much appreciated. The theme i’m using is Avada.

    https://wordpress.org/plugins/thumbs-rating/

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Ricard Torres

    (@quicoto)

    Hi there,

    Thank you for the kind words.

    I’m not sure how to help you. Every theme is different. What are you trying to accomplish?

    Maybe you can use conditional tags in your functions.php

    https://codex.wordpress.org/Conditional_Tags

    Check it out and let me know.

    Regards

    Thread Starter pisang20

    (@pisang20)

    Thank you for your quick notice. Conditional tags may be something I’m looking for, however not sure how to use them even tho I read the tutorial :D. Maybe I can use the

    in_category( array( 1,2,3 ) )

    but not sure how.

    My goal is to make the buttons appear only on posts. At the moment it also displays on the page. For example if you go to the front page http://www.ajuvaba.ee then you can see that each post have the buttons, which is great, but by default it puts the button at the very bottom of page as well. However I’ve disabled it with css on my home page with this code

    #thumbs-rating-xxxxx {
    display: none !important;
    }

    so you cannot really see the button at the bottom of the page.
    Basically:
    When creating new page I’ve to hide the button at the bottom of page manually with css. So I figured its better to learn and put the right code at the right place so when creating a new page then the page itself doesnt have the buttons. Only posts and single posts.

    Sorry for making this post so long

    Plugin Author Ricard Torres

    (@quicoto)

    Ok so maybe you can try the following:

    Let’s try not a page !is_page()

    function thumbs_rating_print($content)
    {
        if ( !is_page() ){
    
            return $content.thumbs_rating_getlink();
    
        }else{
    
            return $content;
        }
    }
    add_filter('the_content', 'thumbs_rating_print');

    You could also use is_single()

    function thumbs_rating_print($content)
    {
        if ( is_single() ){
    
            return $content.thumbs_rating_getlink();
    
        }else{
    
            return $content;
        }
    }
    add_filter('the_content', 'thumbs_rating_print');

    Good luck !

    Thread Starter pisang20

    (@pisang20)

    Both of them seperately breaks the theme :S.

    Maybe I could use this somehow? <?=function_exists('thumbs_rating_getlink') ? thumbs_rating_getlink() : ''?>

    Plugin Author Ricard Torres

    (@quicoto)

    Does it show any error?

    Thread Starter pisang20

    (@pisang20)

    No, just everything is upside-down basically

    Thread Starter pisang20

    (@pisang20)

    Maybe want login credientals to check it out ?

    Plugin Author Ricard Torres

    (@quicoto)

    No, no please 🙂

    I don’t understand. What do you mean upside-down? A white screen?

    I cannot understand what’s wrong with the code, the conditional tags work that way.

    You’re replacing your code with the one I’ve pasted you, right? Make sure you don’t have it twice, duplicated.

    Thread Starter pisang20

    (@pisang20)

    When I enter the code like this: http://prntscr.com/7g18mk

    then it will show up in front end like this: http://prntscr.com/7g18il

    And same way with is_single()

    Plugin Author Ricard Torres

    (@quicoto)

    Honestly, I don’t understand.

    Generally I would not recommend you editing the theme files directly in WordPress admin. Use FTP and a proper editor.

    I’m afraid not I can help you any further 🙁

    Thread Starter pisang20

    (@pisang20)

    I tried to edit with dreamweaver cs6 as well and uploaded via ftp. Same results 🙁

    Sad that there will be no further help :/

    Plugin Author Ricard Torres

    (@quicoto)

    It’s not that I don’t want to help, I just don’t know how.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘only on posts’ is closed to new replies.