Tagged: error, functions.php, not working, posts, sticky
-
AuthorPosts
-
April 1, 2014 at 7:13 pm #246211
last time i tried to change the functions.php file with the following code
add_filter('the_posts', 'bump_sticky_posts_to_top'); function bump_sticky_posts_to_top($posts) { foreach($posts as $i => $post) { if(is_sticky($post->ID)) { $stickies[] = $post; unset($posts[$i]); } } if(!empty($stickies)) return array_merge($stickies, $posts); return $posts; }
it just broke and started to give me the following error upon access:
Warning: require_once(config-wpml/config.php): failed to open stream: No such file or directory in /home4/aum/public_html/wp-includes/functions.php on line 29 Fatal error: require_once(): Failed opening required 'config-wpml/config.php' (include_path='.:/opt/php55/lib/php') in /home4/aum/public_html/wp-includes/functions.php on line 29
any suggestions how to make it work? the website url is: http://www.oshonow.net
April 3, 2014 at 8:36 am #246920Hi akhilz!
Please insert the code into wp-content/themes/enfold/functions.php and not into wp-includes/functions.php.
Best regards,
PeterApril 5, 2014 at 5:52 am #247716thanks Peter
have done as directed.
works on one of the pages: http://oshonow.net/seekers-diary/
but not on the homepage as yet: http://oshonow.net
strange?please help.
April 5, 2014 at 9:31 am #247754Hi!
Yes, it’s weird. Unfortunately sticky posts won’t work properly with the category__in query parameter – see: http://core.trac.wordpress.org/ticket/25815
I suggest to try a plugin like: http://wordpress.org/plugins/post-types-order/ – it enables you to change the sort order of the posts easily and you can use it to add your “sticky posts” to the very top.
Regards,
PeterApril 7, 2014 at 10:38 am #248109hi Dude
i was working on something else entirely and changed the Blog Style back and forth with Multi Author and Single Author styles and somewhere along the line i realized that sticky post has started working on the home page as well. strange but it happened, check http://www.oshonow.net
am not code friendly so wouldn’t know what made it work, informing you so others may be helped!
thanks. -
AuthorPosts
- The topic ‘Sticky Posts Not Working’ is closed to new replies.