Skip to:
Content
Pages
Categories
Search
Top
Bottom

Is there a buddypress conditional tag to show a user’s primary blog?

  • Avatar of gregfielding
    gregfielding
    Participant

    @gregfielding

    something where if a user has created blogs, this will get their primary blog URL?

Viewing 1 replies (of 1 total)
  • Avatar of Nm
    nm
    Participant

    @nahummadrid

    this was working before 1.5

    `
    function my_blog(){
    global $bp;
    if ( !function_exists(‘bp_blogs_install’) )
    return false;

    if ( !$blogs = wp_cache_get( ‘bp_blogs_of_user_’ . $bp->displayed_user->id . ‘_inc_hidden’, ‘bp’ ) ) {
    $blogs = bp_blogs_get_blogs_for_user( $bp->displayed_user->id, true );
    wp_cache_set( ‘bp_blogs_of_user_’ . $bp->displayed_user->id . ‘_inc_hidden’, $blogs, ‘bp’ );
    }

    if ( is_array( $blogs ) && (int)$blogs ) {

    $blog=array_pop($blogs);//the first blog

    ?>

  • <a href="siteurl; ?>”>
  • <?php
    }
    }
    `
    I don’t recall now where I found it. If anyone knows how to fix for 1.5 that would be nice.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.