
-
AuthorPosts
-
October 9, 2015 at 3:19 pm #516501
I would like to update the 404 error page to NOT display the popular and comments sections but still and only show the Recent Posts. How can I di this.
-
This topic was modified 9 years, 9 months ago by
wshilson.
October 9, 2015 at 3:22 pm #516503Hi wshilson!
Please go to Enfold/includes folder and open error404.php file and apply the changes suggested here – https://kriesi.at/support/topic/remove-blog-suggestions-in-the-bottom-of-an-unsuccessful-search/#post-516179
Cheers!
YigitOctober 9, 2015 at 3:39 pm #516513I already have
the_widget(‘avia_combo_widget’, ‘error404widget’, array(‘widget_id’=>’arbitrary-instance-‘.$id,
‘before_widget’ => ‘<div class=”widget avia_combo_widget”>’,
‘after_widget’ => ‘</div>’,
‘before_title’ => ‘<h3 class=”widgettitle”>’,
‘after_title’ => ‘</h3>’
));in the error404.php file!
October 9, 2015 at 4:44 pm #516564I do want to keep the “Recent Posts” Area which your solution removed everything including this.
October 12, 2015 at 10:10 am #517222Hey!
Please add this in the functions.php file:
class avia_combo_widget extends WP_Widget { function __construct() { //Constructor $widget_ops = array('classname' => 'avia_combo_widget', 'description' => 'A widget that displays your popular posts, recent posts, recent comments and a tagcloud' ); parent::__construct( 'avia_combo_widget', THEMENAME.' Combo Widget', $widget_ops ); } function widget($args, $instance) { // prints the widget extract($args, EXTR_SKIP); $posts = empty($instance['count']) ? 4 : $instance['count']; echo $before_widget; echo "<div class='tabcontainer border_tabs top_tab tab_initial_open tab_initial_open__1'>"; if(!is_404()) { echo '<div class="tab widget_tab_popular"><span>'.__('Popular', 'avia_framework').'</span></div>'; echo "<div class='tab_content'>"; avia_get_post_list('cat=&orderby=comment_count&posts_per_page='.$posts); echo "</div>"; } echo '<div class="tab widget_tab_recent first_tab active_tab"><span>'.__('Recent', 'avia_framework').'</span></div>'; echo "<div class='tab_content'>"; avia_get_post_list('showposts='. $posts .'&orderby=post_date&order=desc'); echo "</div>"; if(!is_404()) { echo '<div class="tab widget_tab_comments"><span>'.__('Comments', 'avia_framework').'</span></div>'; echo "<div class='tab_content active_tab_content'>"; avia_get_comment_list( array('number' => $posts, 'status' => 'approve', 'order' => 'DESC') ); echo "</div>"; } echo '<div class="tab last_tab widget_tab_tags"><span>'.__('Tags', 'avia_framework').'</span></div>'; echo "<div class='tab_content tagcloud'>"; wp_tag_cloud('smallest=12&largest=12&unit=px'); echo "</div>"; echo "</div>"; echo $after_widget; } function update($new_instance, $old_instance) { $instance = $old_instance; foreach($new_instance as $key=>$value) { $instance[$key] = strip_tags($new_instance[$key]); } return $instance; } function form($instance) { //widgetform in backend $instance = wp_parse_args( (array) $instance, array('count' => 4) ); if(!is_numeric($instance['count'])) $instance['count'] = 4; ?> <p> <label for="<?php echo $this->get_field_id('count'); ?>">Number of posts you want to display: <input class="widefat" id="<?php echo $this->get_field_id('count'); ?>" name="<?php echo $this->get_field_name('count'); ?>" type="text" value="<?php echo esc_attr($instance['count']); ?>" /></label></p> <?php } }
Regards,
Ismael -
This topic was modified 9 years, 9 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.