• Resolved Tribun

    (@3task)


    Hi!

    For the Top-Rated Table…is it possible to exclude a whole Page with the Childpages from it?

    I mean that the Entry show for all sites but not for Site “celeb” and the Child example:
    /celeb/robert-de-niro/
    /celeb/MilaKunis/
    /celeb/Chuck-Norris/
    ….
    ?
    I dont want to Show the Top Rated Votes for all the Pages in “celeb”..

    Thanks

    https://www.ads-software.com/plugins/rating-widget/

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Leo Fajardo

    (@leorw)

    Hi @3task,

    Automatically excluding all the child pages is not available out of the box. You have to go to RatingWidget > Settings > Pages tab and search for “Specific Visibility Settings”, then click on “Show rating on every Page except the listed Pages”. Enter all the IDs of the pages that you want to exclude separated by commas.

    Thread Starter Tribun

    (@3task)

    Hi Leo and thx for you answer.

    The Problem is, that are view hundert Pages. It is to much for make it manualy.

    Is there a way that I can make this option manualy??
    ex:
    exclude_tree=ID=001
    or something like that what i found for another plugin:

    <?php
    $parent = 001;
    $args=array(
      'child_of' => $parent
    );
    $pages = get_pages($args);
    if ($pages) {
      $pageids = array();
      foreach ($pages as $page) {
        $pageids[]= $page->ID;
      }
    
      $args=array(
        'title_li' => 'All but children of Parent Page ' . $parent,
        'exclude' =>  implode(",", $pageids)
      );
      wp_list_pages($args);
    }
    ?>

    Plugin Author Leo Fajardo

    (@leorw)

    Hi @3task,

    You can edit the code here /ratingwidget2/wp-content/plugins/rating-widget/view/site/top-rated.php so that it will skip the children of 001. That means that you can’t update the plugin in the future, so we don’t really recommend doing that. But if you really want to continue, please open that file and search for $post_id = RatingWidgetPlugin::Urid2PostId($urid);. You can try to replace the code with the following:

    $post_id = RatingWidgetPlugin::Urid2PostId($urid);
    $parent_post_id = wp_get_post_parent_id($post_id);
    if ( 100 !== $parent_post_id && 100 !== $post_id ) {
    	$wp_object = get_post($post_id);
    	$title = get_the_title($post_id);
    	$excerpt = ratingwidget()->GetPostExcerpt($wp_object, 15);
    	$permalink = get_permalink($post_id);
    	$thumbnail = ratingwidget()->GetPostImage($wp_object);
    }

    Just replace 100 with the ID of the parent page.

    Thanks

    Thread Starter Tribun

    (@3task)

    I have make this. unfortunately it dont work.

    I want to show the Ratingts only for this Page:
    https://www.cineglobe.de/filme/
    ID from it is: 65913

    I have make this code in den top-rated.php

    $post_id = RatingWidgetPlugin::Urid2PostId($urid);
    $parent_post_id = wp_get_post_parent_id($post_id);
    if ( 65913 !== $parent_post_id && 65913 !== $post_id ) {
    	$wp_object = get_post($post_id);
    	$title = get_the_title($post_id);
    	$excerpt = ratingwidget()->GetPostExcerpt($wp_object, 15);
    	$permalink = get_permalink($post_id);
    	$thumbnail = ratingwidget()->GetPostImage($wp_object);
    }

    Is this correct?

    https://www.cineglobe.de/charts/filmarchiv-charts/ this is the result.
    Curb and User is antother Child Page.

    Can you help me with this again, please?

    Thank you!

    Plugin Author Leo Fajardo

    (@leorw)

    Hi @3task,

    When I looked at the HTML source of the “Curb” page, I noticed that its parent ID is 69043 and not 65913. Could you please explain?

    Thanks

    Thread Starter Tribun

    (@3task)

    argh your right I have confused

    I change it to:

    $post_id = RatingWidgetPlugin::Urid2PostId($urid);
    $parent_post_id = wp_get_post_parent_id($post_id);
    if ( 69043 !== $parent_post_id && 69043 !== $post_id ) {
    	$wp_object = get_post($post_id);
    	$title = get_the_title($post_id);
    	$excerpt = ratingwidget()->GetPostExcerpt($wp_object, 15);
    	$permalink = get_permalink($post_id);
    	$thumbnail = ratingwidget()->GetPostImage($wp_object);
    
    }
    					$wp_object = get_post($post_id);

    But no effect. Still is the Curb you… Page/Post in der Rating Chart List:
    https://www.cineglobe.de/charts/filmarchiv-charts/

    Plugin Author Leo Fajardo

    (@leorw)

    I noticed an extra line. The code should look like this: https://prntscr.com/7l6tyn

    If you continue to have this problem, please contact us using the form here https://rating-widget.com/contact/ and provide a temporary administrator access to your site so that we can investigate further.

    Thanks

    Thread Starter Tribun

    (@3task)

    Great this work THANK YOU!!!!!!!

    One last thing please.

    How can I make another Page dissable /exclude like the id 69043?
    There is some other Page where I want to exclude with the ID 74

    Plugin Author Leo Fajardo

    (@leorw)

    Cool ??

    Please try this:

    $exclude_parent_ids = array(
    	69043,
    	74
    );
    
    $post_id = RatingWidgetPlugin::Urid2PostId($urid);
    $parent_post_id = wp_get_post_parent_id($post_id);
    if ( !in_array($parent_post_id, $exclude_parent_ids) && !in_array($post_id, $exclude_parent_ids) ) {
    	$wp_object = get_post($post_id);
    	$title = get_the_title($post_id);
    	$excerpt = ratingwidget()->GetPostExcerpt($wp_object, 15);
    	$permalink = get_permalink($post_id);
    	$thumbnail = ratingwidget()->GetPostImage($wp_object);
    }

    https://prntscr.com/7l7b8r

    Thread Starter Tribun

    (@3task)

    THANK YOU!!!!!!!!!! Great!

    Thread Starter Tribun

    (@3task)

    Resolved

    Plugin Author Leo Fajardo

    (@leorw)

    Fantastic!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Exclude all Child Pages’ is closed to new replies.