WordPress Permalink Redirect 301

Don’t use php header function it will cause problems within wordpress. WordPress has its own function to make redirects Function Reference: wp_redirect($url, $status_code); Try this: <?php $permalink = get_permalink( $id ); wp_redirect($permalink, 301); exit; ?> Updated: I’ve worked out some code for you Place this below code to your functions.php file: function redirector($post_id) { if … Read more

How to get links to user and tag by its name?

Use the get_user_by and get_term_by functions: // user $user = get_user_by( ‘login’, ‘someuser’ ); if( $user ){ echo get_author_posts_url( $user->ID ); } // tag $term = get_term_by( ‘name’, ‘Sometag’, ‘post_tag’ ); if( $term ){ echo get_term_link( $term ); }

How to translate “Permanent link to” text

one possible way: <?php $link_text = sprintf( __( ‘Permanent link to %s’, ‘youthemetextdomain’), get_the_title() ); ?> <h3><a href=”https://wordpress.stackexchange.com/questions/128312/<?php the_permalink(); ?>” title=”<?php the_title_attribute(); ?>” ><?php echo $link_text; ?></a></h3> get_the_title() returns the title instead of displaying it. The double-underscore function is how WordPress allows strings to be extracted from a theme or plugin for translation.

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