Can you give us a brief description of what you mean by this question?Is it possible to dynamically Insert x-number of Latest Blog posts in Mailwizz template? Maybe with a shortcode or anything?
YES. That's exactly what I was looking for. But I will love to limit it to the latest 3 blog posts.
Like is explained in this article: https://www.mailwizz.com/kb/embed-xml-rss-feeds-into-your-campaign/ you can use some options:How can I do this if you don't mind?
In this case you need to use: count – integer – the number of items you want to receive back from the feed. Optional.YES. That's exactly what I was looking for. But I will love to limit it to the latest 3 blog posts.
Here's the category feed I was unable to use: https://blim.org.uk/category/jobs/feed/About the second one... Is there any feed example that we can see? We are not aware to handle feed categories anywhere.
<title>Jobs Archives » Black Lives in Music</title>
Thanks, Cosmin.Hello,
I test your feeds and this what I found. At the end, both https://blim.org.uk/category/jobs/feed/ and https://blim.org.uk/feed are returning the same feed, with a small exception. The one having the category in the url is having part as a title:
Code:<title>Jobs Archives » Black Lives in Music</title>
Looks like the html entity » is making the XML parser to break. In a well formatted xml feed html entities should not appear.
I will take a look with @twisted1919 to see how to handle this situation on our side.
Bottom line, the issue not the category itself, but the RSS feed content
Cosmin
add_filter( 'rss2_ns', function(){
echo 'xmlns:media="http://search.yahoo.com/mrss/"';
});
// insert the image object into the RSS item (see MB-191)
add_action('rss2_item', function(){
global $post;
if (has_post_thumbnail($post->ID)){
$thumbnail_ID = get_post_thumbnail_id($post->ID);
$thumbnail = wp_get_attachment_image_src($thumbnail_ID, 'medium');
if (is_array($thumbnail)) {
echo '<media:content medium="image" url="' . $thumbnail[0]
. '" width="' . $thumbnail[1] . '" height="' . $thumbnail[2] . '" />';
}
}
});
Hi @nadworks could you elaborate more on that?
I tried that code snippet, but without success. I changed the yahoo url to my feed, but didn't work either.
I'm using a plug in to show RSS feed (should I try a particular size, like full, medium or thumbnail?), but I tried without it also and didn't work.
Any help will be greatly appreciated.
// display featured post thumbnails in RSS feeds
add_filter( 'the_content_feed', 'featured_image_in_feed' );
add_filter( 'the_excerpt_rss', 'featured_image_in_feed' );
function featured_image_in_feed( $content ) {
global $post, $wp_query;
$postid = $wp_query->post->ID;
$custom_metadata1 = get_post_meta($postid, 'company', true);
$custom_metadata2 = get_post_meta($postid, 'contract_type', true);
$custom_metadata3 = get_post_meta($postid, 'career_stage', true);
$custom_metadata4 = get_post_meta($postid, 'location', true);
if( ! $wp_query->is_comment_feed) {
if ( has_post_thumbnail( $post->ID ) ){
if($custom_metadata !== '') {
// Display custom field data below content
$content = $content."<strong>".$custom_metadata1."</strong><br /><em>".$custom_metadata4."</em>";
}
}
}
return $content;
}