Viewing 1 replies (of 1 total)
  • Create a template as described in the documentation. Then you can rearrange the output as you like.

    I wanted the thumbnail, title and excerpt (which I’m using as a description) in divs so I could rearrange them. Then I added the lcp_post and lcp_excerpt to my child theme’s stylesheet to modify their styles without touching the original files.

    Here’s part of my template:

    foreach ($this->catlist->get_categories_posts() as $single){
      //Start a List Item for each post:
      $lcp_display_output .= "<div>";
    
      //Post Thumbnail
      $lcp_display_output .= $this->get_thumbnail($single);
    
      $lcp_display_output .= "</div>";
    
      //Show the title and link to the post:
      $lcp_display_output .= $this->get_post_title($single, 'div', 'lcp_post');
    
      /**
       * Post content - Example of how to use tag and class parameters:
       * This will produce:<p class="lcp_content">The content</p>
       */
      $lcp_display_output .= $this->get_content($single, 'p', 'lcp_content');
    
      /**
       * Post content - Example of how to use tag and class parameters:
       * This will produce:<div class="lcp_excerpt">The content</div>
       */
      $lcp_display_output .= $this->get_excerpt($single, 'div', 'lcp_excerpt');
    
      $lcp_display_output .= "<div class='separator'></div>";
    
      // Get Posts "More" link:
      $lcp_display_output .= $this->get_posts_morelink($single);
    
    }
    
    // Close the wrapper I opened at the beginning:
    $lcp_display_output .= '</div>';
    
    // If there's a "more link", show it:
    $lcp_display_output .= $this->catlist->get_morelink();
    
    //Pagination
    $lcp_display_output .= $this->get_pagination();
    
    $this->lcp_output = $lcp_display_output;

    Hope this helps.

Viewing 1 replies (of 1 total)
  • The topic ‘Display thumbnail before title’ is closed to new replies.