This thread is resolved. Here is a description of the problem and solution.
Problem: If you're experiencing issues with styles not working when your site is translated into another language, such as Swedish, and encountering invisible text in the banner section, the problem might be related to the theme files. Specifically, conditions in the
header.php
file might be set to show content only on pages with a specific ID, which does not account for translated pages having different IDs. Solution: We recommend checking your theme's
header.php
file for conditions that limit content display based on page IDs. You should modify these conditions to accommodate the dynamic nature of page IDs in multilingual setups. Here's an example of how you can adjust the code:
This adjustment ensures that the correct page ID is used for the current language, allowing styles and text to appear as expected.
If this solution does not resolve your issue, or if it seems outdated or irrelevant to your case, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. Additionally, if you need further assistance, please do not hesitate to open a new support ticket with us at WPML support forum.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Background of the issue:
I am trying to get working styles when the site is translated to Swedish. In the primary language (Polish), everything looks fine. The issue can be seen on this page: hidden link.
Symptoms:
Some elements are translated, but styles are not working. The text on the top of the site, in the banner section, is invisible in languages other than the primary one. I expected to see working styles with translation and visible text on the top of the section (banner). Instead, I got invisible text, images, and not working styles.
Questions:
Why are styles not working when the site is translated to Swedish?
Why is the text in the banner section invisible in languages other than Polish?
Thank you for contacting WPML support. I'd be happy to assist you on this issue.
Can you make a small change on the original language, like adding a text and update the translations to see if it helps?
If that doesn't help, To debug this issue further, I would need to check your site settings once, for this I would need temporary access (wp-admin and ftp) to your site.
So could you please provide me with those details, you will find the needed fields for this below the comment area when you log in to leave your next reply. hidden link
This is also due to same issue as I mentioned ahead, on functions text_with_c_pill() you are using page ids and it's affecting the content, please adjust it accordingly.
<?php
/**
* Renders a text component with a "C" shape on one side.
*
* @param string $side 'left' or 'right' (default: 'right') - side where the text appears
* @param string $heading Heading text to display
* @param string $subtext Subtext to display below heading
* @param string $c_image Path to C-shaped image (relative to theme, default: 'assets/big_c.svg')
* @param string $text_color Text color class (default: 'text-white')
*/
if (!function_exists('text_with_c_pill')) {
function text_with_c_pill($side = 'right', $heading = 'DOŚWIADCZENIE', $subtext = 'Lata praktyki w międzynarodowej administracji.', $c_image = 'assets/big_c.svg', $text_color = 'text-white')
{
// Dodaj CSS tylko raz
static $css_added = false;
if (!$css_added) {
echo '<style>
/* Pierwszy breakpoint: 768px do 1280px */ @media (min-width: 768px) and (max-width: 1280px) {
.c-size-md {
width: 60% !important;
}
}
/* Drugi breakpoint: 1440px do 1536px (96rem) */ @media (min-width: 1440px) and (max-width: 1535px) {
.c-size-xl {
width: 80% !important;
}
}
</style>';
$css_added = true;
}
// IMPORTANT: The 'side' parameter specifies where the TEXT appears, not the C shape
// C shape should be on the opposite side from the text
if (is_page(49)):
$c_position = ($side === 'left') ? '2xl:-right-10 md:-right-25 -right-25 -top-5 2xl:-top-10 md:top-0' : '-top-5 md:left-0 2xl:-left-10 2xl:-top-10 md:top-0';
$text_alignment = ($side === 'left') ? 'text-left md:pr-16 pr-35' : 'text-left md:pl-16 pl-10';
$text_spaceing = ($side === 'left') ? '2xl:pl-12 md:pl-35 md:mr-[15vw] 2xl:mr-0 md:pr-[2vw] mt-[8rem]' : '2xl:pr-12 md:pr-35 md:ml-[15vw] 2xl:ml-0 mt-[8rem]';
$sizes = 'h-full 2xl:w-auto w-[20vw] md:w-2/3 c-size-md c-size-xl object-cover ';
elseif (is_page(7)):
$c_position = ($side === 'left') ? '2xl:-right-10 md:-right-25 -right-55 -top-12 2xl:-top-10 md:top-0' : '-top-12 -left-10 2xl:-left-10 2xl:-top-10 md:top-0';
$text_alignment = ($side === 'left') ? 'text-left md:pr-38 2xl:pr-16 pr-35 ' : 'text-left md:pl-16 pl-2 md:pr-0 pr-35';
$text_spaceing = ($side === 'left') ? '2xl:pl-0 md:pl-[5rem]' : '2xl:pr-0 md:pr-20';
$sizes = 'h-full 2xl:w-auto w-1/2 2xl:w-2/3 c-size-md c-size-xl object-cover';
endif;
// Get the theme URI for image paths
$theme_uri = get_template_directory_uri();
I made the changes we were talking about. The last problem is with the site "projekty". I dont see the elements to translate. They are not even visible.
Every ticket is reserved for resolving one specific matter, ensuring focused support, streamlined communication, and high-quality service. Therefore, please open new tickets for your other concerns.