John Davidson

html - Placing icon inside PHP code on Wordpress

0 comments
Message:


I'm trying to place a custom section in the Astra Wordpress Theme's header under a specific condition, with Custom Layouts feature, but I couldn't manage it properly. The thing is, I wanted to place the location of the featured header images in the header section with a custom icon. The thing is, I'm using the "caption" section of the Wordpress image. I can display only the caption section if it's not empty. My PHP knowledge is not perfect, but I've done the research and found nothing.


Example: top right corner


I could display the caption section of the image but couldn't place the icon before the caption text.


I've tried many combinations, but still nothing.




<link rel="stylesheet" href="https://unicons.iconscout.com/release/v4.0.0/css/line.css">
<div class="featured-image-caption-for-header"
style="position: absolute; top: 10px; right: 10px; text-align: right; font-size: 12px; color: #3A4115;">
<?php $featured_image_caption = the_post_thumbnail_caption(); if( $featured_image_caption ): ?>
<i class="uil uil-camera"> </i>
<?php echo esc_url( $featured_image_caption ); ?>
<?php endif; ?>
</div>


My Answer:
if ( is_front_page() ) {
echo '
';
}
?>

Rate this post

5 of 5 based on 2534 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us