• Resolved pritty

    (@pritty)


    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)
  • 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

    (@pritty)

    Hi, I want to add badge in featured image , so i want to add this code in theme file



    $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>';

    }

    }

    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)
  • You must be logged in to reply to this topic.