Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • rachpape37

    (@rachpape37)

    Yves,

    Thank you for your kind reply! I finally figured it out with the help of another forum friend, this is the function that worked in my footer.php:

    a href="<?php echo get_permalink( pll_get_post (6668) ); ?>">
    <?php
    if ( 'en_US' == get_locale() )
        echo 'Acupuncture';
    else
        echo 'Acupuntura'; ?></a>
    Thread Starter rachpape37

    (@rachpape37)

    Oh yes, it finally worked! Thank you so much!

    My final solution looked like this :

    a href="<?php echo get_permalink( pll_get_post (6668) ); ?>">
    <?php
    if ( 'en_US' == get_locale() )
        echo 'Acupuncture';
    else
        echo 'Acupuntura'; ?></a>
    Thread Starter rachpape37

    (@rachpape37)

    I also tried this function, but also did not retrieve the page in Spanish:

    <a href="<?php echo esc_url( get_permalink( get_page_by_title( 'Monthly Events' ) ) ); ?>"><?php esc_html_e( 'Monthly Events', 'textdomain' ); ?></a>

    Thread Starter rachpape37

    (@rachpape37)

    Hi Chrysti,

    I am sorry, I really do not know php, so I am not sure how to write the id correctly. I would like to use the page title as the id, that is why I wrote Acupuncture, because this is the name of the page.

    Thread Starter rachpape37

    (@rachpape37)

    Hi again,

    I have tried to get it to work, but now the link does not work, could you see where I am incorrect in the below code: ?

    <a href="<?php echo get_permalink( pll_get_post ($Acupuncture) ); ?>">
    <?php
    if ( 'en_US' == get_locale() )
        echo 'Acupuncture';
    else
        echo 'Acupuntura'; ?></a>
    Thread Starter rachpape37

    (@rachpape37)

    Hi Chrysti!

    Thank you for the reply, where do I place this function? In my theme’s function.php ?

    thanks!

    rachpape37

    (@rachpape37)

    Hi ypeynaud & Chouby!

    I am having a similar problem. I have created a custom footer and inserted the proper php code so the strings would translate, but the links in the footer always go to the English version of the page and not the Spanish. I have been searching for solutions…
    Any help Chouby?

    My test site is: test.bcnwellwoman.com
    Here is a snippet of the footer code:
    <li><a href="https://test.bcnwellwoman.com/en/services/acupuncture/"><?php _e("Acupuncture", "wellnesscenter-child"); ?></a></li>

    Thanks you for helping me find a solution!
    Best,
    Rachel

    Thread Starter rachpape37

    (@rachpape37)

    Sorry the code did not display correctly :/

    this is it:

    <li><a href="https://test.bcnwellwoman.com/en/services/acupuncture/"><?php _e("Acupuncture", "wellnesscenter-child"); ?></a></li>
                <li><a href="https://test.bcnwellwoman.com/en/services/massage/"><?php _e("Massage", "wellnesscenter-child"); ?></a></li>
    rachpape37

    (@rachpape37)

    Thank you so much for posting this!

    I am having the same exact issue, plugin ignores anything after the hashtag, thus none of my anchor links work!

    I hope polylang will resolve this issue as soon as possible !

    Thanks!

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