WordPress.org

Ready to get started?Download WordPress

Forums

Sampression Lite
[resolved] Cannot remove 'About me' from Third Bottom Widget (6 posts)

  1. ElmT
    Member
    Posted 1 year ago #

    Hi,

    I have just installed and started customizing the theme. However I cannot change/get rid of the sample 'About me' box, which says 'This is your Third Bottom Widget box (Bottom Widget 3). To edit please go to Appearance > Widgets and choose 3rd widget from the top in area second called Bottom Widget 3. Title is also manageable from widgets as well.'

    When I go to the widgets, this Third Box does not contain anything, therefore I cannot modify this.

    Please advise!

    Thanks.

  2. Sampression
    Member
    Theme Author

    Posted 1 year ago #

    Hey ElmT,
    That is the dummy text displayed. It will not show if you place any widgets in that place from admin. If you want to remove it please go to sidebar.php on theme folder(sampression-lite) and comment out lines79 to 82:

    <header class="widget-title"><?php _e('About me', 'sampression'); ?></header>
                    <div class="widget-entry">
    				<?php _e('This is your Third Bottom Widget box (Bottom Widget 3). To edit please go to Appearance > Widgets and choose 3rd widget from the top in area second called Bottom Widget 3. Title is also manageable from widgets as well.','sampression'); ?>
    				</div>

    Let us know if this helped.
    Sampression Team

  3. Frettsy
    Member
    Posted 1 year ago #

    After the update, even if I add a widget there, the sampression_default_widgets() function is overwriting it at every page load.

  4. Sampression
    Member
    Theme Author

    Posted 1 year ago #

    Hi Frettsy,

    Until our next update please replace the function on \wp-content\themes\sampression-lite\includes\functions.php

    function sampression_default_widgets() {
    	...
    }

    with

    function sampression_default_widgets() {
    	 $sidebars_widgets = get_option( 'sidebars_widgets' );
    	 if( empty($sidebars_widgets['bottom-widget-3']) ){ 	//if there are no widgets on the 'bottom-widget-3'
    
    				$id = count( $sidebars_widgets ) + 1;
    				$sidebars_widgets['bottom-widget-3'] = array( "text-" . $id );
    
    				$ops = get_option( 'widget_text' );
    				$ops[$id] = array(
    					'title' => 'About me automatic widget',
    					'text' => 'This is an automatic widget added on Third Bottom Widget box (Bottom Widget 3). To edit please go to Appearance > Widgets and choose 3rd widget from the top in area second called Bottom Widget 3. Title is also manageable from widgets as well.',
    				);
    				update_option( 'widget_text', $ops );
    				update_option( 'sidebars_widgets', $sidebars_widgets );
    	 }
    }

    Hope this helps.

    Thanks

  5. Frettsy
    Member
    Posted 1 year ago #

    Thanks for the quick response. I actually ended up making a child theme and putting the following in its functions.php:

    add_action('after_setup_theme', 'my_after_setup_theme');
    function my_after_setup_theme() {
    	remove_filter( 'wp_title', 'sampression_filter_wp_title' );
    	remove_action('widgets_init', 'sampression_default_widgets', 11);
    }

    (the wp_title filter jacks up the SEO plugin title)

  6. BlogitCZ
    Member
    Posted 1 year ago #

    Hi,

    I temporarily fixed this problem by changing content of $sidebar_id variable in functions.php (line 307) to something else than "bottom-widget-3" (for example "bottom-widget-4"). This of course cripled the algorithm so this "dummy" widget doesn't show any more :)

    Amateur solution, I know, but still works for me :D

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags