wordpress如何添加首页(wordpress如何添加注册登录)

小初seo 网站建设wordpress如何添加首页(wordpress如何添加注册登录)已关闭评论982字数 2888阅读9分37秒阅读模式

《如何给Wordpress博客添加首页分页功能》

我一般会用 插件 wp_pagenavi, 常见代码

《wordpress首页日期怎么去掉?wordpress首页日期怎》

第三部:打开下载下来的templates。php文件,找到if ( ! function_exists( ‘basically_posted_on’ ) ) :

function basically_posted_on() 这一句代码,控制文章标题下面日期、作者和评论的代码,就在这句代码下面的一段代码里面,如果我们只想去掉日期的超链接,只需要把if ( ! function_exists( ‘basically_posted_on’ ) ) :

function basically_posted_on()这段代码下面的一段代码改成

printf( __( ‘Posted on %4$s by %7$s’, ‘basically’ ),

esc_url( get_permalink() ),

esc_attr( get_the_time() ),

esc_attr( get_the_date( ‘c’ ) ),

esc_html( get_the_date() ),

esc_url( get_author_posts_url( get_the_author_meta( ‘ID’ ) ) ),

esc_attr( sprintf( __( ‘View all posts by %s’, ‘basically’ ), get_the_author() ) ),

esc_html( get_the_author() )

if ( comments_open() || ( ’0′ != get_comments_number() && ! comments_open() ) ) : ?>

·

这样就可以了,改好之后通过ftp工具上传到服务器覆盖掉以前的templates。

《Wordpress怎么添加一个页面为网站的首页?》

WP的首页默认是当前主题的 index.php 文件
如果想修改,请在你自己制作的页面的开头添加以下标记,并放到和主题同一目录
然后在 后台(左侧) -> 页面 -> 新建页面 -> 页面模板(右侧)
选择你自己制作的模板,填写页面名称以及别名,确定,发布
接着在 后台(左侧) -> 设置 -> 阅读 -> 首页显示(右侧) -> 一个静态页面
选择你自己制作的页面,保存,OK。一、将下面代码加到主题functions.php模版文件的最后。
'; }
add_action('login_head', 'custom_login');
二、在所用主题中新建一个名称为:custom_login 的文件夹,并在其中新建:custom_login.css及制作好的网站logo: logo.png也放进去。
三、将下面代码添加到custom_login.css中。
/** 背景及字体 **/
html,body.login{
background:#f2f2f2;
font: 14px 'microsoft yahei', arial, lucida grande, tahoma, sans-serif;
/** 去掉链接下划线 **/
html a{
text-decoration: none;
/** 登录div **/
#login {
background:#fff;
border: 1pxsolid#ccc;
width:400px;
margin: 40pxauto 0;
padding: 10px10px20px10px;
border-radius:5px;
box-shadow:0 4px10px -1px rgba(200, 200, 200, 0.7);
/** 替换logo **/
.login h1 a{
background: #fffurl(logo.png) no-repeatcenter;
width:400px;
/** 提示 **/
.updated, .login .message {
background:#fff;
border: none;
text-align: center;
/** 表单 **/
.login form {
box-shadow:none;
border: none;
#loginform, #registerform, #lostpasswordform{
background:transparent;
border:none;
/** 按钮 **/
.button-primary,.submit .button-primary,#login form .submit input {
width:83px;
height:25px;
font-weight: bold;
border:none;
上面只罗列了登录界面几个基本要素的样式修改。可以使用火狐扩展firebug查看各部分div选择器名称进行详细修改

《如何在wordpress首页自己添加一个登录页面》

一、将下面代码加到主题functions.php模版文件的最后。
'; }
add_action('login_head', 'custom_login');
二、在所用主题中新建一个名称为:custom_login 的文件夹,并在其中新建:custom_login.css及制作好的网站LOGO: logo.png也放进去。
三、将下面代码添加到custom_login.css中。
/** 背景及字体 **/
html,body.login{
background:#f2f2f2;
font: 14px 'Microsoft YaHei', Arial, Lucida Grande, Tahoma, sans-serif;
/** 去掉链接下划线 **/
html a{
text-decoration: none;
/** 登录DIV **/
#login {
background:#fff;
border: 1pxsolid#ccc;
width:400px;
margin: 40pxauto 0;
padding: 10px10px20px10px;
border-radius:5px;
box-shadow:0 4px10px -1px rgba(200, 200, 200, 0.7);
/** 替换logo **/
.login h1 a{
background: #fffurl(logo.png) no-repeatcenter;
width:400px;
/** 提示 **/
.updated, .login .message {
background:#fff;
border: none;
text-align: center;
/** 表单 **/
.login form {
box-shadow:none;
border: none;
#loginform, #registerform, #lostpasswordform{
background:transparent;
border:none;
/** 按钮 **/
.button-primary,.submit .button-primary,#login form .submit input {
width:83px;
height:25px;
font-weight: bold;
border:none;
上面只罗列了登录界面几个基本要素的样式修改。可以使用火狐扩展Firebug查看各部分DIV选择器名称进行详细修改

 
  • 本文由 小初seo 发表于 2021年7月22日23:35:16
  • 转载请务必保留本文链接:https://www.pkak.cn/web/4417.html