[resolved] Certain Posts only visible under one URL (4 posts)

  1. SothaSil
    Posted 3 years ago #


    I was wondering if its possible to do something like.
    Link that will display only posts from certain category, I have situation where my blog is in English, and I also have to post few articles from time to time in my native language. So I would like Exclude those Articles from main blog post list to avoid user frustration, and have separate link that will have feed of only those non-english articles.

    that is overall goal, and I was wondering if I could use vanilla wordpress to set this up, or if there are some handy plugins already for this?

    I have idea where i could try to modify blog post listing function to exclude category, and then setup page to point to category link, but i would really prefer not to mess with WP myself, I have PHP experience but have not modified WP before.

    thanks in advance!

  2. wpismypuppet
    Posted 3 years ago #

    If I were you... I would use query_posts() on my index.php page to alter my main loop to exclude the native language posts. This will keep everything working like normal, but users won't see native language stuff.

    Then, I would create a custom page template in which I would again use query_posts() to create a custom loop that would only gather the native language blog items.

    Give that a shot and let me know if I can offer more assistance. It's not that tough, especially since you have PHP experience, and the pages I gave have ample examples.

  3. SothaSil
    Posted 3 years ago #

    Yay thanx man!

    ok in case anyone else is wondering what I did,
    I have responsive theme and blog was a page so I had edit subtemplate and find query_posts("post_type=post&paged=$paged");
    from there I just added additional search parameter
    you have to use -3 to exclude it, I tried != at first didn't work.

    Then all I had to do was copy subtemplate I just edited, in my case blog-excerpt.php, rename it, edit to remove - from "&cat=-3" and upload. Templates are in content/themes/themename folder.

  4. wpismypuppet
    Posted 3 years ago #

    Good on you for getting it so quick! Glad I could help...

Topic Closed

This topic has been closed to new replies.

About this Topic