language 2 not visible using php function for front page
-
The issue can be found here: https://www.nunki.se
The preview works: irrelevant
It works with other themes: Haven’t Tried
It works when I disable all other plugins: Haven’t Tried
Meta Slider version: 3.6.8
———–
Hi,
I can not get MS to display slides on the static home page using the php function in our second language (which is English). The other pages works with multilingual languages but these are created with the shortcodes directly on the page.
I have tried several variants with wordpress conditional both for slug ‘en’ and also for the page ID like:function sus_add_headerslider() { ?> <div class="slider-wrap"> <?php if (is_front_page()) : echo do_shortcode("[metaslider id=27]"); elseif ( is_page( 833 )) : echo do_shortcode("[metaslider id=1040]"); endif; ?> </div> <?php } add_action('thematic_belowheader','sus_add_headerslider');
But looking on the source code does not change MS ID. But if I use the code below, (active on the site right now feb 4 2018) you’ll see in the source code that it retrieves the correct MS ID (which is 1040) but not the images in the ul class.
function sus_add_headerslider() { ?> <div class="slider-wrap"> <?php if (is_front_page()) { $curLang = substr(get_bloginfo( 'language' ), 0, 2); switch ($curLang) { case "en": // english slideshow for english users echo do_shortcode("[metaslider id=1040]"); break; case "se": default: // fallback to swedish slideshow for any other language echo do_shortcode("[metaslider id=27]"); break; } } ?> </div> <?php } add_action('thematic_belowheader','sus_add_headerslider');
On this site, the slider should be just the same so I also tried to have the same MS ID (27) for both. Have also tested with the usual php function, but it does not work either. So the slider on the start page is only visible to the Swedish language.
I would of course want it to appear on both languages.
Anyone who has a solution?The page I need help with: [log in to see the link]
- The topic ‘language 2 not visible using php function for front page’ is closed to new replies.