• Hi!

    I created a WP network of 3 sites, each site for a different language and connected them with Multisite Language Switcher plugin. English site is ‘en’ sub directory and french is in ‘fr’ sub directory (www.mysite.com/en/ and https://www.mysite.com/fr/)

    In templates of my theme, I am displaying posts by their ID.
    Since posts have different IDs on different sites I would like to create a loop that uses post ID depending on current site, so something like this:

    if(url begins with https://www.mysite.com/en){ use post ID 1}
    if(url begins with https://www.mysite.com/fr){ use post ID 2}
    else { use post ID 3}

    Is this possible? is there maybe a more elegant solution?

Viewing 1 replies (of 1 total)
  • Thread Starter Prti

    (@prti)

    Well, as usual, I posted my question after a week of searching for solution and than almost immediately found it:

    <?php $blog_language = get_bloginfo(‘language’); ?>

Viewing 1 replies (of 1 total)
  • The topic ‘Condision of loop – begining of URL’ is closed to new replies.