• Resolved fablegod

    (@fablegod)


    Hey Ajay/Team Webber Zone

    How can I hide the Related Posts label or widget heading if the number of related posts is Zero. Other option could be to hide the complete widget if the number of related posts is zero.

    If there is no easy way, I can try tinkering around with code somewhat but which file should I look at if I want to achieve either of above.

    Thanks in advance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Ajay

    (@ajay)

    in terms of content it should happen automatically if you select blank output option in the settings page.

    I think the issue is with the widget that I will also look into. This is the code that displays the title and one thing to see would be if the output is <div id="crp_related"></div> then to not display the title.

    Thread Starter fablegod

    (@fablegod)

    Thank you

    Thread Starter fablegod

    (@fablegod)

    Thank you Ajay. I wrapped output in an if function and it seems to work. Sharing the changes I made.

    $flag = get_crp ($arguments);
    if (strlen($flag)<>29) {
    			$output = $args['before_widget'];
    			$output .= $args['before_title'] . $title . $args['after_title'];
    			$output .= get_crp( $arguments );
    			$output .= $args['after_widget'];
    			echo $output;
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to hide Related Posts if there are no posts’ is closed to new replies.