Skip Navigation

[Resolved] Not shown some several post in wpv-loop

This support ticket is created 7 years, 5 months 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 8 replies, has 2 voices.

Last updated by Luo Yang 7 years, 5 months ago.

Assisted by: Luo Yang.

Author
Posts
#520417

I am trying to: insert google adsense code block in to the my wpv-loop on homepage.
I created new post type for show only on my homepage. I have 12 posts But on my homepage show only 10 posts. I think when i add my adsense code used [wpv-item index=5] and [wpv-item index=10] they not show my 2 posts (change them in ordering) on front-end hidden link 🙁 but show advertisement.
In my view:
Content Selection: Post types
Ordering: Menu order
Limit and Offset: no limits

My code

 
<div class="masonry-grid">
<!-- wpv-loop-start -->
<wpv-loop>
  [wpv-item index=other]
<div class="col-lg-3 col-md-4 col-sm-6 col-xs-12 grid-item">
  [wpv-post-body view_template="WordPress Archive 4 - loop item"]
  </div>
 [wpv-item index=5]
      <div class="adsense">
<div style="min-width:250px;min-height:90px;">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- art-right -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-1600766785861567"
     data-ad-slot="6629282616"
     data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
  </div>
  [wpv-item index=10]
  <div class="adsense">
<div style="min-width:250px;min-height:90px;">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- art-right -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-1600766785861567"
     data-ad-slot="6629282616"
     data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
  </div>
   </wpv-loop>
<!-- wpv-loop-end -->
</div>

Thank you for help

#520526

Dear Rostislav,

You are right, you will need to display the content template "WordPress Archive 4 - loop item" in both the 5th and 10th items, for example:

...
[wpv-item index=5]
<div class="col-lg-3 col-md-4 col-sm-6 col-xs-12 grid-item">
  [wpv-post-body view_template="WordPress Archive 4 - loop item"]
  </div>
...

[wpv-item index=10]
<div class="col-lg-3 col-md-4 col-sm-6 col-xs-12 grid-item">
  [wpv-post-body view_template="WordPress Archive 4 - loop item"]
  </div>
...
#520557

And how i can insert my adsense code block to 5,10 place?
I need show all my post in my loop. And insert code between my row.

#520570

you can try this:
find the code:

 [wpv-item index=5]

and

 [wpv-item index=10]

and add the content template codes and adsense codes just below them:

<div class="col-lg-3 col-md-4 col-sm-6 col-xs-12 grid-item">
  [wpv-post-body view_template="WordPress Archive 4 - loop item"]
  </div>
#520637
ineed.jpg
2017-05-05_13-00-51.png

I'll add my code which you advised but it break my loop! see screenshot.
I repeat my question;
I have 12 post i need show all posts and beetween them my adsense code. I try make as in your docementation https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-item (i recently asked https://toolset.com/forums/topic/how-to-insert-adsense-code-in-mansory-grid/) And in fact i get 10 posts and 2 adsense block. (see another screenshot)
How resolved my problem?

#521367

Since it is a custom codes problem, please provide a test site with same problem, and fill below private detail box with login details, also point out the problem page URL and view URL, I need a live website to test and debug. thanks

#521851

I have modified the codes as below:

[wpv-layout-start]
[wpv-items-found]
<div class="masonry-grid">
<!-- wpv-loop-start -->
<wpv-loop>
  [wpv-item index=other]
<div class="col-lg-3 col-md-4 col-sm-6 col-xs-12 grid-item">
  [wpv-post-body view_template="WordPress Archive 4 - loop item"]
  </div>
 [wpv-item index=4]
<div class="col-lg-3 col-md-4 col-sm-6 col-xs-12 grid-item">
  [wpv-post-body view_template="WordPress Archive 4 - loop item"]
  </div>
      <div class="adsense">
<div style="min-width:250px;min-height:90px;">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- art-right -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-1600766785861567"
     data-ad-slot="6629282616"
     data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
  </div>
  [wpv-item index=8]
<div class="col-lg-3 col-md-4 col-sm-6 col-xs-12 grid-item">
  [wpv-post-body view_template="WordPress Archive 4 - loop item"]
  </div>
  <div class="adsense">
<div style="min-width:250px;min-height:90px;">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- art-right -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-1600766785861567"
     data-ad-slot="6629282616"
     data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
  </div>
   </wpv-loop>
<!-- wpv-loop-end -->
</div>
[/wpv-items-found]
[wpv-layout-end]
  <ul class="pagination-container">
[wpv-pagination]
  [wpv-pager-archive-prev-page][wpml-string context="wpv-views"]Попередня сторінка[/wpml-string][/wpv-pager-archive-prev-page]
  [wpv-pager-archive-nav-links]
  [wpv-pager-archive-next-page][wpml-string context="wpv-views"]Наступна сторінка[/wpml-string][/wpv-pager-archive-next-page]
[/wpv-pagination]
  </ul>
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
	[/wpv-no-items-found]

Please test again, check if it is fixed or not

#522311

Thank you. it's look as i need. I see you change only number of post in - [wpv-item index=4] and add adsense code below them? or i'm wrong?

#522351

Yes, you are right, that is what I did

This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.