WordPress.org

Ready to get started?Download WordPress

Forums

How to remove the links on the meta widget (8 posts)

  1. evilfx
    Member
    Posted 6 years ago #

    Hi,

    how can i remove the "entries rss" and "comments rss" links from the meta widget ?

  2. scribu
    Member
    Posted 6 years ago #

    Paste this in your functions.php

    // Widget: Meta; to match the Sandbox style and replace Widget plugin default
    function widget_sandbox_meta($args) {
    	extract($args);
    	$options = get_option('widget_meta');
    	$title = empty($options['title']) ? __( 'Meta', 'sandbox' ) : $options['title'];
    ?>
    			<?php echo $before_widget; ?>
    				<?php echo $before_title . $title . $after_title; ?>
    				<ul>
    					<?php wp_register() ?>
    
    					<li><?php wp_loginout() ?></li>
    					<?php wp_meta() ?>
    
    				</ul>
    			<?php echo $after_widget; ?>
    <?php
    }
  3. evilfx
    Member
    Posted 6 years ago #

    i tried adding that code to the beggining, middle and end of that file, it doesn't work.

    my website's urls is http://www.futept.com

    help ?

  4. scribu
    Member
    Posted 6 years ago #

    I forgot a part...also add this code:

    // Widgets plugin: intializes the plugin after the widgets above have passed snuff
    function sandbox_widgets_init() {
    	// Sandbox Meta widget
    	$widget_ops = array(
    		'classname'    =>  'widget_meta',
    		'description'  =>  __( "Log in/out and administration links (Sandbox)", "sandbox" )
    	);
    	wp_register_sidebar_widget( 'meta', __( 'Meta', 'sandbox' ), 'widget_sandbox_meta', $widget_ops );
    	unregister_widget_control('meta');
    	wp_register_widget_control( 'meta', __('Meta'), 'wp_widget_meta_control' );
    }
    
    // Runs our code at the end to check that everything needed has loaded
    add_action( 'init', 'sandbox_widgets_init' );
  5. evilfx
    Member
    Posted 6 years ago #

    Parse error: syntax error, unexpected '}' in /home/futeptco/public_html/wp-content/themes/freshnews/functions.php on line 572

    :(

  6. scribu
    Member
    Posted 6 years ago #

    It should look something like this:

    // Widget: Meta; to match the Sandbox style and replace Widget plugin default
    function widget_sandbox_meta($args) {
    	extract($args);
    	$options = get_option('widget_meta');
    	$title = empty($options['title']) ? __( 'Meta', 'sandbox' ) : $options['title'];
    ?>
    			<?php echo $before_widget; ?>
    				<?php echo $before_title . $title . $after_title; ?>
    				<ul>
    					<?php wp_register() ?>
    
    					<li><?php wp_loginout() ?></li>
    					<?php wp_meta() ?>
    
    				</ul>
    			<?php echo $after_widget; ?>
    <?php
    }
    
    // Widgets plugin: intializes the plugin after the widgets above have passed snuff
    function sandbox_widgets_init() {
    	// Sandbox Meta widget
    	$widget_ops = array(
    		'classname'    =>  'widget_meta',
    		'description'  =>  __( "Log in/out and administration links (Sandbox)", "sandbox" )
    	);
    	wp_register_sidebar_widget( 'meta', __( 'Meta', 'sandbox' ), 'widget_sandbox_meta', $widget_ops );
    	unregister_widget_control('meta');
    	wp_register_widget_control( 'meta', __('Meta'), 'wp_widget_meta_control' );
    }
    
    // Runs our code at the end to check that everything needed has loaded
    add_action( 'init', 'sandbox_widgets_init' );

    Try to remove anything else from that file first (but keep it somewhere), and try it out.

  7. evilfx
    Member
    Posted 6 years ago #

    Parse error: syntax error, unexpected '}' in /home/futeptco/public_html/wp-content/themes/freshnews/functions.php on line 18

    :(

  8. scribu
    Member
    Posted 6 years ago #

    Damn...I forgot to add the opening and closing tags.

    <?php
    // Widget: Meta; to match the Sandbox style and replace Widget plugin default
    function widget_sandbox_meta($args) {
    	extract($args);
    	$options = get_option('widget_meta');
    	$title = empty($options['title']) ? __( 'Meta', 'sandbox' ) : $options['title'];
    ?>
    			<?php echo $before_widget; ?>
    				<?php echo $before_title . $title . $after_title; ?>
    				<ul>
    					<?php wp_register() ?>
    
    					<li><?php wp_loginout() ?></li>
    					<?php wp_meta() ?>
    
    				</ul>
    			<?php echo $after_widget; ?>
    <?php
    }
    
    // Widgets plugin: intializes the plugin after the widgets above have passed snuff
    function sandbox_widgets_init() {
    	// Sandbox Meta widget
    	$widget_ops = array(
    		'classname'    =>  'widget_meta',
    		'description'  =>  __( "Log in/out and administration links (Sandbox)", "sandbox" )
    	);
    	wp_register_sidebar_widget( 'meta', __( 'Meta', 'sandbox' ), 'widget_sandbox_meta', $widget_ops );
    	unregister_widget_control('meta');
    	wp_register_widget_control( 'meta', __('Meta'), 'wp_widget_meta_control' );
    }
    
    // Runs our code at the end to check that everything needed has loaded
    add_action( 'init', 'sandbox_widgets_init' );
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.