Support » Plugins and Hacks » Hacks » make or get permalink for post-format-standard with get_post_format_link

  • I’m writing a theme and added support for alternate post formats (gallery and aside) and WP generates permalinks for them under /type/gallery and /type/aside but it doesn’t generate a permalink for /type/standard (named by WP in new -> post) as the post-format. Here’s a sample code that on a standard post will return NULL.

    $format = get_post_format();
    if ( false === $format ) {
        $format = 'standard'; // WP Default Name
    }
    $format_link = get_post_format_link( $format );
    echo "Link:" . $format_link;

    How would you add a permalink for this format?

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘make or get permalink for post-format-standard with get_post_format_link’ is closed to new replies.