WordPress.org

Ready to get started?Download WordPress

Forums

Custom Post Widget
[resolved] Title and text content not aligned (7 posts)

  1. Blaque
    Member
    Posted 3 years ago #

    Thanks for a great plugin that allows editors to change the content of widgets! I am experiencing a layout problem and I am wondering if you might have any suggestions for solutions.

    My Content Blocks contain text only, but the title and the text content are not aligned. While the title is properly aligned, the text content is shifted to the left and the right margin also seem to be narrower. This problem does not occur when I use the standard WordPress text widget, see link. On this picture the top widget is the text widget and the bottom one the Content Block widget

    http://www.2shared.com/photo/ubS40E6S/text-custompost-widget.html

    Any idea of what the problem is?

  2. csleh
    Member
    Posted 3 years ago #

    It's probably a padding issue, easily fixed with css. But can't trouble-shoot from an image.

  3. Johan van der Wijk
    Member
    Plugin Author

    Posted 3 years ago #

    This is indeed a CSS issue. I would recommend installing the FireBug Add on for Firefox to find out which CSS rules are causing this.

  4. Blaque
    Member
    Posted 3 years ago #

    Is there a way to change how the Content Blocks are displayed, i.e. specify CSS category?

    Would appreciate any guidance!

  5. Johan van der Wijk
    Member
    Plugin Author

    Posted 3 years ago #

    Yes you can completely change the wasy the Content Blocks are displayed using CSS. Each content block has a unique css ID based on the post type ID (ie. custom_post_widget-3), and all content blocks share the class widget_custom_post_widget.

    This means that you can style them either individually via the ID, or create a generic style for all content blocks based in the class.

  6. Blaque
    Member
    Posted 3 years ago #

    Thanks, Johan, for your help. I might be a complete idiot, but where do I find the CSS file containing the widget_custom_post_widget class? In other words, how do I style the content block posts individually or class-wise?

  7. Johan van der Wijk
    Member
    Plugin Author

    Posted 3 years ago #

    You will have to add these classes and/or id's to the stylesheet that comes with the theme you have installed. You can find this stylesheet here: /wp-content/themes/your-theme-name/style.css.

    This is an example of a class you can use (replace the number 3 with the ID of the custom post you would like to style, see the html source) to add a border around a specific content block:

    #custom_post_widget-3 { border: 1px solid #000; }

    If you would like to generate a style that affects all content blocks you can use the class widget_custom_post_widget. For example, if you would like the font color in all the content blocks to be dark gray you can use this code:

    .widget_custom_post_widget { color: #333; }

    Good luck!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic