John Davidson

php - Wordpress embed post

0 comments
Message:


I code my own Wordpress theme. And when I try to embed post, in front end I just have link title
Blank embed post


But in admin editor I have this:


Normal post embed view


The question is could you tell me how to fix this? I want to see embed post like in editor. Maybe I should add some them support in my functions.php?


Thank you



My Answer:
To fix this issue and display the embedded post in the front end like it appears in the editor, you can add theme support for post thumbnails in your functions.php file.

You can do this by adding the following code to your functions.php file:

php
add_theme_support( 'post-thumbnails' );


This will enable support for post thumbnails in your theme, allowing the embedded post to display with the featured image in the front end.

Additionally, make sure that the post you are trying to embed has a featured image set. You can set a featured image for a post by editing the post in the WordPress admin and selecting a featured image in the Featured Image section.

After adding theme support for post thumbnails and setting a featured image for the post you are trying to embed, the embedded post should display with the featured image in the front end like it appears in the editor.

Rate this post

3 of 5 based on 1535 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us