How Do I Embed a Medium Blog Into WordPress?

Embedding a blog into WordPress can be a bit tricky, but there are a few ways to do it. One way is to use the wp_insert_blog() function. This function allows you to embed a blog by using the following code:

__( ‘Blog’, ‘my-site’ ), ‘rewrite’ => array( ‘slug’ => __( ‘blog’, ‘my-site’ ), ), ) ); function my_site_blog() { echo ”

“; echo “

Welcome to My Site’s Blog

“; echo “

“; } add_action( ‘init’, ‘my_site_blog’); ?>

Another way to embed a blog is by using the WordPress media library. To do this, go to Settings > Media and add the blog URL (for example, https://www.

my-site.com/) as a source. Then, add the blog posts and pages as follows:.

__( ‘Blog’, ‘my-site’ ), ‘rewrite’ => array( ‘slug’ => __( ‘blog’, ‘my-site’ ), ), ) ); function my_site_blog() { echo ”

“; echo “

Welcome to My Site’s Blog

“; echo “

“; } add_action( ‘init’, ‘my_site_blog’); /** * Add a new post */ function my_site_add_post() { $newpost = new WPPost(); $newpost->title = __(‘New Post Title’); $newpost->content = __(‘New Post Content’); $newpost->author = get_the_author(); wpdb::execute(“UPDATE wp posts SET title=’$newpost->title’ WHERE id='”.$newpost->ID.

“‘”); } /** * Add a new page */ function my_site_add_page() { $page = new WPPage(); $page->title = __(‘New Page Title’); $page->content = __(‘New Page Content’); $page->publish = true; wpdb::execute(“UPDATE wp pages SET title=’$page->title’ WHERE id='”.$page->ID.”‘”); } /** * Embed the blog */ add_action( ‘wpbeforepublish’, ‘[name=”my-site-blog”],’my_site_embedded’); /** * Embed the blog */ add_action( ‘wpafterpublish’, ‘[name=”my-site-blog”],’my_site_unembedded’); ?>.

Related Posts