Title: target multiple css elements
Last modified: January 24, 2022

---

# target multiple css elements

 *  Resolved [logft2043](https://wordpress.org/support/users/logft2043/)
 * (@logft2043)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/target-multiple-css-elements/)
 * Hello, I can’t customize the shortcodes as I want.
    I have 3 elements displayed:
   image, title and category Is it possible to include post_title and post_cat in
   a common div? Currently I get each of these elements in a separate div and I 
   would like them to belong to the same one (without including the image)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Contributor [zymeth25](https://wordpress.org/support/users/zymeth25/)
 * (@zymeth25)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/target-multiple-css-elements/#post-15283654)
 * You can do it in a [custom template](https://github.com/picandocodigo/List-Category-Posts/wiki/Template-System).
 *  Thread Starter [logft2043](https://wordpress.org/support/users/logft2043/)
 * (@logft2043)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/target-multiple-css-elements/#post-15284627)
 * Hi [@zymeth25](https://wordpress.org/support/users/zymeth25/) thanks for the 
   answer
 * I found the default.php file and made a copy in my theme folder.
 *     ```
       //Show the title and link to the post:
         $lcp_display_output .= $this->get_post_title($post);
   
         // Show categories
         $lcp_display_output .= $this->get_posts_cats($post);
       ```
   
 * I guess I need to make the HTML structure change here but I’m not sure how to
   do that. Can you direct me to display these 2 elements in a common div?
 * I thank you in advance
 *  Plugin Contributor [zymeth25](https://wordpress.org/support/users/zymeth25/)
 * (@zymeth25)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/target-multiple-css-elements/#post-15291890)
 * Many ways to do it but the simplest one would be:
 *     ```
       //Show the title and link to the post:
       $lcp_display_output .= '<div>' . $this->get_post_title($post);
   
       // Show categories
       $lcp_display_output .= $this->get_posts_cats($post) . '</div>';
       ```
   
 * You can expand this solution by adding attributes to the div, like class etc.
 *  Thread Starter [logft2043](https://wordpress.org/support/users/logft2043/)
 * (@logft2043)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/target-multiple-css-elements/#post-15295324)
 * It worked, thank you very much!
 * But I can’t assign 2 css classes in the shortcode, is it possible? Or do you 
   have to separate them with a special character?
 * Example: [… posts_cats_class=”testcat entry-taxonomies” …]
 * In front, the 2 classes are pasted and therefore unusable
 *  Plugin Contributor [zymeth25](https://wordpress.org/support/users/zymeth25/)
 * (@zymeth25)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/target-multiple-css-elements/#post-15307010)
 * I have just tested it, when I tried `[catlist posts_cats=yes posts_cats_class
   ="test1 test2"]` i got `<span class="test1test2"> Gallery, Images, Jetpack</span
   >`
 * which is clearly not what I intended. I will try to look into it today and push
   an update.
 *  Plugin Contributor [zymeth25](https://wordpress.org/support/users/zymeth25/)
 * (@zymeth25)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/target-multiple-css-elements/#post-15307184)
 * Done, fixed in v0.86.1, multiple CSS classes work as expected. Use single whitespace
   as delimiter like in HTML.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘target multiple css elements’ is closed to new replies.

 * ![](https://ps.w.org/list-category-posts/assets/icon-256x256.png?rev=2517221)
 * [List category posts](https://wordpress.org/plugins/list-category-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/list-category-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/list-category-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/list-category-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/list-category-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/list-category-posts/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [zymeth25](https://wordpress.org/support/users/zymeth25/)
 * Last activity: [4 years, 4 months ago](https://wordpress.org/support/topic/target-multiple-css-elements/#post-15307184)
 * Status: resolved