<?php
/**
* display errors
*/
if( is_super_admin() ){
// error_reporting(E_ALL);
// ini_set("display_errors", 1);
}else{
// exit;
}
/**
* remove actions from wp_head
*/
remove_action( 'wp_head', 'feed_links_extra', 3 );
remove_action( 'wp_head', 'rsd_link' );
remove_action( 'wp_head', 'wlwmanifest_link' );
remove_action( 'wp_head', 'index_rel_link' );
remove_action( 'wp_head', 'start_post_rel_link', 10, 0 );
remove_action( 'wp_head', 'wp_generator' );
/**
* WordPress Emoji Delete
*/
remove_action( 'admin_print_scripts' , 'print_emoji_detection_script');
remove_action( 'admin_print_styles' , 'print_emoji_styles');
remove_action( 'wp_head' , 'print_emoji_detection_script', 7);
remove_action( 'wp_print_styles' , 'print_emoji_styles');
remove_filter( 'the_content_feed' , 'wp_staticize_emoji');
remove_filter( 'comment_text_rss' , 'wp_staticize_emoji');
remove_filter( 'wp_mail' , 'wp_staticize_emoji_for_email');
/**
* wp-json delete
*/
add_filter('rest_enabled', '_return_false');
add_filter('rest_jsonp_enabled', '_return_false');
remove_action( 'wp_head', 'rest_output_link_wp_head', 10 );
remove_action( 'wp_head', 'wp_oembed_add_discovery_links', 10 );
/**
* post formats
*/
add_theme_support( 'post-formats', array( 'gallery', 'image', 'video' ) );
add_post_type_support( 'page', 'post-formats' );
// add link manager
add_filter( 'pre_option_link_manager_enabled', '__return_true' );
/**
* add theme thumbnail
*/
if ( function_exists( 'add_theme_support' ) ) {
add_theme_support( 'post-thumbnails' );
}
/**
* register menus
*/
if (function_exists('register_nav_menus')){
register_nav_menus( array(
'nav' => __('导航')
));
}
/**
* register sidebar
*/
if (function_exists('register_sidebar')){
$sidebars = array(
'single' => '文章页侧栏',
'page' => '页面侧栏',
);
foreach ($sidebars as $key => $value) {
register_sidebar(array(
'name' => $value,
'id' => $key,
'before_widget' => '<div class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>'
));
};
}
/**
* the theme
*/
$current_theme = wp_get_theme();
function _the_theme_name(){
global $current_theme;
return $current_theme->get( 'Name' );
}
function _the_theme_version(){
global $current_theme;
return $current_theme->get( 'Version' );
}
function _the_theme_thumb(){
return _hui('post_default_thumb') ? _hui('post_default_thumb') : get_stylesheet_directory_uri() . '/img/thumb.png';
}
function _the_theme_avatar(){
return get_stylesheet_directory_uri() . '/img/avatar.png';
}
function _get_description_max_length(){
return 200;
}
function _get_delimiter(){
return _hui('connector') ? _hui('connector') : '-';
}
/**
* get theme option
*/
function _hui( $name, $default = false ) {
$option_name = _the_theme_name();
$options = get_option( $option_name );
if ( isset( $options[$name] ) ) {
return $options[$name];
}
return $default;
}
/**
* Widgets
*/
require_once (get_stylesheet_directory() . '/functions-widgets.php');
/**
* Functions for admin
*/
if( is_admin() ){
require_once (get_stylesheet_directory() . '/functions-admin.php');
}
/**
* target blank
*/
function _target_blank(){
return _hui('target_blank') ? ' target="_blank"' : '';
}
/**
* Disable embeds
*/
if ( !function_exists( 'disable_embeds_init' ) ) :
function disable_embeds_init(){
global $wp;
$wp->public_query_vars = array_diff($wp->public_query_vars, array('embed'));
remove_action('rest_api_init', 'wp_oembed_register_route');
add_filter('embed_oembed_discover', '__return_false');
remove_filter('oembed_dataparse', 'wp_filter_oembed_result', 10);
remove_action('wp_head', 'wp_oembed_add_discovery_links');
remove_action('wp_head', 'wp_oembed_add_host_js');
add_filter('tiny_mce_plugins', 'disable_embeds_tiny_mce_plugin');
add_filter('rewrite_rules_array', 'disable_embeds_rewrites');
}
add_action('init', 'disable_embeds_init', 9999);
function disable_embeds_tiny_mce_plugin($plugins){
return array_diff($plugins, array('wpembed'));
}
function disable_embeds_rewrites($rules){
foreach ($rules as $rule => $rewrite) {
if (false !== strpos($rewrite, 'embed=true')) {
unset($rules[$rule]);
}
}
return $rules;
}
function disable_embeds_remove_rewrite_rules(){
add_filter('rewrite_rules_array', 'disable_embeds_rewrites');
flush_rewrite_rules();
}
register_activation_hook(__FILE__, 'disable_embeds_remove_rewrite_rules');
function disable_embeds_flush_rewrite_rules(){
remove_filter('rewrite_rules_array', 'disable_embeds_rewrites');
flush_rewrite_rules();
}
register_deactivation_hook(__FILE__, 'disable_embeds_flush_rewrite_rules');
endif;
/**
* SSL Gravatar
*/
if (!function_exists('_get_ssl2_avatar')) :
function _get_ssl2_avatar($avatar) {
$avatar = preg_replace('/.*\/avatar\/(.*)\?s=([\d]+)&.*/','<img src="https://secure.gravatar.com/avatar/$1?s=$2&d=mm" class="avatar avatar-$2" height="$2" width="$2">',$avatar);
return $avatar;
}
add_filter('get_avatar', '_get_ssl2_avatar');
endif;
/**
* Remove Open Sans that WP adds from frontend
*/
if (!function_exists('remove_wp_open_sans')) :
function remove_wp_open_sans() {
wp_deregister_style( 'open-sans' );
wp_register_style( 'open-sans', false );
}
add_action('wp_enqueue_scripts', 'remove_wp_open_sans');
endif;
if (!function_exists('remove_open_sans')) :
function remove_open_sans() {
wp_deregister_style( 'open-sans' );
wp_register_style( 'open-sans', false );
wp_enqueue_style('open-sans','');
}
add_action( 'init', 'remove_open_sans' );
endif;
/**
* title
*/
function _title() {
global $paged;
$html = '';
$t = trim(wp_title('', false));
if ($t) {
$html .= $t . _get_delimiter();
}
if ( get_query_var('page') ) {
$html .= '第' . get_query_var('page') . '页' . _get_delimiter();
}
$html .= get_bloginfo('name');
if (is_home()) {
if ($paged > 1) {
$html .= _get_delimiter() . '最新发布';
}else{
$html .= _get_delimiter() . get_option('blogdescription');
}
}
if ($paged > 1) {
$html .= _get_delimiter() . '第' . $paged . '页';
}
return $html;
}
/**
* menu
*/
function _the_menu($location = 'nav') {
echo str_replace("</ul></div>", "", preg_replace("/<div[^>]*><ul[^>]*>/", "", wp_nav_menu(array('theme_location' => $location, 'echo' => false))));
}
/**
* logo
*/
function _the_logo() {
$tag = is_home() ? 'h1' : 'div';
$src = _hui('logo_src');
if( wp_is_mobile() && _hui('logo_src_m') ){
$src = _hui('logo_src_m');
}
echo '<' . $tag . ' class="logo"><a href="' . get_bloginfo('url') . '" title="' . get_bloginfo('name') . _get_delimiter() . get_bloginfo('description') . '"><img src="'.$src.'"><span>' . get_bloginfo('name') . '</span></a></' . $tag . '>';
}
/**
* ads
*/
function _the_ads($name='', $class=''){
if( !_hui($name.'_s') ) return;
if( wp_is_mobile() ){
echo '<div class="asst asst-m asst-'.$class.'">'._hui($name.'_m').'</div>';
}els
没有合适的资源?快使用搜索试试~ 我知道了~
分享一个wordpress模板图片网站搭建站必备易优化大前端tob主题0.5版本
共90个文件
php:46个
gif:23个
png:7个
需积分: 33 12 下载量 4 浏览量
2018-04-29
22:52:42
上传
评论
收藏 417KB RAR 举报
温馨提示
wp大前端 tob主题 0.5版本 wordpress主题图片网站模板 适用于各种图片展示网站、新闻站、电影站、美图站、资源站等等,扁平化设计、公众号展示、打赏功能、列表无限加载、相册功能 tob主题基于WordPress程序,响应式布局支持电脑、平板和手机的完美展示
资源推荐
资源详情
资源评论
收起资源包目录
wp大前端tob主题0.5版本 wordpress模板图片网站搭建站必备易优化tob0.5.rar (90个子文件)
wp大前端tob主题0.5版本 wordpress模板图片网站搭建站必备易优化tob0.5
sidebar.php 210B
functions.php 128B
footer.php 2KB
excerpt-item.php 1KB
comments.php 6KB
index.php 686B
editor-style.css 2KB
content-module-share.php 1KB
img
thumb.png 4KB
404.png 9KB
backtop.png 1KB
qrcode.png 6KB
avatar.png 616B
logo.png 3KB
loading.gif 2KB
smilies
icon_arrow.gif 622B
icon_cry.gif 2KB
icon_confused.gif 1KB
icon_mad.gif 4KB
icon_exclaim.gif 2KB
icon_biggrin.gif 2KB
icon_surprised.gif 505B
icon_twisted.gif 694B
icon_wink.gif 3KB
icon_neutral.gif 808B
icon_lol.gif 623B
icon_sad.gif 795B
icon_mrgreen.gif 646B
icon_eek.gif 786B
icon_cool.gif 534B
icon_smile.gif 563B
icon_evil.gif 1KB
icon_rolleyes.gif 878B
icon_redface.gif 2KB
icon_idea.gif 740B
icon_question.gif 5KB
icon_razz.gif 1KB
content.php 3KB
action
like.php 1KB
comment.php 4KB
content-image.php 373B
inc
css
optionsframework.css 6KB
update.php 4KB
images
ico-delete.png 715B
options.php 21KB
js
options-custom.js 2KB
media-uploader.js 3KB
includes
class-options-framework.php 2KB
class-options-interface.php 16KB
class-options-framework-admin.php 9KB
class-options-media-uploader.php 4KB
class-options-sanitization.php 12KB
options-framework.php 3KB
content-video.php 373B
archive.php 425B
tob.zip 211KB
404.php 113B
fonts
iconfont.eot 9KB
iconfont.ttf 9KB
iconfont.svg 10KB
iconfont.woff 6KB
content-gallery.php 373B
functions-theme.php 42KB
js
jquery.js 94KB
html5.js 2KB
main.js 66KB
functions-widgets.php 12KB
header.php 3KB
content-module-wechats.php 573B
author.php 258B
pages
blank.php 506B
tags.php 814B
posts-week.php 1KB
posts-month.php 1KB
posts-likes.php 470B
blank-2.php 460B
posts-24h.php 1KB
page.php 1KB
category.php 238B
functions-admin.php 8KB
excerpt-none.php 50B
search.php 305B
tag.php 233B
single.php 112B
excerpt-home.php 2KB
style.css 55KB
image.php 3KB
screenshot.jpg 19KB
excerpt.php 512B
content-module-rewards.php 835B
共 90 条
- 1
资源评论
umengren
- 粉丝: 3
- 资源: 8
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功