Hello world
Within the Newspaper theme there is a single.php page in my child-theme. The single page contains some extra php to filter ads depending what category they are in. For the default post template this is working fine.
When I create a template from a cloud based template and activate that in theme settings to display my single post, could you possible indicate to me, what “single.php override” file can be created for use or is this page dynamically created – the challenge is that the “if elseif” statements no longer fire and the related articles in the footer also no longer are visible.
-
This topic was modified 3 years by
mediax.
Hello @mediax!
For flex blocks, there are some special filters for single template. Read all about it here: https://forum.tagdiv.com/flex-block-settings-guide/
Thank you!
Hello and thanks for the reply.
Thus far I have tried using the add_filter( ‘the_content’, ‘update_post_views’ ); filter – this with success. However – it places the added content right at the start of the Output – ABOVE the TOP MENU ..
Is there any Theme Hook I can use to place the content – either after the main menu or before the TITLE output?
Hello @mediax!
For example, add a flex block in a post, go to the filter tab of the element’s settings, and from the dropdown category filter, you can choose between: Single – More from author, Single – Related by category, Single – Related from tags.
So, for example, “Related from tags” is displaying articles/posts that have the same tags as the one you are currently viewing. You can also select Related and sort it as Random, for example.
Please keep in mind that in order for the flex block to work, it must be placed in a post template.
You can build a sidebar with the TagDiv Composer. Steps:
1. Insert one new row (or delete an existing one).
2. Divide into two columns (2/3 + 1/3).
3. You can add whatever element you want into the second column and consider it a sidebar.
If you do not mean this, then please let me know exactly, with more information (screenshots or videos), what you need to achieve there, so I can help you efficiently.
Thank you!
Hello Bettina
Yes this did help tremendously, thank you. The single post cloud template is now with Related articles.
Please will you upscale the request regarding a filter or action hook that can be use in the cloud template output. (using the default blank template for Single) This was edited and then a Mobile template was created from that content.
The problem for me is – as you have mentioned, that the cloud template is stored in the database. There is no option to do any overrides in the child-theme.
For that reason, the only option then is to use an action or filter hook to adjust content.
Adding the PHP script via shortcode (Insert PHP Code Snippet) / using the theme shortcode block – this did not have any results.
What the script does is filter the correct advert for that category and insert that advert into the post.
Could you perhaps suggest any options that I am not seeing here?
Thank you!