• Resolved dauidus

    (@dauidus)


    I’m simply trying to display your SEO Bar on the front-end for any page, post or allowed post type. Essentially, I’m building out an internal front-end content system for our clients, and I’d like to display all relevant information there.

    Is there a function I can hook into? Am I missing something that already exists?

    Thanks in advance, and thanks for an excellent plugin. ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hello, and cheers! ??

    This currently isn’t envisioned, and I doubt it will ever be. The problem lies in that I never intended anything of that to be displayed on the front-end.

    Please note that I’m currently amidst changing the script loader to make way for new Gutenberg, term & taxonomy, and other scripting implementations. So, the example below might break in the next update.

    Nevertheless, this should work… but you must reassess the validity of this on every update.

    header:; // or early footer, the scripts support late-loading.
    	// Initialize scripts. Note: this is and always will be oblivious to the front-end.
    	the_seo_framework()->init_admin_scripts();
    	// Enqueue scripts. PHP 5.6+ shorthand.
    	the_seo_framework()->Scripts()::enqueue();
    
    content:;
    	// Output SEO Bar. You may wish to adjust the $id value.
    	echo the_seo_framework()->post_status( $id = '' );
    

    The default scripts that are now required for the SEO Bar are massive; so this won’t help with page loading time. I may move the SEO Bar styling script in a different file in the next update, which will break the snippet above.

    Please be aware of upcoming changes for the SEO Bar, which may or may not be favorable for your current setup: https://github.com/sybrew/the-seo-framework/issues/415

    In short: Many changes are to come, and if you waited for v3.3.0 (ETA northern hemisphere’s summer), you may have had better luck in a more sustainable solution. That said, feel free to reach out again to affirm the validity of the code above when v3.3.0 is due.

    Thread Starter dauidus

    (@dauidus)

    This is brilliant! Thank you so much!!

    One last thing – is there a way, without iterating through all those spans with javascript, to determine if a page/post id has “tsf-seo-bar-good” for all 6 spans? I’d like to simply display a checkmark if the on-page SEO stuff is set properly for a page.

    I’m almost sure this will be a straight-up javascript hack… all good though.

    Keep doin’ what you’re doin’!

    Thread Starter dauidus

    (@dauidus)

    Nevermind… you can’t really pass a javascript variable to php, so this won’t work. I came up with a work-around.

    Thanks for the seriously great support answering my original question! ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display SEO Bar on Front-End’ is closed to new replies.