Giter Site home page Giter Site logo

Comments (4)

frostschutz avatar frostschutz commented on August 21, 2024

There is no variable, unfortunately. You'd have to change code for that (meta.php).

I currently have no plans to support open graph, twitter cards, etc., they have a lot more options, it might be better to handle those in a separate addon.

from mybb-google-seo.

ErikThiart avatar ErikThiart commented on August 21, 2024

Thank you for the reply, I appreciate that.

Dammit, was hoping I can somehow hook into this:

function google_seo_meta_description($description)
{
    global $settings, $plugins, $google_seo_meta;
    if($settings['google_seo_meta_length'] > 0)
    {
        $description = strip_tags($description);
        $description = str_replace(" ", " ", $description);
        $description = preg_replace("/\\[[^\\]]+\\]/u", "", $description);
        $description = preg_replace("/\\s+/u", " ", $description);
        $description = trim($description);
        $description = my_substr($description, 0, $settings['google_seo_meta_length'], true);
        $description = trim($description);
        if($description)
        {
            $plugins->add_hook('pre_output_page', 'google_seo_meta_output');
            $google_seo_meta = "<meta name=\"description\" content=\"{$description}\" />\n{$google_seo_meta}";
        }
    }
}

What I currently did is add all the social meta tags on the site in the headerinclude I am able to dynamically populate the title for each meta tag, it's just the description that is missing a hook.

from mybb-google-seo.

frostschutz avatar frostschutz commented on August 21, 2024

You can change that code:

$google_seo_meta = "<meta name=\"description\" content=\"{$description}\" />\n

to add another meta description tag using the same $description.

from mybb-google-seo.

ErikThiart avatar ErikThiart commented on August 21, 2024

Smart!
Did not think of that... Might build all the Open Graph Tags into that variable...

from mybb-google-seo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.