Skip to:
Content
Pages
Categories
Search
Top
Bottom

Hide a blog in blogs lists


  • Alberto
    Member

    @overdrive

    Hi!
    I’ve installed a multisite wordpress with buddypress. One of these blogs will be a store.
    Is there any plugin or hack to hide this blog in every page that blogs are listed?

    Regards

Viewing 1 replies (of 1 total)

  • Alberto
    Member

    @overdrive

    I’m trying to do something like this but only works with no ajax:

    `
    function valid_blog($blog_name) {
    $blacklist = array (‘blog1’, ‘blog2’, ‘blog3’);
    if (in_array(strtolower($blog_name), $blacklist)) {
    return false;
    }else{
    return true;
    }
    }

    function remove_invalid_blogs_from_loop($b, $blogs) {
    $blogs_new = array();
    foreach ($blogs->blogs as $key => $blog) {
    if (valid_book($blog->name)) {
    array_push($blogs_new, $blog);
    }else{
    $blogs->blog_count = $blogs->blog_count-1;
    $blogs->total_blog_count = $blogs->total_blog_count-1;
    $blogs->pag_num = $blogs->pag_num-1;
    }
    }
    $blogs->blogs = $blogs_new;
    return $blogs;
    }

    add_action(‘bp_has_blogs’,’remove_invalid_blogs_from_loop’, 10, 2 );`

    Any idea of what is the best way to do this?

Viewing 1 replies (of 1 total)
  • The topic ‘Hide a blog in blogs lists’ is closed to new replies.
Skip to toolbar