• Resolved Neil Shimer

    (@neil-shimer)


    I’m trying to use the snippet for Setting custom links for the featured pages in Customizr to custom link to a post. I copied the code into my child theme functions.php and changed the lines:

    `$custom_link = array(
    //page id => ‘Custom link’
    155 => ‘https://localhost/gr8alt/?p=155’
    );`

    Where 155 is my id and obviously link as well but no additional link appears in my Featured Pages Options. What am I doing wrong here am I missing something?

    Ultimately, what I would like to do is to feature linked to a woocommerce Product Categorie or even a specific Product. If I can get the id and url this should be possible right?

Viewing 2 replies - 1 through 2 (of 2 total)
  • the id on the left should be the id of the featured page you selected.
    Basically you have
    1) Select a page in the featured pages options, whatever page (maybe because you want to use its featured image). And grab the id of that page. Say its id is 40
    2) In that snippet write:

    $custom_link = array(
    //page id => 'Custom link'
    40 => 'https://localhost/gr8alt/?p=155'
    );

    Hope this helps.

    Thread Starter Neil Shimer

    (@neil-shimer)

    I think it has to be a page and can’t be a post or anything else. I just realized there is a premium plugin for something like that but it turned out that I really didn’t need it because I just used the woocommerce shortcodes on a page and then everything worked just fine. Thanks for the reply though!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Setting custom links for posts in Customizr’ is closed to new replies.