Wrong display in a post
-
Hi
I’ve found in this post showing-one-pages-content-on-another-page a shortcode which work very well (thanks gabrielcastillo)you can wrap this into a shortcode as well. Paste this in your functions.php file and you can now use the shortcode
” [my_content id=”Enter your page id number” title=Set this to true if you want to show title /] “function get_post_page_content( $atts ) { extract( shortcode_atts( array( 'id' => null, 'title' => false, ), $atts ) ); $the_query = new WP_Query( 'page_id='.$id ); while ( $the_query->have_posts() ) { $the_query->the_post(); if($title == true){ the_title(); } the_content(); } wp_reset_postdata(); } add_shortcode( 'my_content', 'get_post_page_content' );
But I would like to use it in an other shortcode, a tab (I have 3 tab).
My code look like this :
[tabgroup] [tab title="Forum"][my_content id="2149" title="" /][button size=medium style=less_round color=blue align=right url=https://zangomedia.fr/forum]Accéder au Forum[/button][/tab] [tab title="Mes copains"][my_content id="2145" title=""/][button size=medium style=less_round color=blue align=right url=https://zangomedia.fr/friends]Aller voir les copains[/button][/tab] [tab title="Mon Profil"][my_content id="2142" title="" /][button size=medium style=less_round color=blue align=right url=https://zangomedia.fr/profil]Voir mon profil[/button][/tab] [/tabgroup]
The problem is that the post are displays first and outside the tabs…
Here is the result https://zangomedia.fr/salle-commune/If you have any idea to correct it, I would be glad!
Thanks and have fun!
Thibault
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Wrong display in a post’ is closed to new replies.