반응형
요소 또는 페이지 작성기 단축 코드 문제
Elementor Wordpress 페이지 빌더를 사용할 때 이상한 문제가 발생합니다.
커스텀 쇼트 코드를 작성하고, 임의의 페이지 위치에 삽입하면, 페이지 상부에도 표시됩니다만, 편집 모드입니다.
페이지 맨 위:
쇼트 코드를 삽입할 장소:
관련 없는 사이트의 이 답변이 이 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');
다음으로 작업 예를 제시하겠습니다.
function name_it( ){
ob_start();
function_name();
$content = ob_get_clean();
return $content;
return function_name();
}
add_shortcode( 'shortcode_name', 'name_it' );
function_name()을 보고 function_name(); 행을 반환하면 오류가 발생하지 않습니다.
언급URL : https://stackoverflow.com/questions/46284324/elementor-page-builder-shortcode-issue
반응형
'programing' 카테고리의 다른 글
스프링 부트에서의 휴지 상태 필드 이름 지정 문제(이름 지정 전략) (0) | 2023.03.12 |
---|---|
if 스테이트먼트(ng-click) (0) | 2023.03.12 |
html5 플레이스 홀더를 동적으로 변환하는 방법 (0) | 2023.03.12 |
Wordpress에서 사용자 지정 페이지를 만드는 방법 (0) | 2023.03.12 |
TypeScript에서 유형을 null로 선언하려면 어떻게 해야 합니까? (0) | 2023.03.12 |