Title: Include plugin file in theme file
Last modified: September 3, 2024

---

# Include plugin file in theme file

 *  Resolved [pritty](https://wordpress.org/support/users/pritty/)
 * (@pritty)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/include-plugin-file-in-theme-file/)
 * Hi,
 * how can add plugin file in my wordpress theme file ? the plugin file location
   is public_html/wp-content/plugins/ultimate-post/blocks/template/title.php i want
   to add this file in my theme directory or how i can add custom code

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

 *  [Mahmud](https://wordpress.org/support/users/aamzahid/)
 * (@aamzahid)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/include-plugin-file-in-theme-file/#post-17993295)
 * Hi Pritty, Would you please be more specific about this. You can move the plugin
   files in your theme , But it will requires code customization to works .
 *  Thread Starter [pritty](https://wordpress.org/support/users/pritty/)
 * (@pritty)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/include-plugin-file-in-theme-file/#post-17993314)
 * Hi, I want to add badge in featured image , so i want to add this code in theme
   file
 *     ```wp-block-code
       $premium = get_post_meta($post_id, "premium", true);if (!is_admin() && ($premium==1) && (!is_single())) {$post_loop .= '<style>.badge {position: absolute;top: 0px;width: 80px;font-size: 12px;left:0px;}@media (max-width: 768px) {.badge {font-size: 10px;}}</style><span class="badge"><img src="https://www.debunschoter-online.nl/wp-content/uploads/2022/04/premium_large1.jpg"/></span>';// Sponsor badge$sponsor = get_post_meta($post->ID, "sponsor", true);if (!is_admin() && !empty($sponsor) && (!is_single())) {$post_loop .= '<style>.badge2 {position: absolute;top: 0px;width: 80px;font-size: 12px;left:0px;}@media (max-width: 768px) {.badge2 {font-size: 10px;}}</style><span class="badge2"><img src="https://www.debunschoter-online.nl/wp-content/uploads/2024/06/gesponserd.png"/></span>';}// Video badge$video1 = get_post_meta($post->ID, "video1", true);if (!is_admin() && !empty($video1) && (!is_single())) {$post_loop .= '<style>.badge1 {position: absolute;top: 0px;width: 80px;font-size: 12px;right: 0px;}@media (max-width: 768px) {.badge1 {font-size: 10px;}}</style><span class="badge1"><img src="https://www.debunschoter-online.nl/wp-content/uploads/2024/06/video.png"/></span>';}}
       ```
   
 *  Plugin Support [Owadud](https://wordpress.org/support/users/owadud655/)
 * (@owadud655)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/include-plugin-file-in-theme-file/#post-18007176)
 * Hi there,
   I’ve discussed the badge on featured images with our developer, and
   unfortunately, there are a few complex scenarios involved.
 * As a result, we are unable to accept this as a feature request at this time. 
   
   Thank you for your understanding.

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

The topic ‘Include plugin file in theme file’ is closed to new replies.

 * ![](https://ps.w.org/ultimate-post/assets/icon-256x256.gif?rev=2540610)
 * [Post Grid Gutenberg Blocks for News, Magazines, Blog Websites - PostX](https://wordpress.org/plugins/ultimate-post/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-post/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-post/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-post/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-post/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-post/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [Owadud](https://wordpress.org/support/users/owadud655/)
 * Last activity: [1 year, 9 months ago](https://wordpress.org/support/topic/include-plugin-file-in-theme-file/#post-18007176)
 * Status: resolved