嘿,伙计们,有没有可能做到以下几点:
wp_list_pages()
列出<li> <a href="link"...
<?php wp_list_pages(\'title_li=&depth=0&exclude=\'); ?>
是否可以向这些链接添加#哈希?喜欢<a href="link#something"
?谢谢你的帮助
嘿,伙计们,有没有可能做到以下几点:
wp_list_pages()
列出<li> <a href="link"...
<?php wp_list_pages(\'title_li=&depth=0&exclude=\'); ?>
是否可以向这些链接添加#哈希?喜欢<a href="link#something"
?谢谢你的帮助
我会将其包装在函数中(保存在functions.php
);
function wp_list_pages_with_hash( $hash, $args = \'\' )
{
$add_hash = create_function( \'$link\', \'return $link . "#\' . $hash . \'";\' );
add_filter( \'page_link\', $add_hash );
$result = wp_list_pages( $args );
remove_filter( \'page_link\', $add_hash );
return $result; // back compat in case \'echo\' was null
}
那就这样说吧!<?php wp_list_pages_with_hash( \'target\', \'title_li=&depth=0\' ); ?>
我刚刚尝试了自动升级List Category Posts WordPress 3.0.5上0.17.2版本的插件。我想我以前是0.17.1。已安装但未能激活:Plugin could not be activated because it triggered a fatal error. Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or \'}\'