• Resolved davidanielyan

    (@davidanielyan)


    <?php start_short(); ?>
    [for each=’cat_bernapokhadrumner’ term=’berner’]
    [loop type=’cpt_bernapoxadrumner’ count=’5′]
    <tr onclick=”window.location.href = ‘<?php echo ‘[field url]’; ?>'”>
    <td>[field berner-1]</td>
    <td>[field berner-2]</td>
    <td>[field berner-3]</td>
    <td style=”width: 83px !important”>[field berner-5]</td>
    <td>[field berner-6]</td>
    <td>“>Դիտել»</td>
    </tr>
    [/loop]
    [for-else]
    Նման բաժին գոյություն չունի:
    [/for]
    <?php end_short(); ?>

    This code will display only the one post, becouse I only write it.
    But it display two posts (duplicate of one post) and that posts ID’s is the same.

    Why?
    Please halp me and sorry for my bad english 🙁

    https://ww.wp.xz.cn/plugins/custom-content-shortcode/

Viewing 1 replies (of 1 total)
  • Plugin Author Eliot Akira

    (@miyarakira)

    Hello,

    I think it’s the way [for] is being used. If you want to list post(s) with the matching taxonomy term, you can do it without the [for] loop:

    [loop type=cpt_bernapoxadrumner count=5 taxonomy=cat_bernapokhadrumner term=berner]
      ...
      [if empty]
        Նման բաժին գոյություն չունի:
      [/if]
    [/loop]
Viewing 1 replies (of 1 total)

The topic ‘loop error’ is closed to new replies.