WordPress.org

Ready to get started?Download WordPress

Forums

  1. thefruitfly
    Member
    Posted 1 year ago #

    Can anybody tell me the filename where the plugin is pulling the Website Topic list from?

    The list is rather limited, and one would think there'd be an option to add a topic to the list.

    I've sifted through most of the PHP code and I can't find where they're grabbing that list from.

    My thanks

    http://wordpress.org/extend/plugins/nextgen-facebook/

  2. JS Morisset
    Member
    Plugin Author

    Posted 1 year ago #

    It's in lib/util.php.

    The list is rather limited on purpose, to try and use topic names that search engines and catalogs would use. There's no standard (yet), so the closest I got was the wikipedia list from http://en.wikipedia.org/wiki/Category:Websites_by_topic.

    Instead of editing the code and avoiding future updates, I'd much rather offer you way to modify the built-in list. Here are two options if you have the Pro version:

    - Use the ngfb_og filter to change the topic in the Open Graph meta tags. Add the following to your (child) theme's functions.php file:

    add_filter( 'ngfb_og', 'my_filter_ngfb_og', 10, 1 );
    function my_filter_ngfb_og( $og = array() ) {
        if ( ! empty( $og['og:type'] ) && $og['og:type'] == 'article' )
            $og['article:section'] = 'YourTopicName';
        return $og;
    }

    - The other will be available in the upcoming version. Add your custom topic to the existing topics array. Same thing, add the following to your (child) theme's functions.php file:

    add_filter( 'ngfb_topics', 'my_filter_ngfb_topics', 10, 1 );
    function my_filter_ngfb_topics( $topics = array() ) {
        $topics[] = 'YourTopicName';
        return $topics;
    }

    js.

  3. thefruitfly
    Member
    Posted 1 year ago #

    Thank you!

    The website in question is all about a small plumbing company. I find it absolutely bizarre that according to the Wiki list; the Super-level categories include items such as Fashion, Genealogy and Nostalgia, but positively nothing about things like "Home", "Entrepreneur" or even something as simple as "Services".

    Hacking the plugin, as I read your response, wouldn't be productive because the subject isn't included in the super-list. Way too weird!

    Thanks again - Be well!

  4. JS Morisset
    Member
    Plugin Author

    Posted 1 year ago #

    Well, there's nothing preventing you/us from customizing the list. I chose Wikipedia as the source, only because there wasn't another readily available -- and there's no standard for the 'article:section` meta tag (unfortunately).

    You could use the 'Commerce' topic, or use the techniques outlined above to add your own.

    js.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic