Theme logo metadata into template file

Ends up that “alt” is not stored in wp_get_attachment_metadata so I pulled it from the post meta: $custom_logo_id = get_theme_mod(‘custom_logo’); if ($custom_logo_id) { $image = wp_get_attachment_image_src($custom_logo_id, ‘full’); $meta = wp_get_attachment_metadata($custom_logo_id); **$alt_text = get_post_meta($custom_logo_id, ‘_wp_attachment_image_alt’, true);** echo ‘<img src=”‘ . $image[0] . ‘” alt=”‘ . $alt_text . ‘” width=”‘ . $meta[‘width’] . ‘” height=”‘ . $meta[‘height’] … Read more

remove enclosure url from feed

You can look if your posts have any assigned enclosure meta keys, that could trigger the rss_enclosure() core function to print the <enclosure> tag. Otherwise you can try this demo plugin: <?php /** Plugin Name: Remove RSS Enclosure **/ add_filter( ‘rss_enclosure’, ‘__return_empty_string’ ); It looks like you’ve a plugin that’s adding the <media:content> tag, e.g. … Read more

How to set a Background image in WordPress?

The way I see, you have 3 options: You can achieve that with CSS. Just target the div you want to put the background in. Target it in a way that only shows at the home of the site (check the ID and class of the body div, it usually has names like ‘home-template’ and … Read more