2014-01-06 4 views
1

내 wordpress 사이트에 pinterest 링크를 추가하려고합니다. 여기에 유래에 다음 코드 발견 :WordPress의 Pinterest 링크는 오류를 제공합니다

<?php 
    /*Stuff for Pinterest*/ 
    //getting the permalink 
    $postpermalink = urlencode(get_permalink()); 
    //getting the thumbnail 
    $imageurl = urlencode(wp_get_attachment_url(get_post_thumbnail_id($post->ID))); 
    /*End of Pinterest*/ 
?> 
<a target="blank" href="http://pinterest.com/pin/create/button/?url=<?php echo $postpermalink ?>&media=<?php echo $imageurl ?>" title="Pin This Post">pinterest</a> 

을하지만 그것을 테스트 할 때, 대표자 나에게 다음과 같은 오류 제공 : 나는 다른 링크의 톤을 시도했습니다

Whoops! Parameter 'method' (value link) is not one of unknown, uploaded, scraped, bookmarklet, email, iphone, button, ipad, android, android_tablet, api_sdk, extension, api_other, bad.

을하지만 성공하지. 어떤 아이디어?

답변

0

/*Stuff for Pinterest*/ 
//getting the permalink 
$postpermalink = urlencode(get_permalink()); 
//getting the thumbnail 
$imageurl = urlencode(wp_get_attachment_url(get_post_thumbnail_id($post->ID))); 
/*End of Pinterest*/ 

echo '<a target="blank" href="http://pinterest.com/pin/create/button/?url=' . $postpermalink . '&amp;media=' . $imageurl . '" title="Pin This Post">pinterest</a>'; 
+0

도움을 주셔서 감사합니다.하지만 불행히도 이것은 작동하지 않습니다. – Jando

+0

위의 코드에서 오타가 수정되어 설치 과정에서 제대로 작동합니다. – user3167160

1

은 고객 센터에서이 리소스에 따르면, 당신은 자바 스크립트 링크 어딘가에 페이지 또는 그렇지 않으면 핀이 링크 (나는 우연히 작동하지 않습니다 pinit.js을 포함해야합니다 시도 바로이 같은 문제 오늘) :

https://developers.pinterest.com/pin_it/

이 방법은 당신이 당신의 연결 내부 사용자 정의 그래픽이나 텍스트가 있다면, 그 가 B를 덮어 것입니다 그 일의 단점 y 자바 스크립트 코드 및이 시점에서이 동작을 재정의 할 수있는 방법을 찾을 수 없습니다. 누군가가 발견했거나 pinterest 재정의를 재정의 할 마법 같은 방법을 찾을 수 있기를 희망하여이 페이지를 북마크하고 있습니다.

관련 문제