WPIntell

Source evidence

Default image if no posts

On This Day (by Room 34) · support · 2024-10-28T13:09:00+00:00

mixedsentiment
mediumseverity
0.78relevance
4replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

7 / 26 rows with source links

26.9% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

19 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
cueyelink resolved
Hello, first I want to thank you for the great plugin. I am very happy with it. However, I have a question. I use your plugin on the front page and would like to display a default image if there are no posts on a certain date. Could you perhaps indicate what and where I should add this in the (php)code? [on_this_day title=”On this day…” posts_per_page=”1″ show_post_thumbnail=”true” show_post_excerpt=”false” show_post_date=”true” no_posts_message=”Try again later.”] —–> Image <——- There isn’t an option to display an image, just the text no_posts_message parameter. You might try putting an HTML <img> tag in as the value for that, but I don’t think it will work. (I haven’t tested that.) This reply was modified 1 year, 7 months ago by Room 34 Creative Services, LLC . Indeed, that doesn’t work. Tried that before. Too bad. I think it has to be done in the PHP-code. Maybe it’s an idea to think about an extra parameter (image if no posts) 😉 Thanks for the reply I just tested putting an <img> tag into the no_posts_message parameter and it does work. You just need to be sure you don’t have any double quotes in the tag, because the shortcode parser reads them as the end of the parameter value. Since the parameter values are wrapped in double quotes, anything inside can’t have double quotes. If you change them to single quotes, it works. Damn yes! That works. Many thanks. For those interested, here is the syntax: [on_this_day title="On this day..." posts_per_page="1" show_post_thumbnail="true" show_post_excerpt="false" show_post_date="true" no_posts_message="Please try again later <img src='https://your domain/wp-content/uploads/Noortje.webp' alt='Smelly Cat' width='500' height='600'>"] This reply was modified 1 year, 7 months ago by cueyelink .

Comments

4 shown
Room 34 Creative Services, LLC 2024-10-28T13:58:00+00:00

There isn’t an option to display an image, just the text no_posts_message parameter. You might try putting an HTML <img> tag in as the value for that, but I don’t think it will work. (I haven’t tested that.) This reply was modified 1 year, 7 months ago by Room 34 Creative Services, LLC .

cueyelink 2024-10-28T14:10:00+00:00

Indeed, that doesn’t work. Tried that before. Too bad. I think it has to be done in the PHP-code. Maybe it’s an idea to think about an extra parameter (image if no posts) 😉 Thanks for the reply

Room 34 Creative Services, LLC 2024-10-28T15:15:00+00:00

I just tested putting an <img> tag into the no_posts_message parameter and it does work. You just need to be sure you don’t have any double quotes in the tag, because the shortcode parser reads them as the end of the parameter value. Since the parameter values are wrapped in double quotes, anything inside can’t have double quotes. If you change them to single quotes, it works.

cueyelink 2024-10-28T15:37:00+00:00

Damn yes! That works. Many thanks. For those interested, here is the syntax: [on_this_day title="On this day..." posts_per_page="1" show_post_thumbnail="true" show_post_excerpt="false" show_post_date="true" no_posts_message="Please try again later <img src='https://your domain/wp-content/uploads/Noortje.webp' alt='Smelly Cat' width='500' height='600'>"] This reply was modified 1 year, 7 months ago by cueyelink .