Using permalinks breaks breadcrumb (3 posts)

  1. sedios
    Posted 3 years ago #


    here is a simple example (copied from a single page from my multilingual wordpress site - for running php code inside a static page i use a popular plugin):

    // 1. link of current page
    [php] echo get_page_link($post->ID); [/php]

    // 2. link of a random page
    [php] echo get_permalink(1272); [/php]

    // 3. link of current page again
    [php] echo get_page_link($post->ID); [/php]

    The results are:
    1. "A" (that is good)
    2. "B" (that is good)
    3. "B" -> but i would have expected "A"

    Also, step 2. breaks the breadcrumb on my site: it thinks that it's on "B" currently, even though i just asked for a link from "A". Could you please give me an idea for a workaround? I've also tried get_page_link instead of get_permalink, same results.

  2. krembo99
    Posted 3 years ago #

    maybe stating what is the " popular plugin" could help - it probably modifies the query arguments returned and not resetting it on time ..

  3. sedios
    Posted 3 years ago #

    I'm sorry i wasn't more specific.

    The PHP plugin that i'm using here is

    Allow PHP in Posts and Pages

Topic Closed

This topic has been closed to new replies.

About this Topic