2013-08-30 5 views
0

그래서 기본적으로 나는 Showbiz라는 플러그인을 편집하려고합니다. 그들은이 같은 제목과 같은 게시, 저자, 날짜로부터 표준 메타 데이터를 호출 내가 원하는 무엇워드 프레스에서 메타 데이터 호출하기

$title = $this->getValue("title"); 
$alias = $this->getValue("alias"); 
$urlImage = $this->imageUrl; 
$text = $this->getValue("slide_text"); 

$link = $this->getValue("link"); 
if(empty($link)) 
    $link = "#"; 

$date = $this->getValue("date"); 

$dateModified = $this->getValue("date_modified"); 
$excerpt = $this->getValue("excerpt"); 

$youtubeID = $this->getValue("youtube_id"); 
$vimeoID = $this->getValue("vimeo_id"); 
$authorName = $this->getValue("author_name"); 
$numComments = $this->getValue("num_comments"); 
$catList = $this->getValue("catlist"); 
$tagList = $this->getValue("taglist"); 
$postID = $this->id; 

//replace the items in the html 
$html = $this->replacePlaceholder("title", $title, $html); 
$html = $this->replacePlaceholder("id", $postID, $html); 
$html = $this->replacePlaceholder("alias", $alias, $html); 
$html = $this->replacePlaceholder("name", $alias, $html); 
$html = $this->replacePlaceholder("image", $urlImage, $html); 
$html = $this->replacePlaceholder("content", $text, $html); 
$html = $this->replacePlaceholder("link", $link, $html); 
$html = $this->replacePlaceholder("date", $date, $html); 
$html = $this->replacePlaceholder("modified_date", $dateModified, $html); 
$html = $this->replacePlaceholder("excerpt", $excerpt, $html); 
$html = $this->replacePlaceholder("youtube_id", $youtubeID, $html); 
$html = $this->replacePlaceholder("vimeo_id", $vimeoID, $html); 
$html = $this->replacePlaceholder("author", $authorName, $html); 
$html = $this->replacePlaceholder("numcomments", $numComments, $html); 
$html = $this->replacePlaceholder("catlist", $catList, $html); 
$html = $this->replacePlaceholder("taglist", $tagList, $html); 

내 사용자 정의 포스트 유형의 데이터를 호출합니다. 일반 템플릿 파일에서이를 수행하려면 다음을 추가하십시오.

get_post_meta(get_the_ID(), 'META_DATA_NAME', true); 

템플릿에 추가하는 방법을 모르겠습니다. 아래 코드를 추가하려고 시도했지만 아무런 가치가 없습니다. 누구든지 아이디어가 있습니까? 감사.

+0

'StrackOverfrow'와 같이'title' 또는'alias'에 이국적인 이름을 입력하십시오. 데이터베이스를 검색하십시오. 이제 당신은 당신의'meta_data_name'을가집니다. – brasofilo

답변

0

getValue 함수는 모든 포스트 메타 또는 쇼 비즈에 알려진 함수에서만 작동합니까? 시도 했습니까 ...

+0

나는 그것을 시도했다. 그리고 가치는 아직도 돌아 가지 않는다 – Packy

관련 문제