[plugin: random_post_link] Trying to get it to only show post from same cat. (1 post)

  1. johnirsk8r
    Posted 4 years ago #

    hi i been looking everywhere i cant find anything on this. I found code to make it use a one category.
    this goes in the functions.php

    function my_random_post_args($args) {
    $args['category_name'] = 'cat-slug-here';
    return $args;
    add_filter('random_post_args', 'my_random_post_args');

    it works like a charm for one cat. but i want it to work for all my cats

    link to plugin

    [ Please do not bump, it's not permitted here. ]

Topic Closed

This topic has been closed to new replies.

About this Topic