• Resolved cmarico

    (@cmarico)


    I can’t get any of the functions I put into functions.php of my child theme to work. Have tried the one that makes the ‘featured page’ titles to link, as well as one that redirects it to a customer page.

    In this case the page will be a ‘recipe’ page that’s automatically generated by a recipes plugin – similar to an archive for the blog posts.

    How do I link the code that I put in the functions.php to actually choosing the featured page in the menu (which doesn’t exist, as it’s generated like the archive page)?

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter cmarico

    (@cmarico)

    This is the code I’ve been trying

    add_filter('tc_fp_link_url' , 'my_custom_fp_links', 10 ,2);
    //If you are using the featured pages Unlimited Plugin or the Customizr Pro theme, uncomment this line :
    //add_filter('fpc_link_url' , 'my_custom_fp_links', 10 ,2);
     
    function my_custom_fp_links( $original_link , $fp_id ) {
     
        //assigns a custom link by page id
        $custom_link = array(
            //page id => 'Custom link'
            257 => 'http://www.holdthesugar.com.au/wp/recipe',
           );
     
        foreach ($custom_link as $page_id => $link) {
            if ( get_permalink($page_id) == $original_link )
                return $link;
        }
     
        //if no custom title is defined for the current page id, return original
        return $original_link;
    }
    

    Hi,

    You can use the following plugin which allows you to make any post or page link to a custom URL instead of it’s own URL.
    https://ww.wp.xz.cn/plugins/page-links-to/

    You will be able to make your featured page load your recipe archive.

    Thank you

    Thread Starter cmarico

    (@cmarico)

    That worked perfectly, thankyou Denzel Chia

    You are welcome! Glad to be of some help!
    Thank you

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Featured Page Redirect’ is closed to new replies.