Forums

[resolved] Please help with widgetizing theme (11 posts)

  1. nontechblogger
    Member
    Posted 2 years ago #

    I tried installing a FSS feed widget, and it tells me that my theme is not widget-aware. I'm trying to follow the instructions at http://codex.wordpress.org/Widgetizing_Themes, but I need further help.

    I'm using my own theme that my web designer edited for me. I think I know what to do with my sidebar.php. My question is the functions.php that I'm supposed to modify. I see this file in my blog-txt_v4-0 folder in themes folder. Is this what I'm supposed to edit? It looks like the instructions say to ad this code in that file:

    <?php
    if ( function_exists('register_sidebar') )
    register_sidebar();
    ?>

    But I don't know exactly where to put this code. Any help would be appreciated.

  2. @mercime
    Member
    Posted 2 years ago #

    Open up your theme's functions.php with plain text editor like notepad or bbedit, etc. and and add/paste those 4 lines into functions.php. Make sure there's no space before the opening <?php
    Then close and save functions.php and upload to your theme folder in server.

    Open up your sidebar.php and add the following code before or after the custom codes placed by your designer

    <?php if ( !function_exists('dynamic_sidebar')
            || !dynamic_sidebar() ) : ?>
    <?php endif; ?>
  3. nontechblogger
    Member
    Posted 2 years ago #

    mercime, thanks for your reply. I understand that from the codex help page. As I said in my initial post, 1) I found the functions.php file in blog-txt_v4-0 folder in themes folder, and I wasn't sure if that's the file I'm supposed to modify. 2) I don't know where exactly in functions.php I'm supposed to add that code.

  4. Shane G
    Member
    Posted 2 years ago #

  5. nontechblogger
    Member
    Posted 2 years ago #

    Shane,

    Thanks but your post doesn't solve my problem either. As I said in my initial post, I've already read and tried to follow the instructions in http://codex.wordpress.org/Widgetizing_Themes. That's why I'm here.

    1) I don't know where functions.php is.
    2) Where exactly in functions.php (what line?) do I add that code?

  6. Shane G
    Member
    Posted 2 years ago #

    Hi,

    You can find the functions.php file inside your active theme folder of your blog. Regarding the lines I have already mentioned in the case study.

    Thanks,

    Shane G.

  7. nontechblogger
    Member
    Posted 2 years ago #

    There is no functions.php in my theme folder. There is one, however, in another folder named blog-txt_v4-0 under the Themes directory.

  8. @mercime
    Member
    Posted 2 years ago #

    If the theme you are currently using has no functions.php then create one. Open notepad, add the code for functions.php, then File > Save As - choose All Files in dropdown (instead of default .txt file) and name it functions.php and save it to your theme folder in your computer. Then FTP upload the new file i.e. functions.php to your theme folder in server.

  9. nontechblogger
    Member
    Posted 2 years ago #

    mercime,

    What code? The code for widgetizing? Can I just copy the existing functions.php and save it in my themes folder?

  10. @mercime
    Member
    Posted 2 years ago #

    Can I just copy the existing functions.php and save it in my themes folder?

    What and where is that existing functions.php? The code you posted above? If so, as I posted above, copy it in your theme's folder and UPLOAD to theme's folder in server. Don't forget to add the necessary code to your theme's sidebar.php then save and UPLOAD to theme's folder in server.

  11. nontechblogger
    Member
    Posted 2 years ago #

    I created a functions.php and pasted just that code, and it seemed to work. Thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic