admin管理员组文章数量:1390531
So I use to have this site on a small time bulk hosting company and when I asked them why the code wasn't working they said it isn't supported on our server. I moved to a new hosting a few months ago though the problem has persisted, it's like something is blocking it that was put on from the old hosting?
function wpa_alter_cat_links( $termlink, $term, $taxonomy ){
if( 'category' != $taxonomy ) return $termlink;
return str_replace( '/category', '', $termlink );
}
add_filter( 'term_link', 'wpa_alter_cat_links', 10, 3 );
//* Activate shortcode function in Post Title
add_filter( 'the_title', 'do_shortcode' );
//* Shortcode to display the current year in WordPress
//* shortcode: [year]
add_shortcode( 'year' , 'current_year' );
function current_year() {
$year = date("Y");
return "$year";
}
It works fine on my other site but not this one, which makes me think something is blocking it? The purpose of it, since it was copied was to basically do custom category pages as opposed to the standard Wordpress category pages, though the year short code does work.
本文标签: categoriesCustom FunctionPHP Code Not Working on One Site
版权声明:本文标题:categories - Custom Function.PHP Code Not Working on One Site 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744751202a2623189.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论