-1

Here is my problem: I tried to implement custom fields (text) within a post tab. I tried many post tab plugins and the imlementation to template was succesfull... Unfortunately, the content of the custom field is showing always on TOP of the content and not inside... I tried eveything and every plugin, still same issue. I tried so far: WP UI, Post UI, Easy responsive tabs, everything.

My following code:

<?php 
 $tabContent =  the_field('kotoba');
 echo do_shortcode('[restabs alignment="osc-tabs-left" responsive="false"]

[restab title="Tab number 1" active="active"]'.$tabContent.'[/restab]
[restab title="Tab number 1" active="active"]'. the_field('text_field').'[/restab]
[restab title="Tab number 4"]Tab 4 content goes here.[/restab][/restabs]');


?>
1

Well, you use ACF for your custom field, right?

In that case, replace the function "the_field" in your code with "get_field".

the_field echoes the field already, so the field is echoed before your tab shortcodes return from the function do_shortcode and get echoed, which results in "having the content of the field before the tab" stuff.

Happy Coding,

Kuchenundkakao

1
  • Wow, works finally! I cant say how much I'm in debt to you because nowhere could I find the solution and everywhere else people use the_field.
    – Roman
    Jul 18 '14 at 20:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.