WordPress.org

Ready to get started?Download WordPress

Forums

Widget File Location (13 posts)

  1. millsy
    Member
    Posted 5 years ago #

    I have added the widget for 'Recent Posts'. I now want to control how/where this information is displayed, however I am a
    little confused, the information shows on the right hand side bar, but when I look at sidebar.php there is nothing about recent
    posts in there? Which file should I be looking at?

  2. JayMyers
    Member
    Posted 5 years ago #

    Bump I have the same question.

  3. Roger Theriault
    Member
    Posted 5 years ago #

    Your template files will only have a function call to load the sidebar contents, that's why it's a "dynamic" sidebar.

    All sidebars and widgets are controlled under the Design menu, Widgets. But I bet you know this, because you have to go there to add widgets to a sidebar. Click on the widget on the right, while it's shown in its sidebar, and some widgets have settings you can change.

    If those settings aren't sufficient, or unclear, check the plugin's readme file. There may be other settings or changes you can make.

  4. JayMyers
    Member
    Posted 5 years ago #

    Ok I got that.

    Let me ask you this.

    In the Cutline theme, l_sidebar and r_sidebar default are coded to show what they want. But as soon as you add a widget to a sidebar, that supersedes those 2 php files. Correct? Assuming that is true, where can you go in and edit the code after you add the widget, take for example categories, if I wanted to only display certain cats, which I know how to do from the codex, about the loop, and also reading pearsonified.com, but then wanted another category widget added for another category.

    To do this, is the only reason I can see why they let you add multiple instances of the category widget, unless I am missing something completely.

  5. Roger Theriault
    Member
    Posted 5 years ago #

    If the dynamic sidebar is empty, the if statement will result in that code being executed, otherwise it will be skipped.

    Some widgets have no settings, and as a result, many people find they don't meet their particular needs.

    If the widget is too plain vanilla, you'll need to try one of the alternatives in the Plugin Directory.

    Or move the section of code in the sidebar template outside of the if statement, so it is displayed before or after your dynamic sidebar.

  6. millsy
    Member
    Posted 5 years ago #

    You suggest "Move the section of code in the sidebar template outside of the if statement, so it is displayed before or after your dynamic sidebar."

    My problem is I cannotfind any section relating to the Recent Posts section anywhere, and yet when my page is shown in the browser it is displayed within the sidebar and I do not want it there.

  7. Roger Theriault
    Member
    Posted 5 years ago #

    @millsy: You won't find anything related to Recent Posts anywhere in your theme directory.

    You need to go to Admin, Design, Widgets. Choose the sidebar from the dropdown if you have more than one. Your Recent Posts widget will be in there. And all the other widgets too.

  8. millsy
    Member
    Posted 5 years ago #

    It is there, but all it allows me to do is change the title and the number of posts to show. What about being able to change the location and style of the widget?

  9. Roger Theriault
    Member
    Posted 5 years ago #

    The location depends on which sidebar you put it in and in what order.

    The style depends on what you have in your style.css file. You can do a lot with CSS, and specifically affect just that widget or all your widgets in general. http://codex.wordpress.org/CSS

  10. millsy
    Member
    Posted 5 years ago #

    I have used the default theme, and it is in 'sidebar 1' on my widget design page.

    I know I can do alot with CSS to syle my widget but at the moment it is in totally the wrong location on my page.

  11. Roger Theriault
    Member
    Posted 5 years ago #

    @millsy - then try a different theme with different sidebars, or customize your theme. You might find help on that in the Themes forum. Or read the Docs on customizing your blog.

  12. cuban_cigar
    Member
    Posted 5 years ago #

    Since this post is at the top of google, and yet unanswered,

    widgets.php

    that is the name of the wordpress widget file

  13. cosmocatalano
    Member
    Posted 4 years ago #

    And to further clarify, widgets.php is located in /wp-includes/.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags