0
我想在每个博客中添加自己的按钮。什么时候会点击我单独的弹出窗口会打开,我的一些计算将在这里完成。类似于Tweet分享工作的权利知道。如何在WordPress的每个博客/博文中添加我自己的自定义按钮
我想在每个博客中添加自己的按钮。什么时候会点击我单独的弹出窗口会打开,我的一些计算将在这里完成。类似于Tweet分享工作的权利知道。如何在WordPress的每个博客/博文中添加我自己的自定义按钮
您可以使用fancybox打开弹出窗口并在弹出窗口中显示您的计算结果。
见下文here
见示例代码的fancybox弹出的演示:
<a class="fancybox" href="#inline1" title="My Calculations"><input type="button" value="Mybtn"></a>
<div id="inline1" style="width:400px;display: none;">
// your calculations here
</div>
感谢朋友们的回答和建议 我解决了这个问题,并在每个岗位增加了一个我自己的按钮。以下是代码。
add_action('the_content','customFields');
function customFields($text)
{
global $post;
if($post->post_type=='post')
{
return $text."<div style='width:100%;text-align:center'><a href=javascript:(function(){var%20url='".$URL;window.open(url,'Yahoo','width=600,height=500');})();><image src='".$imgURL."'/></a></div>";
}
}
你可以发布包含在post.php循环中的PHP吗?没有这个,很难回答你的问题 – terrorfall