The MU forums have moved to WordPress.org

Featured Posts Blog Name (8 posts)

  1. GhostPool
    Member
    Posted 14 years ago #

    I'm using the Featured Posts plugin from wmpudev.org.

    Unfortunately instead of displaying the blog name is displays ">>>".

    echo $blog_name . '>>>';

    Is it possible to replace ">>>" with the actual name of the blog.

  2. dsader
    Member
    Posted 14 years ago #

    If you're featuring one blog at a time, then I'd instead use something more familiar with the usual WP template tags. Plunk something like this straight into your template.

    switch_to_blog($id);
    
    // The usual WP Loop stuff commonly found in an index.php of a theme
    // http://codex.wordpress.org/The_Loop
    
    echo get_blog_option($id, 'blogname');
    
    restore_current_blog();
  3. GhostPool
    Member
    Posted 14 years ago #

    The Featured Post plugin pulls a random post from a random blog and displays it where you want - I'm not sure if what you're suggesting can do that?

  4. andrea_r
    Moderator
    Posted 14 years ago #

    How old is the plugin? And which one? (please provide a link to the exact plugin)

  5. GhostPool
    Member
    Posted 14 years ago #

    It's not too old. The link is here: http://wpmudevorg.wordpress.com/project/Featured-Posts

  6. andrea_r
    Moderator
    Posted 14 years ago #

    In terms of the codebase, yes it is old. :) It quite likely does not work on the latest version of MU.

  7. GhostPool
    Member
    Posted 14 years ago #

    It works fine for me on 2.7.1. I just what the ">>>>" replaced with the actual blog name.

  8. sethkeever
    Member
    Posted 14 years ago #

    Hi GhostPool,

    I had the same problem as you, but there's an easy fix.

    Go to line 33 of featured-posts.php and replace

    $blog_name = $wpdb->get_var("SELECT option_value FROM $blog_options_table WHERE option_name = blogname");

    with

    $blog_name = get_blog_option($featured_blogs[$random], 'blogname');

    Problem solved.

    -sk

About this Topic

  • Started 14 years ago by GhostPool
  • Latest reply from sethkeever