View Single Post
  #4  
Old 03-05-2019, 03:33 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: Blog System: Include an image in the home page section

Hi @welly,

As far as I can see, you can pull post's image from WP using the 'get_the_post_thumbnail' method:
https://developer.wordpress.org/reference/functions/get_the_post_thumbnail/

In that sense, you can edit
Code:
\XLite\Module\QSL\WordPress\View\Plugins\RecentPosts\AWidget
class and define your own version of the getHTMLContentWidget() method which is responsible for displaying the menu widget.

I have just quickly tried to replace this piece of code:
Code:
echo '<h5 class="entry-title"><a href="' . get_permalink() . '" rel="bookmark">' . get_the_title() . '</a></h5>';

with the next one:
Code:
echo '<h5 class="entry-title"><a href="' . get_permalink() . '" rel="bookmark">' . get_the_title() . '</a></h5>'; echo get_the_post_thumbnail();

and it has kind of worked out.

Let me know if you need any further help.

Tony

Quote:
Originally Posted by welly
I have attached two images. One shows what I created in XC4 using xCMS (Smack Digital), and the other shows what I have done so far with XC5 and the Blog System module. Formatting and layout aside, you can see that in the XC4 version, each post shows the image, and that is what I want to create in XC5.

I just don't know how to obtain the image so that I can display and style it.
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote