WordPress.org

Ready to get started?Download WordPress

Forums

Customize the Code for a Widget (17 posts)

  1. kennyk3
    Member
    Posted 4 years ago #

    I'm trying to change the heading of a Widget in my sidebar to a graphic at:

    http://synapticsuccess.com/

    Just wondering where to find the code for the widget. It's the Membership Login details. I'm trying to add a graphic for the heading similar to the "Resources" heading.

    Thanks!

  2. s_ha_dum
    Member
    Posted 4 years ago #

    That's a default WP widget. Its in /wp-includes/default-widgets./php.

    I'd copy the code and paste it into a plugin or into your functions.php file and edit that, and save yourself some update headaches.

  3. Kevin S
    Member
    Posted 4 years ago #

    Login to your WordPress Admin area then under Appearance find Editor option. From Theme Files menu find sidebar_left.php or files related to slidebar and search for <h3>Register to Access Now</h3> and replace it with Image you want to put.

    ---
    [signature moderated Please read the Forum Rules]

  4. kennyk3
    Member
    Posted 4 years ago #

    Hey apljdi,

    Thanks for the response. How can I find the specific code for the membership login details within default-widgets.php

  5. s_ha_dum
    Member
    Posted 4 years ago #

    Its called WP_Widget_Meta, about line 280.

  6. kennyk3
    Member
    Posted 4 years ago #

    apljdi,

    I don't think that's the same widget. This one is specifically for the Wishlist Membership Plugin. I can't find it anywhere

  7. s_ha_dum
    Member
    Posted 4 years ago #

    Then it should be in /wp-content/plugins/<wishlist> or a subdirectory.

  8. kennyk3
    Member
    Posted 4 years ago #

    I've looked through everything in the plugin files. I can't find anything. It's pretty frustrating. The code's gotta be somewhere...

  9. Mark / t31os
    Moderator
    Posted 4 years ago #

    Noone going to offer the CSS solution then? :-(

    #wishlist-member h3 {
    	background:transparent url('http://synapticsuccess.com/images/resources.jpg')no-repeat top center;
    	text-indent:-1000px;
    	height:46px;
    	border:none;
    }

    Update the background image to reflect the image you want to use, i used the above as an example..

  10. kennyk3
    Member
    Posted 4 years ago #

    t31os_

    That worked great. The only problem is, I need it to have two different headings. One for when the user is logged in and one when the user is not logged in.

    Any ideas?

  11. Mark / t31os
    Moderator
    Posted 4 years ago #

    CSS isn't going to be able to do that for you, CSS only handles the visual side of things..

    Unless you apply that CSS in the head area of your theme's header.php, then you can wrap a condition around it..

    <style type="text/css">
    #wishlist-member h3 {
    <?php if ( is_user_logged_in() ) { ?>
    	background:transparent url('http://synapticsuccess.com/images/resources.jpg')no-repeat top center;
    <?php } else { ?>
    	background:transparent url('different-image.jpg')no-repeat top center;
    <?php } ?>
    	text-indent:-1000px;
    	height:46px;
    	border:none;
    }
    </style>

    Or something to that degree...

    That's purely a CSS solution (with exception to the minor PHP), ideally you need to be digging into the plugin or widget code and doing the changes there...

  12. kennyk3
    Member
    Posted 4 years ago #

    t31os_,

    You've been a huge help. I may have to use that in my header.php.

    That's what's so frustrating. I just can't seem to find the code I need to change. I've looked in all the plugin files, I've searched all the widget.php files. I just don't know where else to look...

    Thanks for all the help. If you have any other suggestions, I'd love to hear them!

  13. Mark / t31os
    Moderator
    Posted 4 years ago #

    Use an application that can search for text -within- files..

    Plonk a copy of the plugins folder on your desktop (Or wherever). If on mac, there's various grep options (i'm not a mac user), and on windows there are free apps such as Text Crawler.

    Search the files you've copied for strings of text you need to find..

    Example could be:

    <h3>Register to Access Now</h3>

    Or if that doesn't turn up results then maybe just..

    Register to Access Now

    Since it's a paid for plugin i can't download it to check for you, but it's simple enough to do (with the right tools).

  14. MrBluesummers
    Member
    Posted 4 years ago #

    This is just what I was looking for- how to edit the default widgets that come with WordPress. Thanks Apljdi!

  15. Skip Savage
    Member
    Posted 4 years ago #

    I think the Wishlist Member code is encrypted. Searching it for the target text didn't work. I wanted to change the punctuation in the widget and make a minor wording change to match the rest of my site, but have been stymied. Perhaps in a future release users will have this option.

  16. DrDivina
    Member
    Posted 4 years ago #

    I can't recommend WishList. I have it. It installed easily - but the whole point of WishList is being able to charge members and have them register. For 2 months I struggled with WishList asking for support - and their response was only to send me all the information I had already tried based on the videos and .pdf books they had. Nothing was working and they weren't stepping in to assist me with real help. So I hired a tech guy - and he saw the problem. Finally WishList provided the code, but after 2 months of struggling and literally begging them to help me, and spending $360 for a tech guy to figure it out, I CANNOT RECOMMEND WISHLIST! Their support was abysmal and basically none existent and the fact that I could not sell my product or get my product up for over 2 months costs me thousands of dollars of revenue. (My package goes for $1,497). Next time I buy something that has better support.

  17. agrp
    Member
    Posted 4 years ago #

    Can someone help me with my widget background?

    My site: http://www.thenorthwestreport.com

    I want images for the widgets.

    Much like the 5th and 6th page down:
    http://www.zy.sg/

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic