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?
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.
Google provides a Script for you to insert on the page - generally use an HTML block.
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?
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.
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.