2011-08-29 2 views
0

인쇄 된 단어를 HTML 페이지로 래핑하는 앵커 태그를 제거하는 방법을 알아 내려고합니다. 이보다 후의 : 대신php/wordpress에서 인쇄 할 때 텍스트에서 앵커 태그를 제거하는 방법

<a href="something">blog</a> 

은 단지가 될 :

blog 

나는 그것이 모두이 함께 할 수있는 뭔가가 생각한다 :

%1$s 

을 주로 내 코드의이 부분 :

// Prints the string, replacing the placeholders. 
    printf(
     $posted_in, 
     get_the_category_list(', '), 
     $tag_list, 
     get_permalink(), 
     the_title_attribute('echo=0') 
    ); 

새로운 기능을 만들었습니다.

이제 %1$s이 일반 텍스트 형식 대신 범주 이름의 앵커 태그 버전을 생성하는 이유를 알아 내려고합니다.

나는 그것이 부분적으로뿐만 아니라이 함께 할 수있다 생각 해요 : = __

되지도 확인합니다. 원인 정상적인 범주 참조 : %s 대신 %1$s 작동하지 않습니다.

if (! function_exists('designconcepts_posted_under')) : 
/** 
* Prints HTML with title information for the current single post (category title). 
* 
* @since Design Concepts 1.0 
*/ 
function designconcepts_posted_under() { 
    // Retrieves tag list of current post, separated by commas. 
    $tag_list = get_the_tag_list('', ', '); 
    if ($tag_list) { 
     $posted_in = __('%1$s', 'designconcepts'); 
    } elseif (is_object_in_taxonomy(get_post_type(), 'category')) { 
     $posted_in = __('%1$s', 'designconcepts'); 
    } else { 
     $posted_in = __('%1$s', 'designconcepts'); 
    } 
    // Prints the string, replacing the placeholders. 
    printf(
     $posted_in, 
     get_the_category_list(', '), 
     $tag_list, 
     get_permalink(), 
     the_title_attribute('echo=0') 
    ); 
} 
endif; 
+0

가능한 복제본 [PHP - 구문을 다른 것으로 바꾸는 방법?] (http://stackoverflow.com/questions/3388836/php-how-to-rether-a-phrase-with-another/3389140) # 3389140) – Gordon

답변

관련 문제