How to Create a list with same tagged blog articles in a blog article

Posted in: Newspaper
Post count: 148

When I write a blog article I provide it with a tag name. At the end of the blog article I would like to show a list with links to other articles with the same tag (with or without images).
Can you tell me if there is a function for that in Newspaper?
Otherwise I have to include some programming in functions.php. Can you tell where to find that in the Newspaper template?
Thanks!

Post count: 35449

Hi,
If you want to display articles based on a tab slug, use a single post template and edit it with tagDiv Composer, then add a block and in the filter tab, use the tag filter to display only the articles containing that tag slug – https://forum.tagdiv.com/flex-block-settings-guide/ https://i.imgur.com/ioechtM.png
In case that you are using a standard template, you can use the theme panel option for related article and set the type on by tag – https://i.imgur.com/TdRTe4u.png

Post count: 148

Thank for this, works great!
I added a block with the filter configured.
Can you tell how I can prevent displaying this (flex)block if the blog article has no other tag matching blog articles?

  • This reply was modified 11 months by DocDigit.
Post count: 35449

Hi,
If there are no articles under a tag, the block will be automatically hidden.
Thank you!

Post count: 148

I thought that as well but currently it does not.
Pl refer to https://cloudzeeland.nl/gen-z-loopt-het-meeste-risico-door-ai/
where the title of the block still shows: ‘Lees ook’ (dutch for read as well).

Post count: 35449

Hi,
I think I understand what you mean, I think you mean that you have set a title on a block and I think you want that when there is no article available to be shown, the title is not shown either. For this you need to use a js code like the one here https://pastebin.com/t2CnR8fW if you have the possibility to set it directly in the single post template with tagDiv Composer https://i.imgur.com/nko9bss.png if not, the code cna be set in the theme panel > custom code > custom javascript – https://i.imgur.com/0Q15qea.png
Thank you!

Post count: 148

Thanks for your help, will let you know when done.
Best regards

Post count: 148

Solution works great, thanks again!

Post count: 35449

I’m glad it works!

Viewing 9 posts - 1 through 9 (of 9 total)
The forum ‘Newspaper’ is closed to new topics and replies.