user3224603
user3224603

Reputation: 11

tumblr: hide all of the post except for one special category on start/homepage

Maybe someone can help me out before I go completly nuts.

I'm trying to figure out a way to hide all postings on the tumblr start/homepage except for one single "featured" category.

I came as far as hiding all postings from the start/homepage by wrapping the tagPage around the posts. this way the posts are only shown on my static pages which is exactly what i want except the fact, that I would like to have a "featured" category so the newest postings are shown on the homepage.

Simplified this is what i got right now: {block:TagPage} {block:Posts} {block:Text}{/block:Text} {block:/Posts} {block:/TagPage}

I would really really appreciate any help! thanks in advance

Upvotes: 1

Views: 1798

Answers (2)

mikedidthis
mikedidthis

Reputation: 4897

Possible Solutions:

API / Javascript

Use the API to generate the index of posts tagged with featured. Ref: http://www.tumblr.com/docs/en/api/v2

Theme Operators / CSS

Use {TagAsClasses} variable, as mentioned by unor, to visually hide everything but posts tagged with featured. The downsides far out way the good, (downloading content that isn't visually on the page, no index if no featured posts...)

Theme Operators / Post Type

Pick a specific post type and reserve it for feature posts only. You can create an index page using just one post type:

{block:IndexPage}
    {block:Posts}
        {block:Photo}
        /* Photo posts index page */
        {/block:Photo}
    {/block:Posts}
{/block:IndexPage}

Redirect / Tagged URL

Take advantage of Tumblr's URL scheme:

xxx.tumblr.com/tagged/ always exists. Append the tag you want to see, to create a page of featured posts.

Then use your domain host to fetch xxx.tumblr.com/tagged/featured when every xxx.tumblr.com is visited.

This I haven't tested and is just a theory.

Outro

Whatever you decide, make sure you have an index page with content regardless. The API / Redirect solutions may causes issue with search engine indexing if there is no content.

Upvotes: 1

unor
unor

Reputation: 96597

You could use the {TagsAsClasses} variable:

An HTML class-attribute friendly list of the post's tags.

Add it in your theme to your post markup. Then use CSS to hide all posts except those with the tag "featured".

Disadvantage:

  • When the newest 10 (or whatever you configured as per-page post number) posts are not featured posts, the front page would show no posts at all.

Upvotes: 0

Related Questions