WordPress.org

Ready to get started?Download WordPress

Forums

Using permalinks breaks breadcrumb (3 posts)

  1. sedios
    Member
    Posted 1 year ago #

    Hello,

    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
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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