Search code examples
tumblr

manipulating tumblr paging: do not count some posts


I'm creating a blog with tumblr and I want that some types of post (the answer block) not to be displayed in the main page.

I already achieved this by changing the default code of my theme into

 {block:Answer}
      {block:TagPage}
        <article class="stat-answer" id="post-{PostID}">
         .......
      {/block:TagPage}
   {/block:Answer}

I basically added the {/block:TagPage}

Howeever it's still counting the posts.

This is a problem. I've many and I want to visualize them in a tag-page, NOT in the main page which will result blank because it counts the post wothout visualizing them.

How can say to tumblr not to count certain type of posts?

How is it possible, editing the html source?


Solution

  • With your additional Tumblr markup you still output Ask posts, but not output the Ask info if it a Tag page.

    I think the problem is in order of cases. Try this code:

    {block:TagPage}
        {block:Answer}
            <article class="stat-answer" id="post-{PostID}">
            …
            </article>
        {/block:Answer}
    {/block:TagPage}
    

    UPD: Due to my experience and this two guides it is impossible to achieve your goal, because of normal behavior of Tumblr, which give you certain number of posts taken quite from database and due to Tumblr-dev logic, you must to output all of those received posts, And Dev's not checking if you are doing it right or not (outputing all received posts or selectively).

    It is impossible to do it with pure Tumblr Markup, because of Theming API simplicity.

    But you can use Tumblr API to get, filter and output only necessary posts. This API have more flexibility, and may be it can help you.