Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #992432

    Hi, I’m implementing an outbrain widget on my site.
    They ask to replace the var DROP_PERMALINK_HERE for the permanent link of the page.

    There is a native template function that I can call? or do I have to add something in the function.php?
    tks

    #992478

    Hey Rafael,

    No, you can paste this code into the text editor (standard wordpress pages) or you can use the “Code” element of the advanced layout builder to embed this widget code into an advanced layout page.

    Best regards,
    Dude

    #992513

    I guess I was not clear.
    How do I make DROP_PERMALINK_HERE the url of the page?
    There is anything already in the template that does that?

    tks

    #992538

    Hey!

    There’s no wordpress or theme shortcode which outputs the page url. However you can add this code to the child theme functions.php file:

    
    function avia_get_permalink_shortcode($atts) 
    {
    	extract(shortcode_atts(array('id' => 0), $atts));
    	return get_permalink($id);
    }
    add_shortcode('av_permalink', 'avia_get_permalink_shortcode');
    

    and then use this shortcode

    
    [av_permalink]
    

    to output the url of the current page. You can also output the url of a specific page by adding the id parameter like:

    
    [av_permalink id=30]
    

    This shortcode would output the url of the page with the id 30.

    Best regards,
    Peter

    #992551

    works! tks

    #992710

    Hi,

    Great, glad you got it working. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.