I’ll try to be as clear as I can because it’s pretty difficult to write it down…
Situation: I have WPML (multilingual site) plugin installed and it works perfectly but the problem is that I am using this theme which has custom posts such as Homepage Text and Homepage Boxes and those two posts that appear on my homepage do not have a possibility of translating content into other languages to have that Homepage Text and Boxes in different languages (that part of the WPML plugin just doesn’t appear there). Homepage Text and Homepage Boxes, those two appear on the left side of wordpress – it’s a part of menu, just like Links, Pages or Comments…
I kind of came up with one way of solving this.
I created a few more of these custom posts. Now I have:
Homepage Text (home_text)
Homepage Boxes (home_boxes)
Homepage Text English (home_text_en)
Homepage Boxes English (home_boxes_en)
Homepage Text Russian (home_text_ru)
Homepage Boxes Russian (home_boxes_ru)
There are two pieces of code in index.php for these two custom post. I’ll show you one:
<div id="homepage-text"> <?php query_posts(array( 'post_type'=>'home_text', 'orderby' => 'ASC' )); ?> <?php if ( have_posts() ) while ( have_posts() ) : the_post();?> <h2><?php the_title() ?></h2> <?php the_content(); ?> <?php endwhile; ?> </div><!-- /homepage-text -->
After this, there’s a similar code for Homepage Boxes…
Way of solving: Writing a code which says: “if the address you are coming from says http://www.website.eu – use homepage text and boxes that are home_text and home_boxes; If it’s http://www.website.com/EN – use home_text_en, and so on… I hope you get what I’m saying..
Is here anyone who had enough time to read all of this and would be so kind and write me that piece of code that translates my words into php?
Thank you in advance
- The topic ‘Need someone to translate words into php code’ is closed to new replies.