# WordPress

> Render Mentionwell posts inside WordPress without writing a plugin.

You don't need a plugin. Two patterns work.

## Pattern A: Server-side proxy + shortcode

In your theme's `functions.php`:

```php
add_shortcode("blogoto_blog", function () {
  $url = getenv("MENTIONWELL_API_URL") . "/api/public/" . getenv("MENTIONWELL_SITE_SLUG") . "/posts?limit=12";
  $response = wp_remote_get($url, [
    "headers" => [ "Authorization" => "Bearer " . getenv("MENTIONWELL_API_KEY") ]
  ]);
  if (is_wp_error($response)) return "";
  $body = json_decode(wp_remote_retrieve_body($response), true);
  $out = '<ul class="blogoto-list">';
  foreach ($body["posts"] ?? [] as $p) {
    $out .= sprintf('<li><a href="/blog/%s">%s</a></li>', esc_attr($p["slug"]), esc_html($p["title"]));
  }
  return $out . "</ul>";
});
```

Use it in any post or page: `[blogoto_blog]`.

## Pattern B: WP REST endpoint

Register a custom endpoint at `/wp-json/blogoto/v1/posts`. Have it call Mentionwell's API server-side, then fetch from your theme's JS.

## Custom domain for posts

Set up a rewrite from `/blog/(.*)` on your WordPress host to a small PHP page that calls the post detail endpoint and renders `post.html`.

> WordPress's own block editor / Gutenberg can stay untouched — Mentionwell sits next to your existing content, not inside it.


---

Canonical URL: https://mentionwell.com/docs/frameworks/wordpress
Live HTML version: https://mentionwell.com/docs/frameworks/wordpress
Section: Quickstarts by stack
Site index for AI ingestion: https://mentionwell.com/llms.txt
Full reference: https://mentionwell.com/llms-full.txt
