1.如何更改WordPress标题的图标
方法/步骤
打开自己网站的首页,查看--源文件。
此时会显示自己首页的源文件,下图红框中就是显示favicon图标的秘密。如何添加请看下面步骤。
首先打开下载的wordpress源码文件夹,找到你当前使用的模板文件夹,默认在wordpress\wp-content\themes下面。选择模板文件夹进入。
进入模板文件夹后选择header.php用记事本打开。在<head></head>;标签之间插入如下代码:<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
修改好header.php后将文件上传到空间的对应模板文件夹下,覆盖原来的文件。
然后制作一个favicon图标命名为favicon.ico上传到网站根目录(图标大小16*16或48*48)。
下面给个favicon图标当演示用:ued.taobao.org/blog/wp-content/themes/taobaoued/images/favicon.ico
全部完成后清楚浏览器缓存文件,重启浏览器。重新打开主页你会发现网站图标更换完成了。
2.如何在Wordpress文章标题生成相应图标
<?php
function fun_ChkChildFile($post_id = null ,$num = 1){
global $post;
if ( !isset( $post_id ) ){
$post_id = $post->ID;
}
$attachment_image= get_children(array('showposts'=>$num,'post_parent' => $post_id, 'post_type' => 'attachment', 'post_mime_type' => 'image'));
if ( $attachment_image ){
//image
}
$attachment_mp3 = get_children(array('showposts'=>$num,'post_parent' => $post_id, 'post_type' => 'attachment', 'post_mime_type' => 'audio'));
if ( $attachment_mp3 ){
//mp3
}
}
代码放到。functions.php中。
3.wordpress 我想把网站标题栏的图标给换了,就在functions.php里加
重新下载wordpress,然后functions.php文件覆盖掉。
网站图标不用改里面的。。。方法:
1.一般在图标放在网站根目录名称为favicon.ico即可
2.在你的网页模板<head></head>;标签之中加入<link rel="shortcut icon"href=" 图标地址" type="image/x-icon" />
4.wordpress 怎么调出最新的图文列表,标题+内容+图片
我把我设计的主题的index.php文件代码贴出来吧,只能用于参考,你自己看着办吧,就是你要的效果 <?php echo get <?php _e('Sorry, no posts matched your criteria.'); ?> <?php endif; ?> <?php get_sidebar(); ?><?php get_footer(); ?>
好名字都让汪取了