WordPress.org

Ready to get started?Download WordPress

Forums

Redirect Single Post to a Category (5 posts)

  1. kyerobertson
    Member
    Posted 2 years ago #

    Hello,

    I'm really struggling with this and cant get it resolved.

    All I want to do is set it up so a post on my main page....when you click it, it takes you to a category page.

    I have tried all of the redirect plugins with no success. I think my theme dislikes them.

    My theme is called grid-a-licious.

    Please help, I thought this would be straight-forward, but it's proving to be a nightmare!

  2. mbzo2006
    Member
    Posted 2 years ago #

    I was looking at quick-pagepost-redirect-plugin to see if it did exactly that.
    Also looking at this solution:

    function thisismyurl_redirect() {
    
    	if ( is_single() ) {
    		global $post;
    
    		$post_id = $post->ID;
    		if ( !empty( $post_id ) ) $redirect = get_post_meta ( $post_id, 'redirect', true);
    
    		if ( ! empty( $redirect ) ) {
    			wp_redirect( $redirect, 301 );
    			exit();
    		}
    	}
    
    }
    add_action('template_redirect','thisismyurl_redirect');

    (should be added to your WordPress functions.php file)

    If you get a solution i will be very interested to hear abt it.

  3. mbzo2006
    Member
    Posted 2 years ago #


  4. avinash-woodun
    Member
    Posted 2 years ago #

    wordpress.org/extend/plugins/simple-301-redirects/

    Why dont you use this plugin ?

    avinash-woodun

  5. kyerobertson
    Member
    Posted 2 years ago #

    Hi Avinash,

    Thanks for your reply. I have tried this plugin as well as several others (including redirection) but they don't work.

    Is there any other method?

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic