Issue on Getting Custom post type Thumbnail’s URL

The href attribute you are passing under the_post_thumbnail() is incorrect. Note that this attribute is applied to the img tag which obviously doesn’t supports href attribute. It would be better to wrap the_post_thumbnail() with an <a> tag. So it will look something like the following: echo ‘<a href=”‘ . get_permalink( $thumbnail->ID ) . ‘”>’ . … Read more

Permalink with a Category and then a Post

/football is not a valid permalink natively because taxonomy base /category/football is used to reliably distinguish permalinks between different objects (or you might get unholy collisions). There are some answer on this site (as well as plugins around, for example FV Top Level Categories) for removing category base but it’s considered highly error–prone configuration.

Permalink for PDF of article

Using add_rewrite_endpoint <?php if ( ! class_exists( ‘PDFRewriteEndpoint’ ) ): class PDFRewriteEndpoint { /** * Add actions and filters in constructor. */ public function __construct() { add_action( ‘parse_request’, array ( $this, ‘sniff_requests’ ), 0 ); add_action( ‘init’, array ( $this, ‘add_endpoint’ ), 0 ); } /** * Add rewrite rules. */ public function add_endpoint() { … Read more

Echo title with permalink

This is the problem: $link = the_permalink(); Replace it with: $link = get_permalink(); Notice that the WordPress the_* functions will echo the output, but get_* will return it. But of course there are exceptions to this rule 😉 So you don’t need this: echo the_title(); Just use this instead: the_title(); or the usage example given … Read more

How Do I get the author’s page id?

It sounds like you need get_author_posts_url() which “Gets the URL of the author page for the author with a given ID.” If you have set the custom permalink correctly it should work. If you really are looking for actual page IDs, there is no page ID for an author archive page. Those pages are dynamically … Read more

Permalink for specific page name

In your .htaccess you should be able to do something like what is shown by Chris Coyier on CSS Tricks. Link to example by Chris Coyier: https://css-tricks.com/snippets/htaccess/subdirectories-redirect-query-string/ Since you don’t have .php in your URL, WordPress has most likely already created RewriteEngine rules for you to not need .php. But the result should still work … Read more