Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter marepomana86

    (@marepomana86)

    This is what I currently have:

    foreach ($this->catlist->get_categories_posts() as $single){
    //Start a List Item for each post:
    $lcp_display_output .= ‘<li style=\”background-image:url(\”‘ . get_thumbnail($single). ‘;\”\”>’;

    //Show the title and link to the post:
    $lcp_display_output .= $this->get_post_title($single, ‘h5’, ‘lcp_post’);

    //Show comments:
    $lcp_display_output .= $this->get_comments($single);

    //Show date:
    $lcp_display_output .= ‘ ‘ . $this->get_date($single);

    //Show date modified:
    $lcp_display_output .= ‘ ‘ . $this->get_modified_date($single);

    //Show author
    $lcp_display_output .= $this->get_author($single);

    //Custom fields:
    $lcp_display_output .= $this->get_custom_fields($single);

    //Post Thumbnail
    $lcp_display_output .= $this->get_thumbnail($single);

    Do you need to use get_the_post_thumbnail to get the right URL? [see the WordPress Codex for details of its parameters].

    Your code may have posted a bit strangely so I’m not sure I can quite work out what is happening with your quotes and apostrophes, you may need to check those as well.

    Something very odd has happened to the formatting of this set of posts. I am reposting my reply from above in the hopes this will put things back into the right format:

    Do you need to use get_the_post_thumbnail to get the right URL? [see the WordPress Codex for details of its parameters].

    Your code may have posted a bit strangely so I’m not sure I can quite work out what is happening with your quotes and apostrophes, you may need to check those as well.

    @marepomana86 could you please edit your original post to type differently the <li> tag?
    This tag is allowed as part of your message, so if you type it as it is, you will create a new list item. You can add some spaces in it, or type it in a code wrapper (between backticks).

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Display featured image as background image’ is closed to new replies.