WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Me again -- how can I remove widgets (14 posts)

  1. karykat
    Member
    Posted 3 years ago #

    My site is http://www.premiumlegalwriting.com (if that helps.)

    (Still primitive. Learning as I go.)

  2. Digital Raindrops
    Member
    Posted 3 years ago #

    In your theme you will have a file or files called sidebar or sidebar1.php, sidebar2.php etc:

    Inside these files so the user get the theme in the screenshot, the widgets are hard coded, by the theme authors.

    Lets look at a cutdown Twenty ten, sidebars.php file.

    /* When we call the dynamic_sidebar() function, it'll spit out
    * the widgets for that widget area. If it instead returns false,
    * then the sidebar simply doesn't exist, so we'll hard-code in
    * some default sidebar stuff just in case.
    */
    if ( ! dynamic_sidebar( 'primary-widget-area' ) ) : ?>
    	<li id="meta" class="widget-container">
    		<h3 class="widget-title"><?php _e( 'Meta', 'twentyten' ); ?></h3>
    		<ul>
    			<?php wp_register(); ?>
    			<li><?php wp_loginout(); ?></li>
    			<?php wp_meta(); ?>
    		</ul>
    	</li>
    <?php endif; // end primary widget area ?>

    The code below says if the primary-widget-area has no widgets, then add some hard coded ones.

    if ( ! dynamic_sidebar( 'primary-widget-area' ) ) : ?>

    However the secondary area does not have this condition when not populated!

    <?php
    // A second sidebar for widgets, just because.
    if ( is_active_sidebar( 'secondary-widget-area' ) ) : ?>
    	<div id="secondary" class="widget-area" role="complementary">
    		<ul class="xoxo">
    			<?php dynamic_sidebar( 'secondary-widget-area' ); ?>
    		</ul>
    	</div><!-- #secondary .widget-area -->
    <?php endif; ?>

    You would need to remove the code, if you want an empty sidebar to start.

    Although removing the widget code, only gives a blank space not a wide template, most themes have a wide template page in the page options.

    Question is why do you want to remove the default widgets?

    Suggestion:
    I see you are using the Copy Blogger theme, have a look in the Appearance > Theme Options, or Settings > Copy Blogger if there is one?

    If not Pages > Pages select a page 'Quick Edit' Page Templates and see if there is a single column template.

    HTH

    David

  3. karykat
    Member
    Posted 3 years ago #

    Thank you so much for looking at this.

    I wanted to remove the default widgets because I don't have enough content to "search" yet (although eventually I may), and I'm not blogging so I didn't want to use the RSS feed. And I was concerned that as I play around with the site to fix it up, someone who had subscribed would be seeing all my little meaningless experiments. (And would realize I don't know what I'm doing!)

    To remove the widgets, do I remove the relevant part of the code? How do I know what to remove?

    Following your lead, I found this stuff under the sidebar file for my site:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    I hope it's not an etiquette violation to put the code here this way. If a better way to do it, just let me know.

    So what do I do to this to get rid of these two widgets?

    A million thank yous.

  4. Digital Raindrops
    Member
    Posted 3 years ago #

    To remark a html block start with

    <!-- Remarked by

    To end the remarked line or code block see the end of line 2

    -->

    Never delete code so you can roll back should you need to, keep a note of changes in-case you update the theme and lose your changes.

    Your sidebar file should look like this, See the Lines 2 and 4-9!

    <div id="sidebar">
    	<!-- Remarked by KK <p id="rss"><a href="<?php bloginfo('rss2_url'); ?>" title="Subscribe to this site's feed"></a></p> -->
    	<ul class="sidebar_list">
    		<!-- Start Remarked by KK
    		<li class="widget">
    			<h2>Search</h2>
    			<?php include (TEMPLATEPATH . '/searchform.php'); ?>
    		</li>
    		End Remarked by KK -->
    		<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar()) : ?>
    		<li class="widget">
    			<h2>Latest Blog Entries</h2>
    			<ul>
    				<?php query_posts('showposts=10'); ?>
    				<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    				<li><a href="<?php the_permalink() ?>"><?php the_title() ?></a></li>
    				<?php endwhile; endif; ?>
    			</ul>
    		</li>
    		<li class="widget">
    			<h2>Categories</h2>
    			<ul>
    				<?php wp_list_categories('title_li=0'); ?>
    			</ul>
    		</li>
    		<?php get_links_list('id'); ?>
    		<?php endif; ?>
    	</ul>
    </div>

    HTH

    Mark both posts as resolved if this fixes your problem.

    HTH

    David

  5. karykat
    Member
    Posted 3 years ago #

    I am 99% of the way there.

    The changes you suggested removed the RSS widget and the search widget.

    I have a little bit of text just floating on the page though. Looks like a fragment of code.

    How do I get rid of that?

    Here are the changes I made, so the sidebar area now reads as follows:

    div id="sidebar">
    	<!-- Remarked by KK <p id="rss"><a href="<?php bloginfo('rss2_url'); ?>" title="Subscribe to this site's feed"></a></p> -->
    	<ul class="sidebar_list">
    		<!-- Start Remarked by KK
    		<li class="widget">
    			<h2>Search</h2>
    			<?php include (TEMPLATEPATH . '/searchform.php'); ?>
    		</li>
    		End Remarked by KK -->
    		<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar()) : ?>
    		<li class="widget">
    			<h2>Latest Blog Entries</h2>
    			<ul>
    				<?php query_posts('showposts=10'); ?>
    				<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    				<li><a href="<?php the_permalink() ?>"><?php the_title() ?></a></li>
    				<?php endwhile; endif; ?>
    			</ul>
    		</li>
    		<li class="widget">
    			<h2>Categories</h2>
    			<ul>
    				<?php wp_list_categories('title_li=0'); ?>
    			</ul>
    		</li>
    		<?php get_links_list('id'); ?>
    		<?php endif; ?>
    	</ul>
    </div>

    And is there a way to get my little menu (That currently reads "About Me" with some subheadings off to the side again rather than at the bottom. In a sidebar area? Or did I completely eliminate the sidebar option?

    Thanks again.

    Karen

  6. Digital Raindrops
    Member
    Posted 3 years ago #

    You cut the leading cheveron <

    div id="sidebar">

    Should be!

    <div id="sidebar">

    ;-)

  7. karykat
    Member
    Posted 3 years ago #

    So I'll just add that back and see what happens.

    With fingers crossed.

  8. karykat
    Member
    Posted 3 years ago #

    That resolved both of my questions.

    Thank you.

    You are a prince.

    Karen

  9. karykat
    Member
    Posted 3 years ago #

    And this topic is successfully resolved. Think I can mark that.

  10. carlacuomo
    Member
    Posted 3 years ago #

    Hi there, I am using twenty ten theme and I do want to eliminate all my widgets too. I have read all the post but still not very sure I am doing the right steps.
    do I have to copy and paste the all code above in my sidebar.php?
    is this all I have to do?
    thanks

  11. esmi
    Forum Moderator
    Posted 3 years ago #

    @carlacuomo: Please post new topics.

  12. carlacuomo
    Member
    Posted 3 years ago #

    @esmi
    so sorry, don't know how to resolve this issue and I am writing in the wrong session, I am very knew to forums

  13. esmi
    Forum Moderator
    Posted 3 years ago #

    Go to http://wordpress.org/support/forum/how-to-and-troubleshooting
    Scroll to the bottom of the page.
    Complete the New Topic form.

    If you continue to add your questions onto threads that are months old, it's highly unlikely that any will be answered.

  14. carlacuomo
    Member
    Posted 3 years ago #

    thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.