Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

How to retrieve JSON-LD for use in headless WP?

$
0
0

Replies: 0

Hi all,

I’ve been using WP in a headless capacity for years now and a client has requested that I implement The SEO Framework into a specific project we are working on.

I would like to make use of TSF’s generated JSON-LD so that I might be able to render it within our client-side app, and to do so, I need to be able to retrieve the html_output from init.class.php in a variety of places such as custom endpoint responses, etc.

I know I can access methods via the_seo_framework() but if I run ->html_output without somehow specifying which post to run it against I get the wrong information returned, obviously.

How do I go about using a method such as html_output outside of the WordPress loop?

  • This topic was modified 23 minutes ago by jmikrut.

Viewing all articles
Browse latest Browse all 59525

Trending Articles