tad88
Forum Replies Created
-
Forum: Plugins
In reply to: [One Click Accessibility] Icon Not DisplayingJust had a quick play, and noticed that I think it was clashing with my theme.
Added the following to the theme “Additional CSS” box, and all is now well again!
span.pojo-sr-only.sr-only+svg{ box-sizing:border-box !important; max-width:none !important; display:block !important; color:#fff !important; fill:#fff !important;}
Obviously change the colours #fff to whatever you need
Hope this helps…
Forum: Plugins
In reply to: [One Click Accessibility] Icon Not DisplayingHave you managed to fix this? I have just installed this, and found exactly the problem you describe above. I use this plugin on other sites, and it has worked fine, so really confused!
Forum: Plugins
In reply to: [Sticky Posts - Switch] Sticky making posts show in all categoriesI got it to work eventually – this works for me (obviously try at your own risk etc. etc.)
<?php /* copy commenty stuff here from existing version of plugin */ class PD_StickyPostsInCategory { function PD_StickyPostsInCategory() { return $this->__construct(); } function __construct() { define('PD_SPIC_VERSION', '2.1'); //e.g. /var/www/example.com/wordpress/wp-content/plugins/exit-crusher define("PD_SPIC_DIR", plugin_dir_path(__FILE__)); //e.g. exit-crusher/exit-crusher.php define("PD_SPIC_BASENAME", plugin_basename(__FILE__)); add_filter('the_posts', array( $this, 'putStickyOnTop' )); add_filter('post_class', array( $this, 'addStickyClass' ) , 10, 3); } function putStickyOnTop($posts) { $page = 1; if (empty($wp_query->query_vars['nopaging']) && !$wp_query->is_singular) { $page = absint($wp_query->query_vars['paged']); if (!$page) { $page = 1; } } // Put sticky posts at the top of the posts array $sticky_posts = get_option('sticky_posts'); $current_category = get_cat_ID(single_term_title('', false)); if ($page <= 1 && is_array($sticky_posts) && !empty($sticky_posts) && !$wp_query->query_vars['ignore_sticky_posts']) { $num_posts = count($posts); $sticky_offset = 0; // Loop over posts and relocate stickies to the front. for ($i = 0;$i < $num_posts;$i++) { if (in_array($posts[$i]->ID, $sticky_posts)) { $sticky_post = $posts[$i]; // Remove sticky from current position array_splice($posts, $i, 1); // Move to front, after other stickies array_splice($posts, $sticky_offset, 0, array( $sticky_post )); // Increment the sticky offset. The next sticky will be placed at this offset. $sticky_offset++; // Remove post from sticky posts array $offset = array_search($sticky_post->ID, $sticky_posts); unset($sticky_posts[$offset]); } } // If any posts have been excluded specifically, Ignore those that are sticky. if (!empty($sticky_posts) && !empty($q['post__not_in'])) { $sticky_posts = array_diff($sticky_posts, $q['post__not_in']); } // Fetch sticky posts that weren't in the query results if (!empty($sticky_posts) && !is_user_logged_in() && is_category()) { // Prevent maximum function nesting level error remove_filter('the_posts', array( $this, 'the_posts' ) , 1, 2); $stickies = get_posts(array( 'post__in' => $sticky_posts, 'post_type' => $wp_query->query_vars['post_type'], 'post_status' => 'publish', 'cat' => $current_category, 'nopaging' => true )); add_filter('the_posts', array( $this, 'the_posts' ) , 1, 2); foreach ($stickies as $sticky_post) { array_splice($posts, $sticky_offset, 0, array( $sticky_post )); $sticky_offset++; } } } return $posts; } function addStickyClass($classes, $class, $post_id) { if (is_sticky() && !isset($classes['sticky'])) { $classes[] = 'sticky'; } return $classes; } function activate() { } } $PD_StickyPostsInCategory = new PD_StickyPostsInCategory(); register_activation_hook(__FILE__, array( 'PD_StickyPostsInCategory', 'activate' ));
Forum: Plugins
In reply to: [Sticky Posts - Switch] Sticky making posts show in all categoriesI am confused by this – I thought that was the whole point of this plugin. Something has definitely changed in core functionality. This functionality was easy with a different plugin in the past, but that no longer works, and neither does this. Is there an easy code fix somewhere? perhaps using is_category()?
Summary:
1. Posts (sticky or not) should only show in category pages if they are in that category. 2. Sticky posts with that category should be at the top.
3. Sticky posts should not show at all on category pages they are NOT in – surely?