get_post_format_link

Community Forums Forums Design Tips and Tricks get_post_format_link

This topic is: not resolved

This topic contains 2 replies, has 2 voices, and was last updated by  rfmeier 1 year, 5 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #42986

    mmjaeger
    Participant
    Post count: 66

    get_post_format_link is supposed to return the archive link to the post-format – it works if a post-format is provided

    now the question is how do I get/create a link that would show all posts that do NOT have a post type assigned or are set to standard?

     

    thanks

    #43812

    rfmeier
    Participant
    Post count: 597

    Hello,

    Someone may have a better explanation at the WordPress Support Forums, but I will give it a try;

    The get_post_format_link() will only return an archive address if you have created a post with the specified format, else it will return false.  From some quick testing, I was not able to get an archive link for a standard, non-formatted post– I was expecting that result.

    If you want to display all posts– excluding excluding post formats– it would be wise to hook the ‘pre_get_posts‘ action within the WordPress API and alter the query to exclude all post formats.

    As a *shameless* plug, I have a plugin that does this for the homepage; Filter Post Formats.  This will allow excluding of post formats on the home page.  It could be extended for archive pages too.

    I am currently unaware if a an archive page (display all posts like the home/blog page) exists.  Someone else may be able to shed some light on that subject.

    I hope this helps or points you in the correct direction.


    #43813

    rfmeier
    Participant
    Post count: 597

    Hello,

    Someone may have a better explanation at the WordPress Support Forums, but I will give it a try;

    The get_post_format_link() will only return an archive address if you have created a post with the specified format, else it will return false.  From some quick testing, I was not able to get an archive link for a standard, non-formatted post– I was expecting that result.

    If you want to display all posts– excluding excluding post formats– it would be wise to hook the ‘pre_get_posts‘ action within the WordPress API and alter the query to exclude all post formats.

    As a *shameless* plug, I have a plugin that does this for the homepage; Filter Post Formats.  This will allow excluding of post formats on the home page.  It could be extended for archive pages too.

    I am currently unaware if a an archive page (display all posts like the home/blog page) exists.  Someone else may be able to shed some light on that subject.

    I hope this helps or points you in the correct direction.


Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.