Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8802773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:10:11+00:00 2026-06-14T01:10:11+00:00

I´m display a slider that get´s the images from custom field, now I need

  • 0

I´m display a slider that get´s the images from custom field, now I need that the slider shows different images depending on the language (es – ca):

This is the code of the slider:

        <a href="<?php the_field('slider_home_1_enlace') ?>">
            <img src="<?php the_field('slider_home_1'); ?>">
        </a>

So I´m creating a conditional tag to load images depending of the language of qtranslate plugin:

        <?php
        _e('<!--:es-->
                <a href="<?php the_field('slider_home_1_enlace') ?>">
                    <img src="<?php <the_field('slider_home_1'); ?>">
                </a>
            <!--:-->
            <!--:ca-->
                <a href="<?php the_field('slider_home_1_enlace_ca') ?>">
                    <img src="<?php the_field('slider_home_1_ca'); ?>">
                </a>
            <!--:-->');
        ?>

I´m a php begginer so I see the problem maybe that the php is inside another php, because this way its not working, if i just put text between tags it works properly for the language.

Any ideas how to syntax this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T01:10:12+00:00Added an answer on June 14, 2026 at 1:10 am

    You need to check language first, using if – else

    detect the language and store it to the variable named $language and then check the condition as below.

    <?php
    if(qtrans_getLanguage()=="es"){
    ?>
      <a href="<?php the_field('slider_home_1_enlace'); ?>">
          <img src="<?php the_field('slider_home_1'); ?>">
      </a>
    <?php
    } else if(qtrans_getLanguage()=="ca"){
    ?>
      <a href="<?php the_field('slider_home_1_enlace_ca'); ?>">
          <img src="<?php the_field('slider_home_1_ca'); ?>">
      </a>
    <?php
    }
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using a custom jQuery slider to display some images and fade through
My problem is I can't get this jQuery slider to start from .1 to
I would like to make a image randomizer/slider that randomly displays an image from
Code (Note that the result will not display properly without the images referenced) I'm
I have this web page I'm developing that displays multiple images of one product
I´m trying to display a list of div with images using the repeater field
I'm making a page where the user gets a javascript slider that goes from
I created an slider that slide all images of my wordpress articles, and if
I have an IBAction instance method that is connected to a slider, and displays
I am using a wpf slider to display the time line in a video

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.