wordpress首页窗口标题显示nothing found for怎么办
1.先用bootstrap做好网站静态模板文件;如下index.html索引文件home.html首页single.html文章页面arctive.html分类页面category.html分类页面page.html页面search.html页面404.html页面style.css自定义样式文件夹images引用的图片文件夹css引用的css文件文件夹js引用的js文件2.再把静态模板文件换成动态模板文件,即把html换成php文件;如下index.php索引文件home.php首页single.php文章页面arctive.php分类页面category.php分类页面page.php页面search.php页面404.php页面style.css自定义样式文件夹images引用的图片文件夹css引用的css文件文件夹js引用的js文件
如何获取 WordPress 各类页面的链接
在WordPress项目开发过程,很可能需要获取WordPress 各类页面的链接,包括首页、文章页、Page页面、存档页面等等,今天倡萌就简单分享下获取 WordPress 各类页面的链接的方法。
获取文章或页面链接 直接输出文章或页面的链接: 返回文章或页面的链接,以供调用: get_permalink(); 可以使用 echo 输出,结果和直接使用 the_permalink() 一样: 获取存档页面链接 function get_current_archive_link( $paged = true ) { $link = false; if ( is_front_page() ) { $link = home_url( '/' ); } else if ( is_home() && "page" == get_option('show_on_front') ) { $link = get_permalink( get_option( 'page_for_posts' ) ); } else if ( is_tax() || is_tag() || is_category() ) { $term = get_queried_object(); $link = get_term_link( $term, $term->taxonomy ); } else if ( is_post_type_archive() ) { $link = get_post_type_archive_link( get_post_type() ); } else if ( is_author() ) { $link = get_author_posts_url( get_query_var('author'), get_query_var('author_name') ); } else if ( is_archive() ) { if ( is_date() ) { if ( is_day() ) { $link = get_day_link( get_query_var('year'), get_query_var('monthnum'), get_query_var('day') ); } else if ( is_month() ) { $link = get_month_link( get_query_var('year'), get_query_var('monthnum') ); } else if ( is_year() ) { $link = get_year_link( get_query_var('year') ); } } } if ( $paged && $link && get_query_var('paged') > 1 ) { global $wp_rewrite; if ( !$wp_rewrite->using_permalinks() ) { $link = add_query_arg( 'paged', get_query_var('paged'), $link ); } else { $link = user_trailingslashit( trailingslashit( $link ) . trailingslashit( $wp_rewrite->pagination_base ) . get_query_var('paged'), 'archive' ); } } return $link; } 该函数可以输出首页、分类法(自定义分类法、标签、分类)、自定义文章类型的存档页面、作者存档页面、日期存档页面 的链接,包含分页。
获取当前页面链接 如果你不想判断页面类型,只想输出当前页面的链接,可以使用下面的代码: request)); echo $current_url; ?>
WordPress后台出现英文代码 Warning:
1.数据库部署 为Wordpress程序创建用户名为360readuser,密码为360readpsd的数据库。
登陆数据库:mysql -uroot -p 创建数据库:CREATE DATABASE 360read; 创建数据库用户:CREATE USER 360readuser@localhost IDENTIFIED BY '360readpsd'; 给用户所有权限:GRANT ALL PRIVILEGES ON 360read.* TO 360readuser@localhost; 刷新生效: FLUSH PRIVILEGES; 退出:exit 重启服务:systemctl restart mariadb.service systemctl restart httpd.service2.安装WordPress1>建立一个临时文件夹,下载最新版本的Wordpress3.92,中英文都可以。
mkdir /tmp/wpcd /tmp/wpwget http://wordpress.org/latest.zip解压缩到网站根目录: unzip -q latest.zip -d /var/www/html/2>更改wordpree文件夹属主:chown -R apache:apache /var/www/html/wordpress更改wordpress文件夹权限:chmod -R 755 /var/www/html/wordpress创建一个可以上传的目录upload,并将属主改为apache:mkdir -p /var/www/html/wordpress/wp-content/uploadschown -R :apache /var/www/html/wordpress/wp-content/uploads3>修改配置文件,以便可以访问数据库cd /var/www/html/wordpress/cp wp-config-sample.php wp-config.phpvim wp-config.php 修改红色字体部分:/** The name of the database for WordPress */define('DB_NAME', '360read');/** MySQL database username */define('DB_USER', '360readuser');/** MySQL database password */define('DB_PASSWORD', '360readpsd'); 修改完成后 :wq !4>浏览器输入http://192.168.1.108/wordpress/wp-admin/install.php 后就可以进行最后的登陆安装,输入站点名称,登陆户名,密码,邮箱就可以完成Wordpress安装!如果出现如下错误:Your PHP installation appears to be missing the MySQL extension which is require可能是PHP-mysql模块丢失造成的,重新yum install php-mysql ,并且重启mariadb和httpd服务就可以了。
5>开启支持网站固定链接修改和重定向功能。
编辑主配置文件:vi /etc/httpd/conf/httpd.conf…AllowOverride None 修改为AllowOverride All…然后重启服务:systemctl restart httpd.service创建.htaccess文件:touch /var/www/html/wordpress/.htaccess编辑:vim /var/www/html/wordpress/.htaccess,加入以下内容,也可以让网站自动生成。
RewriteEngine OnRewriteBase /wordpress/RewriteRule ^index\.php$ – [L]RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule . /wordpress/index.php [L]修改.htaccess文件权限:chmod 664 /var/www/html/wordpress/.htaccess,修改为664可以让网站支持自动更新,也可以修改为644。
登陆wordpress显示的是forbidden
展开全部 获取存档页面链接function get_current_archive_link( $paged = true ) {$link = false;if ( is_front_page() ) {$link = home_url( '/' );} else if ( is_home() && "page" == get_option('show_on_front') ) {$link = get_permalink( get_option( 'page_for_posts' ) );} else if ( is_tax() || is_tag() || is_category() ) {$term = get_queried_object();$link = get_term_link( $term, $term->taxonomy );} else if ( is_post_type_archive() ) {$link = get_post_type_archive_link( get_post_type() );} else if ( is_author() ) {$link = get_author_posts_url( get_query_var('author'), get_query_var('author_name') );...
wordpress能允许用户注册博客吗
一。
研究wordpress时wordpess的密码密码生成与登录密码验证方式很重要 WordPress密码已成为整合的首要目标,如何征服整合,就得了解WordPress密码算法。
WordPress系统的用户密码是保存在wp_users数据表的user_pass字段,密码是通过Portable PHP password hashing framework类产生的,密码的形式是随机且不可逆,同一个明文的密码在不同时间,产生的密文也不一样,相对来说较为安全。
二。
密码生成方式> 随机产生一个salt 并将salt和password相加> 进行了count次md5 然后和encode64的hash数值累加> 最后得到一个以$P$开头的密码,这个密码每次产生的结果都不一样 以下为在wordpress中调用密码生成的代码 [php] view plain copy print?$password = 'abc'; global $wp_hasher; if ( empty($wp_hasher) ) { require_once( './wp-includes/class-phpass.php'); $wp_hasher = new PasswordHash(8, TRUE); } echo $wp_hasher->HashPassword($password); ?> 三。
wordpress密码生成与登录验证 wordpress中位置为\wp-includes\class-phpass.php 以下是wordpress中生成密码的代码直接运行可查看密码的生成以及验证过程 [php] view plain copy print?class PasswordHash { var $itoa64; var $iteration_count_log2; var $portable_hashes; var $random_state; function PasswordHash($iteration_count_log2, $portable_hashes) { $this->itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; if ($iteration_count_log2 4 || $iteration_count_log2 > 31) $iteration_count_log2 = 8; $this->iteration_count_log2 = $iteration_count_log2; $this->portable_hashes = $portable_hashes; $this->random_state = microtime() . uniqid(rand(), TRUE); // removed getmypid() for compability reasons } function get_random_bytes($count) { $output = ''; if ( @is_readable('/dev/urandom') && ($fh = @fopen('/dev/urandom', 'rb'))) { $output = fread($fh, $count); fclose($fh); } if (strlen($output) $output = ''; for ($i = 0; $i $this->random_state = md5(microtime() . $this->random_state); $output .= pack('H*', md5($this->random_state)); } $output = substr($output, 0, $count); } return $output; } function encode64($input, $count) { $output = ''; $i = 0; do { $value = ord($input[$i++]); $output .= $this->itoa64[$value & 0x3f]; if ($i $value |= ord($input[$i]) $output .= $this->itoa64[($value >> 6) & 0x3f]; if ($i++ >= $count) break; if ($i $value |= ord($input[$i]) $output .= $this->itoa64[($value >> 12) & 0x3f]; if ($i++ >= $count) break; $output .= $this->itoa64[($value >> 18) & 0x3f]; } while ($i return $output; } function gensalt_private($input) { $output = '$PXXXXX; $output .= $this->itoa64[min($this->iteration_count_log2 + ((PHP_VERSION >= '5') ? 5 : 3), 30)]; $output .= $this->encode64($input, 6); return $output; } function crypt_private($password, $setting) { $output = '*0'; if (substr($setting, 0, 2) == $output) $output = '*1'; $id = substr($setting, 0, 3); # We use "$P{1}quot;, phpBB3 uses "$H{1}quot; for the same thing if ($id != '$PXXXXX && $id != '$HXXXXX) return $output; $count_log2 = strpos($this->itoa64, $setting[3]); if ($count_log2 7 || $count_log2 > 30) return $output; $count = 1 $salt = substr($setting, 4, 8); if (strlen($salt) != 8) return $output; # We're kind of forced to use MD5 here since it's the only # cryptographic primitive available in all versions of PHP # currently in use. To implement our own low-level crypto # in PHP would result in much worse performance and # consequently in lower iteration counts and hashes that are # quicker to crack (by non-PHP code). if (PHP_VERSION >= '5') { $hash = md5($salt . $password, TRUE); do { $hash = md5($hash . $password, TRUE); } while (--$count); } else { $hash = pack('H*', md5($salt . $password)); do { $hash = pack('H*', md5($hash . $password)); } while (--$count); } $output = substr($setting, 0, 12); $output .= $this->encode64($hash, 16); return $output; } function gensalt_extended($input) { $count_log2 = min($this->iteration_count_log2 + 8, 24); # This should be odd to not reveal weak DES keys, and the # maximum valid value is (2**24 - 1) which is odd anyway. $count = (1 $output = '_'; $output .= $this->itoa64[$count & 0x3f]; $output .= $this->itoa64[($count >> 6) & 0x3f]; $output .= $this->itoa64[($count >> 12) & 0x3f]; $output .= $this->itoa64[($count >> 18) & 0x3f]; $output .= $this->encode64($input, 3); return $output; } function gensalt_blowfish($input) { # This one needs to use a different order of characters and a # different encoding scheme from the one in encode64() above. # We care because the last character in our encoded string will # only represent 2 bits. While two known implementations of # bcrypt will happily accept and correct a salt string which # has the 4 unused bits set to non-zero, we do not want to take # ...
如何给自己的wordpress博客增加上一页下一页的功能
第一步打开主题函数【模板函数 (functions.php)】文件加入如下代码://分页工具function pagenavi( $p = 2 ) {if ( is_singular() ) return;global $wp_query, $paged;$max_page = $wp_query->max_num_pages;if ( $max_page == 1 ) return;if ( empty( $paged ) ) $paged = 1;echo '' . $paged . ' / ' . $max_page . ' ';if ( $paged > 1 ) p_link( $paged - 1, '上一页', '上一页' );if ( $paged > $p + 1 ) p_link( 1, '最前页' );if ( $paged > $p + 2 ) echo '...';for( $i = $paged - $p; $i <= $paged + $p; $i++ ) {if ( $i > 0 && $i <= $max_page ) $i == $paged ? print "{$i} " : p_link( $i );}if ( $paged < $max_page - $p - 1 ) echo '...';if ( $paged < $max_page - $p ) p_link( $max_page, '最末页' );if ( $paged < $max_page ) p_link( $paged + 1,'下一页', '下一页' );}function p_link( $i, $title = '', $linktype = '' ) {if ( $title == '' ) $title = "第 {$i} 页";if ( $linktype == '' ) { $linktext = $i; } else { $linktext = $linktype; }echo "{$linktext} ";}第二步:再需要分页的地方,比如首页加上
Wordpress 的这种文字效果是怎么弄的?
这个不难呀,实现的方法有几种:方法1:在文字左边放一个这样的图片;方法2:给文字的这个标签添加背景图片;方法3:给文字这个标签添加左边框;如果不会,可以参阅一下高时银博客的CSS教程。
当然,要想实现,还是需要你懂一点前端html和css知识的。
转载请注明出处51数据库 » wordpress 3.9 for sa
擦肩而过31525709