当前位置:首页 > 代码 > 正文

pinterest代码(pinterest)

admin 发布:2022-12-19 17:50 112


今天给各位分享pinterest代码的知识,其中也会对pinterest进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!

本文目录一览:

pinterest怎么添加pinit

首先在子模板下创建single.php,single.php是文章的默认模板,将会覆盖genesis parent theme中的post模板。拷贝下面任意一组代码到single.php中,保存,访问文章页面就可以看到Pin it按钮。

水平样式

?php

add_action('genesis_post_content', 'pinterest_share_button', 5);

function pinterest_share_button() {

/** Horizontal */

printf('div class="pinterest-button"

a href=";media=%s"

class="pin-it-button" count-layout="horizontal"Pin It/a

script type="text/javascript" src=""/script

/div',

urlencode(get_permalink()),

urlencode(genesis_get_image(array('format' = 'url')))

);

}

genesis();

垂直样式

?php

add_action('genesis_post_content', 'pinterest_share_button', 5);

function pinterest_share_button() {

/** Vertical */

printf('div class="pinterest-button"a href=";media=%s"

class="pin-it-button" count-layout="vertical"Pin It/a

script type="text/javascript" src=""/script/div',

urlencode(get_permalink()),

urlencode(genesis_get_image(array('format' = 'url')))

);

}

genesis();

不显示次数的样式

?php

add_action( 'genesis_post_content', 'pinterest_share_button', 5 );

function pinterest_share_button() {

/** No-count */

printf( '

div class="pinterest-button"a href=";media=%s"

class="pin-it-button" count-layout="none"Pin It/a

script type="text/javascript" src=""/script/div',

urlencode( get_permalink() ),

urlencode( genesis_get_image( array( 'format' = 'url' ) ) )

);

}

genesis();

三段代码的区别在于count-layout=""的参数不同

如果要装饰该按钮,可以通过下面的class选中按钮

.pinterest-button iframe {

margin: 10px 0;

}

pinterest网站窗口好小

由上图对比可以看到,中间部分始终居中,但是会根据屏幕的大小判断一行最多显示多少张图片。让框架居中有多种方法,最常见的是添加 margin:0 auto;

因为我们要让整个屏幕显示至多张图,所以我只要求得屏幕至多能放下多少个图片后,剩下的数平均分给左右外边距,这样即能居中,例如:margin:10px auto

html代码:

div class="container" style="margin:0 auto;"

div class="aside"/div

div class="photo_box"

div class="photo_img"img src="1.jpg" alt="" width="" height="" //div

div class="photo_img"img src="2.jpg" alt="" width="" height="" //div

/div

...

/div

js代码:

$(document).ready($onresize = function(){

var Winh = $(window).width(), Wimg = $(".photo_img").width() + 38,

Wsidebar = $(".aside").width() + 24;

var mainWidth = Winh - Wsidebar;

var imgBs = mainWidth % Wimg; //imgBs为最多放下图片后剩下的余数

var a = Math.floor( imgBs / 2); //余数平分即为外边距大小

$(".container").css("margin-left", a );

$(".container").css("margin-right", a );

})

$(window).bind("resize", $onresize);

ps:有一个很重要的问题,必须给html强制滚动条,否则,在某些显示器下,会出现切边的效果,其实是因为开始算屏幕宽度的时候,滚动条还没加载出来,宽度会算多一点,这样,这样左右的外边距大于实际边距,就发生了切边的效果。像这样:html{ overflow:scroll; }

这个想法就像是小时候做的数学题,一块多大面积的蛋糕,切成每份多大,最多能分给多少人,这里只是加了一个居中的条件。然后当浏览器改变大小的时候,也会重新加载一次,算一次。而图片的位移会使用Masonry.js这个库的动态效果,整个过程很流畅,如果网速不限制,显示的效果是非常好的。

pinterest 算法中获取最多曝光的是 save

是。在pinterest算法中许多的代码都会进行重新编译,而其中编译最多的也就是save,编译完成后将其曝光。

做外贸的,Pinterest怎么claim your website?

Claim your website意思就是让你验证这个网站。

根据上面的提示,把这段代码添加到你网站的HTML里,好让Pinterest知道这个网站所有者是你。

但是这里我不知道你的网站是用什么系统搭建的,不然我可以给你更具体的解决方案。

关于pinterest代码和pinterest的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。

版权说明:如非注明,本站文章均为 AH站长 原创,转载请注明出处和附带本文链接;

本文地址:http://ahzz.com.cn/post/16109.html


取消回复欢迎 发表评论:

分享到

温馨提示

下载成功了么?或者链接失效了?

联系我们反馈

立即下载