2017-09-18 1 views
2

エレメント・ワードプレス・ページ・ビルダーを使用するときに奇妙な問題に直面しています。エレメント・ページ・ビルダーショートコードの問題

カスタムショートコードを作成して任意のページ位置に挿入した後は、ページの上部にも表示されますが、編集モードでのみ表示されます。ページの

トップ:私はショートを挿入したい

Top of the page

場所:

place where i want to insert shortcode

+0

'関数test_shortcodes(;:ここでは、それは次のようになります } add_shortcode( 'test_shortcodes'、 'test_shortcodes'); ' Twenty Seventeenテンプレート 'function.php'ファイルにこの関数を追加しました。 Elementorショートコードウィジェットを使用して私の '[test_shortcodes]'を表示してください。要素で表示されますが、ライブページでは表示されません。 – yeshansachithak

答えて

0

この回答は無関係のサイトには、私はこのElementorの問題を解決する助けました。 https://wp-types.com/forums/topic/shortcode-output-showing-up-in-the-wrong-place/

ob_start();$content = ob_get_clean(); return $content;を私の機能に含めるだけでした。 { リターン '!ショートコードが働いている')

function custom_author_link_function() { 
     ob_start(); 

     coauthors_posts_links(); 

     $content = ob_get_clean(); 
     return $content; 
} 
add_shortcode('custom_author_link', 'custom_author_link_function');