Skip Navigation

[Resolved] Google In-Feed Ads using Blocks

This support ticket is created 4 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 6 replies, has 3 voices.

Last updated by Luo Yang 4 years, 1 month ago.

Assisted by: Luo Yang.

Author
Posts
#1803509

I found help inserting Google In-Feed Ads into a view using the classic editor. However, I can't find anything about it using the Blocks editor. How do I insert Google In-Feed Ads into a View using the Blocks editor?

#1803563

Hello, I don't have any specific information about that ad system, but if you can share the information you have about inserting the ads in the classic editor I'll see if there is a comparable way to insert them in the Block Editor. Do you have a link or some example code available that demonstrates how to add the ads in classic Views?

If it's shortcode-based, then you can place a classic block or paragraph block in the loop section of the View using the Block Editor and paste the shortcode in that block. If it's something more complex, I would need to see more details.

#1803565
#1803567

Google provides a Script for you to insert on the page - generally use an HTML block.

#1803603

Some of the loop-specific features from classic Views do not exist in the Blocks, like the ability to target a specific row or specific item number in a grid. Wrap, index, item, pad, pad-last, and split, for example, do not really exist in the Block editor. So if you need that type of specific customized placement for an ad, classic Views is the best solution. If you just need to insert some JavaScript on the page somewhere, then you could use an HTML block in the block editor to place that code. If you place the HTML block inside the loop of a View, that code will be repeated for each result. If you place the HTML block outside the View's loop, it will be placed on the page once wherever you place that block.

Am I overanalyzing what you want to achieve, or are you trying to place an ad somewhere specific within a grid of results?

#1808935

I would like the ads to appear within the list of post excerpts. I think what you are telling me is I need to use classic views for this. Any chance blocks will add this functionality? Thanks.

#1809519

Hello,

Yes, you are right, view block does not support [wpv-item ...] feature, it needs to use classic view to place the shortcode [wpv-item ...], for example, you can try these:
1) Dashboard-> Toolset-> Settings-> General:
in section "Editing experience", enable option "Show both the legacy and Blocks interface and let me choose which to use for each item I build"

2) Dashboard-> Toolset-> Views, here you can setup views with classic editor, and within the post view's loop, you can design the content template with Blocks editor.