WordPress 3.5 how to determine if user is on category listing or category edit screen?
if(is_admin() && isset($_GET[‘taxonomy’]) && $_GET[‘taxonomy’] == ‘category’ && isset($_GET[‘tag_ID’]) { // place your code here }
if(is_admin() && isset($_GET[‘taxonomy’]) && $_GET[‘taxonomy’] == ‘category’ && isset($_GET[‘tag_ID’]) { // place your code here }
Turns out this issue was caused by bad code (a missing assert) in my theme. More specifically the theme requires a custom navigation menu. As this menu hadn’t been created and assigned the site crashed. Why this caused an memory exhaustion error on my production server and not my development computer I unfortunately don’t know.
This plugin, https://wordpress.org/plugins/enable-media-replace/ is more efficient way to replace images
I wound up fixing it like this. All pages now work. But it looks …well …ugly. <?php if (function_exists(‘is_tag’) && is_tag()) { single_tag_title(‘Tag Archive for "’); echo ‘" | ‘; } elseif (is_archive()) { wp_title(”); echo ‘ Archive | ‘; } elseif (is_search()) { echo ‘Search for "’.esc_html($s).’" | ‘; } elseif (!(is_404()) && is_single() … Read more
The get_template_part(‘content’, get_post_format()); line includes content from one of the other files in your theme based on the post type, the file name will be something like content-page.php (or content.php if the format is not found). If you print out what get_post_format() returns, you will be able to tell which content file to look into. … Read more
Replace all your the_content(); with echo do_shortcode(get_the_content());
Yes you can add an around the title of the widget, you do this in the register_sidebar code which you would put in your functions.php add_action( ‘widgets_init’, ‘theme_register_sidebars’ ); function theme_register_sidebars() { register_sidebar( array( ‘id’ => ‘mysidebar-sidebar’, ‘name’ => __( ‘My Sidebar’, ‘themename’ ), ‘description’ => __( ‘Widgets for my sidebar’, ‘themename’ ), ‘before_widget’ => … Read more
Paste this code into your functions.php and it will be solved. add_action(‘add_to_cart_redirect’, ‘resolve_dupes_add_to_cart_redirect’); function resolve_dupes_add_to_cart_redirect($url = false) { if(!empty($url)) { return $url; } return get_bloginfo(‘wpurl’).add_query_arg(array(), remove_query_arg(‘add-to-cart’)); }
hook into init action on your initial plugin function add_action(‘init’, array(__CLASS__, ‘your_function_within_class’)); and add the function public static function your_function_within_class() { wp_register_style(‘myfirstplugin-admin-css’, ‘/wp-content/plugins/myfirstplugin/assets/style.css’, false); wp_enqueue_style(‘myfirstplugin-admin-css’); } hope this help
Figured it out, thanks 🙂 <?php if (is_page(‘contact’) ) { ?> <?php } else { ?> placed script here <?php } ?>