2009-11-09 5 views
1

어떻게됩니까?WordPress <! - nextpage -> 태그는 실제로 어떻게 작동합니까?

어떻게 든 게시 또는 페이지가 표시되기 전에 구문 분석 된 다음 두 가지 방법으로 분할됩니다. 기본이 어떻게 작동하는지에 대한 문서를 찾을 수없는 것 같습니다.

<?php wp_link_pages($args); ?> 

메서드가 실제로 작동합니다. 사용자가 관련 페이지를로드하기 전에이 모든 처리가 완료되었거나 스캔되어 데이터베이스 내에 별도로 저장됩니까? http://www.digimantra.com/tutorials/wordpress/multipaging-a-single-post-using-wp_link_pages/

워드 프레스에서

답변

2

WordPress는 PHP explode 함수를 사용하여 내용을 '페이지'배열로 분할합니다.

$pages = explode('<!--nextpage-->', $content);

0

는 게시물의 페이지 매김에 대한 책임 wp_link_pages라는 템플릿 태그()가 있습니다. 따라서 this를 the_content() 태그 다음에 추가해야합니다. 다른 모든 WordPress 태그는 다시 아주 간단한 방식으로 함수를 사용자 정의하는 데 도움이되는 몇 가지 매개 변수를 가지고 있습니다. 다음은 wordpress 문서에 정의 된 params입니다.

before (string) Text to put before all the links. Defaults to <p>Pages: 

after (string) Text to put after all the links. Defaults to </p>. 

link_before (string) Text that goes before the text of the link. 

link_after (string) Text that goes after the text of the link. 

next_or_number (string) Indicates whether page numbers should be used. Valid values are: 
* number (Default) 
* next (Valid in WordPress 1.5 or after) 

nextpagelink (string) Text for link to next page. Defaults to Next page. 

previouspagelink (string) Text for link to previous page. Defaults to Previous page. 

pagelink (string) Format string for page numbers. % in the string will be replaced with the number, so Page % would generate “Page 1″, “Page 2″, etc. Defaults to %. 

more_file (string) Page the links should point to. Defaults to the current page. 
+0

그래,하지만 방법은 워드 프레스 페이지를 분할하는 방법을 알고 않습니다이 코드로 setup_postdata 기능에 어떻게됩니까? 태그에 대해 페이지 내용을 어떻게 스캔 한 다음 페이지를 적절한 페이지로 분할합니까? – Simon

관련 문제