Wordpress 在外观页面的活动主题下添加链接

Wordpress 在外观页面的活动主题下添加链接,wordpress,themes,Wordpress,Themes,在“主题选择”页面中,链接显示在活动主题下方,显示其功能。大多数情况下,如果您运行add_Theme_页面,这些都是小部件、菜单和主题选项链接 由于我创建了自己的顶级菜单,并且没有使用添加主题页面,因此我的路径重定向到admin.php?page=selected slug,而不是themes.php?page=selected slug,并且外观部分中没有主题选项链接。有没有一种方法可以让我仍然显示该链接,以显示我的主题有选项?我想jQuery解决方案现在必须要做。这不是我的第一选择,但至少它

在“主题选择”页面中,链接显示在活动主题下方,显示其功能。大多数情况下,如果您运行add_Theme_页面,这些都是小部件、菜单和主题选项链接


由于我创建了自己的顶级菜单,并且没有使用添加主题页面,因此我的路径重定向到admin.php?page=selected slug,而不是themes.php?page=selected slug,并且外观部分中没有主题选项链接。有没有一种方法可以让我仍然显示该链接,以显示我的主题有选项?

我想jQuery解决方案现在必须要做。这不是我的第一选择,但至少它起作用了

PHP:

jQuery:

// Redirect link in Appearance to your top-level menu
$('#current-theme div.theme-options a[href="themes.php?page=sample-slug"]').attr('href', 'admin.php?page=sample-slug');

/*
 * Hide the link created by add_theme_page(). Use each() since our <li> has no
 * name and this makes sure the script always works even if its position changes.
 */
$('#menu-appearance a[href="themes.php?page=sample-slug"]').each(function(){
    $(this).parent().hide();
});
// Redirect link in Appearance to your top-level menu
$('#current-theme div.theme-options a[href="themes.php?page=sample-slug"]').attr('href', 'admin.php?page=sample-slug');

/*
 * Hide the link created by add_theme_page(). Use each() since our <li> has no
 * name and this makes sure the script always works even if its position changes.
 */
$('#menu-appearance a[href="themes.php?page=sample-slug"]').each(function(){
    $(this).parent().hide();
});