how to get permalink

To get a permalink you need to use get_permalink(). Just pass the ID of the post or leave it blank to get the current page in the Loop. wp_localize_script () will render PHP variables on the page that are consumable by JS through a global object that you define. PHP // Register the script wp_register_script( … Read more

Post Title to link to a PDF

I recommend using the plugin Advanced Custom Fields (Very popular plugin). It lets you create fields and manage their values very easily. This way you could just create a new field for file upload and then to pull its information like this- <?php $my_file = get_field(‘my_file’); if( $my_file ) { echo $my_file[‘url’]; echo $my_file[‘alt’]; echo … Read more

How can I link to the author’s page

I depends on whether you want the URL to the authors posts: ‘<a href=”‘.get_author_posts_url( $user->ID ).'”>user posts url</a>’ https://codex.wordpress.org/Function_Reference/get_author_posts_url Or the url to edit the user: ‘<a href=”‘.get_edit_user_link( $user->ID ).'”>edit user url</a>’ https://codex.wordpress.org/Function_Reference/get_edit_user_link

Changing the entire permalink

So for the case where you want to change “lesson” to “learn”, there’s actually a “rewrite” option you could use, if you were the one registering the new post type. Since you are not, however, you have to be a little bit more crafty. Thankfully, WP gives you a hook to modify the post registration … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)