• barcarich

    (@barcarich)


    Hi Guys, im getting to grips with wordpress and its going to save me alot of time and effort, its great.

    However i cant seem to get past one problem i have. I have designed a site which is pages only. When you arrive its in english, but on the left sidebar is a dropdown menu which has the option of spanish. I have made pages for all the english site, and also pages for the spanish site. The left bar has a traditional menu in english pointing to each of the pages in the site. I want to be able to change the menu on the left to spanish menu when the site is in english, and move to the spanish pages and vice versa.

    Is there any way to change the left sidebar to spanish depending on which page is being accessed?

    thanks in advance

Viewing 2 replies - 1 through 2 (of 2 total)
  • esmi

    (@esmi)

    Since I don’t have any idea what theme you’re using I can only give you general directions but here goes…

    You’ll first need to create a sidebar for your Spanish visitors. Name itsidebar-es.php.

    Next, create new page template for your Spanish language pages. Use your default page.php as a guide but at the very top of the page, add something like:

    <?php
    /*
    Template Name: Spanish
    */
    ?>

    Then find where it says something like:

    <?php get_sidebar();?>

    Change this to:

    <?php get_sidebar(‘es’);?>

    Save your new template as page-spanish.php and upload to your theme folder.

    When you create a spanish page, ensure that you use your new Spanish template. It should be in the dropdown under Attributes/Template.

    Thread Starter barcarich

    (@barcarich)

    Excellent, thanks, i didnt know you could set up different page templates. Incidentally im using a modified neoclassical 3 column layout.

    Thanks for the help

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change sidebar depending on page’ is closed to new replies.