Answer the question
In order to leave comments, you need to log in
How to fix variable output in WordPress (problem between polylang&types )?
Hello everyone, I need advice on how to fix the error.
Site on WP, framework - Genesis (for those who are interested).
The problem is this:
I created a custom post type using the -Types plugin.
The site will support multiple languages, so I used a great plugin called - Polylang.
I made the output of the fields using a hook (respectively, I "inserted" all the outputs into the function) - since why then Genesis ...
So, all the fields were safely displayed as usual, but since the site is in several languages - before and after certain fields I needed to display independent information from the user, which should change when changing the language.
That is -
***
if ( $specialty_of_doctor ) {
echo ' Specialization: ' . $specialty_of_doctor . '';
}
***
After looking at the polylang documentation - I registered the string and tried to output it.
The line was displayed, when changing the language it changes and this is what happened:
***
$pl_specialty_of_doctor = pll_e('Specialty');
***
if ( $specialty_of_doctor ) {
echo " $pl_specialty_of_doctor : " . $specialty_of_doctor . "";
}
***
Everything is fine except for one BUT! -
My created variable for translation is displayed not in the paragraph as it should, but
through entry-content ::before (after the div block) and weighs incomprehensibly where .
Perhaps someone can explain to me what the problem is, I will be very grateful.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question