WordPress.org

Ready to get started?Download WordPress

Forums

Permalink Add On Word (3 posts)

  1. inhouse
    Member
    Posted 1 year ago #

    Hi, I'm trying to add a word to the end of a permalink but I can't seem to get this right. Right now, the "-arbitrary-word" is not appear directly after the permalink. Basically, I'm linking the featured image to a page with the same URL + "-pdf". There's probably a cleaner way of doing this but I can't find a way.

    Current URL
    domain.com/page-name/-pdf

    Desired URL
    domain.com/page-name-pdf

    echo '<a href="' . $permalink = get_permalink($post->ID) . '-pdf' . '">
    the_post_thumbnail()
    echo </a>
  2. noahjonah
    Member
    Posted 1 year ago #

  3. inhouse
    Member
    Posted 1 year ago #

    I'm not trying to modify the permalinks across the board. I'm trying get to add a word to the end of the permalink. This is so the featured image links to the secondary page we create. The secondary page has an embedded PDF that opens full screen. The secondary page will always have the same url PLUS the word PDF at the end.

    domain.com/page

    Then the PDF page
    domain.com/page-pdf

Topic Closed

This topic has been closed to new replies.

About this Topic