The MU forums have moved to WordPress.org

Meta Tag Generator Plugin (7 posts)

  1. e32o
    Member
    Posted 17 years ago #

    I have this plugin which works great in Wordpress but doesnt seem to work with WPMU. It doesn't give a error, it just displays default info instead of values from wp_#_postmeta table from database. Here is the plugin code, could anyone see if it can be fixed to work with WPMU, i dont think it would be a issue, just maybe it's not seeing the different tables for each users blog in the database.


    $keywords = '';
    function wr_meta_head(){
    global $posts, $post_meta_cache, $keywords;
    $meta_string = null;
    $description = get_settings('blogdescription');
    foreach ($posts as $post) {
    if ((is_single()) or (is_page())) {
    $id = $post->ID;
    $meta = &$post_meta_cache[$id];
    if(isset($meta['keywords'])){
    $keywords_array = $meta['keywords'];
    $keywords .= ', '.$keywords_array[0];
    }
    if(isset($meta['description'])){
    $description = $meta['description'];
    $description = $description[0];
    }
    }
    }
    $meta_string = sprintf(" <meta name=\"keywords\" content=\"%s\"/>n", $keywords);
    $meta_string .= sprintf(" <meta name=\"description\" content=\"%s\"/>n", $description);
    $meta_string = str_replace('content=", ', 'content="', $meta_string);
    echo $meta_string;
    }
    add_action('wp_head', 'wr_meta_head');

  2. e32o
    Member
    Posted 17 years ago #

    Come on there has got to be a simple fix for this very simple plugin. I just don't know that much scripting to be able to change myself.

  3. Ovidiu
    Member
    Posted 17 years ago #

    which plugin are you trying to use? I was trying to get severall plugins to work, I have some posts about this issue too, but as I got no answer, I moved to a new plugin: http://www.urbangiraffe.com/plugins/headspace2/ this one is working just the way you want it.

  4. andrea_r
    Moderator
    Posted 17 years ago #

    Please remember that often when you don't get an answer it often means a big "I don't know" from everyone.

  5. suleiman
    Member
    Posted 17 years ago #

    ovidiu, did you end up using that plugin in your mu-plugins or plugins folder?

  6. Ovidiu
    Member
    Posted 17 years ago #

    I use it in plugins folder, did not even try putting it in mu-plugins...

    I rethought my strategy, as to auto-activate as few plugins as possible, so if a user needs it, he can activate it,

  7. Ovidiu
    Member
    Posted 17 years ago #

    I have an issue with that headspace plugin, on certain blogs it has a negative sideeffect: if I activate it I can no longer set the options of my widgets, as I cannot click anymore on the options icon of each widget, very weird.

    I tried 3-4 other similar plugins but it seems wpmu does not read the values written by these other plugins.

    can someone who uses a plugin to manually set and / or automatically fill in meta description and meta keywords post here what plugin he uses for this?

About this Topic