WordPress.org

Forums

Category post count on one line (5 posts)

  1. Nerz
    Member
    Posted 8 years ago #

    My very first post :)

    At my new site, Sitefiend.com, I installed a template that didnt enable category post count by default. I figured out how to do it with wp_list_count optioncount=1. The figure comes up but it puts it onto the next line instead of alongside the category.

    The relevant php source code is:

    <ul class="categories">
    <?php wp_list_cats('sort_column=name&optioncount=1&hide_empty=0'); ?>

    Any help on getting it too appear next to the category would be really helpful. Im sure its a relatively small thing, probably css.

  2. cori
    Member
    Posted 8 years ago #

    I was able to get it to do that in Firefox by adding

    #subcontent ul.categories li a {display: inline;}

    in the subcontent list section.

    Should work for IE as well, at least. Don't know about Safari.

  3. Nerz
    Member
    Posted 8 years ago #

    That fixed it :) Thx very much

  4. Altstatten
    Member
    Posted 8 years ago #

    Searched ALL of the psots I could find on this topic and this one seems to make the most sense, but it's still not working properly.

    I have this: wp_list_cats('sort_column=name&optioncount=1&hide_empty=0' properly in place and I get a number all right but it's on the line below instead of right next to, the category name.

    As to adding this: #subcontent ul.categories li a {display: inline;} to the css file, well I don't seem to have a subcontent section. (I made one---I think!---and added this line but nothing.)

    Here's my css file, anybody offer any help?

    /*
    Theme Name: Vertigo Enhanced
    Theme URL: http://www.briangardner.com/themes/vertigo-wordpress-theme.htm
    Description: Vertigo Enhanced is a modern, 3-column Widget-ready theme created for WordPress.
    Author: Brian Gardner
    Author URI: http://www.briangardner.com
    Version: 2.0

    The CSS, XHTML and design is released under GPL:
    http://www.opensource.org/licenses/gpl-license.php

    Changelog:
    v2.0 - 01.29.07
    First Release of Vertigo Enhanced
    */

    body {
    background: #FFFFFF url(images/bg.gif) repeat-x;
    color: #000000;
    font-size: 12px;
    font-family: Arial, Helvetica, Sans-Serif;
    margin: 0px auto 0px;
    padding: 0px;
    }

    #wrap {
    background: #FFFFFF;
    width: 960px;
    margin: 0px auto 0px;
    padding: 0px;
    }

    /************************************************
    * Hyperlinks *
    ************************************************/

    a, a:visited{
    color: #910156;
    text-decoration: none;
    }

    a:hover {
    text-decoration: underline;
    }

    /************************************************
    * Navbar *
    ************************************************/

    #navbar {
    background: #FFFFFF url(images/header.gif);
    width: 960px;
    height: 160px;
    margin: 0px auto 0px;
    padding: 0px;
    overflow: hidden;
    }

    #navbar img a{
    margin: 0px;
    border: none;
    }

    #navbarleft {
    background: #FFFFFF url(images/logo.gif);
    height: 160px;
    width: 160px;
    float: left;
    margin: 0px;
    padding: 0px;
    }

    #navbarright {
    width: 800px;
    float: right;
    text-align: right;
    margin: 0px;
    padding: 10px 0px 0px 0px;
    }

    #navbarright li {
    display: inline;
    list-style-type: none;
    margin: 0px;
    padding: 0px;
    }

    #navbarright ul {
    margin: 0px;
    padding: 0px;
    }

    #navbarright a, #navbarright a:visited {
    color: #FFFFFF;
    font-weight: bold;
    margin: 0px;
    padding: 6px 10px 6px 10px;
    text-decoration: none;
    }

    #navbarright a:hover {
    color: #FFFFFF;
    font-weight: bold;
    text-decoration: underline;
    }

    /************************************************
    * Content *
    ************************************************/

    #content {
    width: 960px;
    margin: 0px auto 0px;
    padding: 0px;
    }

    #content p{
    padding: 0px 0px 15px 0px;
    margin: 0px;
    line-height: 20px;
    }

    #content h1 {
    color: #000000;
    font-size: 22px;
    font-family: Century Gothic, Verdana, Arial, Sans-Serif;
    font-weight: normal;
    margin: 25px 0px 0px 0px;
    padding: 20px 0px 10px 0px;
    border-top: 2px solid #000000;
    }

    #content h1 a {
    color: #000000;
    text-decoration: none;
    }

    #content h1 a:hover {
    color: #910156;
    text-decoration: none;
    }

    #content p img{
    float: left;
    border: none;
    margin-right: 15px;
    margin-bottom: 10px;
    }

    #content h2 {
    color: #910156;
    font-size: 22px;
    font-family: Century Gothic, Verdana, Arial, Sans-Serif;
    font-weight: normal;
    padding: 20px 0px 5px 0px;
    margin: 0px;
    border-bottom: 1px solid #C0C0C0;
    }

    #content h3 {
    color: #000000;
    font-size: 22px;
    font-family: Century Gothic, Verdana, Arial, Sans-Serif;
    font-weight: normal;
    margin: 25px 0px 0px 0px;
    padding: 20px 0px 10px 0px;
    }

    #content img.wp-smiley {
    float: none;
    border: none;
    padding: 0px;
    margin: 0px;
    }

    #content img.wp-wink {
    float: none;
    border: none;
    padding: 0px;
    margin: 0px;
    }

    #contentleft {
    float: left;
    width: 470px;
    margin: 0px 0px 0px 0px;
    padding: 0px 0px 20px 0px;
    }

    #contentleft ol{
    margin: 0px 0px 0px 20px;
    padding: 0px 0px 10px 0px;
    }

    #contentleft ol li{
    margin: 0px 0px 0px 20px;
    padding: 0px 0px 0px 0px;
    }

    #contentleft ul{
    list-style-type: square;
    margin: 0px 0px 0px 20px;
    padding: 0px 0px 10px 0px;
    }

    #contentleft ul li{
    list-style-type: square;
    margin: 0px 0px 0px 20px;
    padding: 0px 0px 0px 0px;
    }

    blockquote{
    margin: 0px 25px 10px 25px;
    padding: 0px 25px 0px 10px;
    background: #E8E8E8;
    border-top: 2px solid #000000;
    border-bottom: 1px solid #000000;
    }

    #content blockquote p{
    margin: 0px 0px 10px 0px;
    padding: 10px 0px 0px 0px;
    }

    #subcontent ul.categories li a {display: inline;}

    /************************************************
    * Left Sidebar *
    ************************************************/

    #l_sidebar {
    float: left;
    width: 225px;
    margin: 25px 0px 0px 20px;
    padding: 0px 0px 20px 0px;
    border-top: 2px solid #000000;
    }

    #l_sidebar ul {
    list-style: none;
    margin: 0px;
    padding: 0px;
    }

    #l_sidebar ul li {
    display: inline;
    padding: 0px;
    margin: 0px;
    }

    #l_sidebar ul li a {
    display: block;
    color: #000000;
    text-decoration: none;
    margin: 0px;
    padding: 5px 0px 5px 0px;
    border-bottom: 1px solid #C0C0C0;
    }

    #l_sidebar ul li a:hover {
    background: #EFEFEF;
    color: #910156;
    }

    #l_sidebar p{
    padding: 3px 0px 0px 0px;
    margin: 0px;
    line-height: 20px;
    }

    /************************************************
    * Right Sidebar *
    ************************************************/

    #r_sidebar {
    float: right;
    width: 225px;
    margin: 25px 0px 0px 20px;
    padding: 0px 0px 20px 0px;
    border-top: 2px solid #000000;
    }

    #r_sidebar ul {
    list-style: none;
    margin: 0px;
    padding: 0px;
    }

    #r_sidebar ul li {
    display: inline;
    padding: 0px;
    margin: 0px;
    }

    #r_sidebar ul li a {
    display: block;
    color: #000000;
    text-decoration: none;
    margin: 0px;
    padding: 5px 0px 5px 0px;
    border-bottom: 1px solid #C0C0C0;
    }

    #r_sidebar ul li a:hover {
    background: #EFEFEF;
    color: #910156;
    }

    #r_sidebar p{
    padding: 3px 0px 0px 0px;
    margin: 0px;
    line-height: 20px;
    }

    /************************************************
    * Footer Background *
    ************************************************/

    #footerbg {
    background: #555555;
    }

    /************************************************
    * Footer *
    ************************************************/

    #footer {
    width: 960px;
    height: 400px;
    background: #555555;
    color: #FFFFFF;
    margin: 0px auto 0px;
    text-align: left;
    position: relative;
    line-height: 17px;
    }

    #footer p {
    color: #FFFFFF;
    padding: 0px;
    list-style-type: none;
    margin: 0px;
    }

    #footer h2 {
    color: #FFFFFF;
    font-size: 12px;
    font-family: Arial, Helvetica, Sans-Serif;
    font-weight: bold;
    border-bottom: 2px solid #666666;
    padding: 0px 0px 2px 0px;
    margin: 15px 0px 0px 0px;
    text-transform: uppercase;
    }

    #footer h3 {
    color: #FFFFFF;
    font-size: 12px;
    font-family: Arial, Helvetica, Sans-Serif;
    font-weight: bold;
    border-bottom: 2px solid #666666;
    padding: 0px 0px 2px 0px;
    margin: 15px 0px 3px 0px;
    text-transform: uppercase;
    }

    #footer a {
    color: #AAAAAA;
    text-decoration: none;
    }

    #footer a:hover {
    color: #FFFFFF;
    text-decoration: none;
    }

    #footer ul {
    list-style: none;
    margin: 0px 0px 0px 0px;
    padding: 0px;
    }

    #footer ul li {
    display: inline;
    padding: 0px;
    margin: 0px;
    }

    #footer ul li a {
    display: block;
    color: #FFFFFF;
    text-decoration: none;
    margin: 0px;
    padding: 5px 0px 5px 0px;
    border-bottom: 1px solid #666666;
    }

    #footer ul li a:hover {
    background: #333333;
    color: #FFFFFF;
    }

    #footerleft {
    background: #555555;
    float: left;
    width: 225px;
    margin: 0px 20px 0px 0px;
    padding: 0px;
    }

    #footermiddle1 {
    background: #555555;
    float: left;
    width: 225px;
    margin: 0px 20px 0px 0px;
    padding: 0px;
    }

    #footermiddle2 {
    background: #555555;
    float: left;
    width: 225px;
    margin: 0px 20px 0px 0px;
    padding: 0px;
    }

    #footerright {
    background: #555555;
    float: right;
    width: 225px;
    margin: 0px 0px 0px 0px;
    padding: 0px;
    }

    /************************************************
    * Search Form *
    ************************************************/

    #searchdiv {
    margin: 0px;
    padding 0px;
    }

    #searchform {
    margin: 0px;
    padding: 0px;
    overflow: hidden;
    }

    #s {
    background: #EFEFEF url(images/search.gif);
    color: #333333;
    font-size: 11px;
    font-family: Verdana, Helvetica, Sans-Serif;
    padding: 2px;
    margin: 4px 0px 0px 0px;
    border: 1px solid #C0C0C0;
    }

    #sbutt {
    background: #878787;
    color: #FFFFFF;
    font-size: 11px;
    font-family: Verdana, Helvetica, Sans-Serif;
    padding: 1px;
    margin: 0px 0px 0px 5px;
    border: 1px solid #333333;
    }

    /************************************************
    * Comments *
    ************************************************/

    #commentblock {
    width: 430px;
    background: #E8E8E8;
    color: #000000;
    float: left;
    padding: 20px 20px 10px 20px;
    margin: 10px 0px 0px 0px;
    border-top: 2px solid #000000;
    border-bottom: 1px solid #000000;
    }

    #commentblock ol{
    list-style-type: square;
    margin: 0px 0px 0px 0px;
    padding: 0px 0px 10px 0px;
    }

    .commentdate {
    font-size: 12px;
    padding-left: 0px;
    }

    #commentlist li p{
    margin-bottom: 8px;
    line-height: 20px;
    padding: 0px;
    }

    .commentname {
    color: #333333;
    margin: 0px;
    padding: 5px 5px 5px 0px;
    }

    .commentinfo{
    clear: both;
    }

    .commenttext {
    clear: both;
    margin: 3px 0px 10px 0px;
    padding: 20px 10px 5px 10px;
    width: 380px;
    background: #FFFFFF url(images/comment.gif) no-repeat top;
    }

    .commenttext-admin {
    clear: both;
    margin: 3px 0px 10px 0px;
    padding: 20px 10px 5px 10px;
    width: 380px;
    background: #FFFFFF url(images/comment.gif) no-repeat top;
    }

    #commentsformheader{
    padding-left: 0px;
    }

    #commentsform{
    text-align: center;
    margin: 0px;
    padding: 0px;
    }

    #commentsform form{
    text-align: left;
    margin: 0px;
    }

    #commentsform p{
    margin: 0px;
    }

    #commentsform form textarea{
    width: 99%;
    }

    p.comments_link img{
    margin: 0px;
    padding: 0px;
    border-top-style: none;
    border-right-style: none;
    border-bottom-style: none;
    border-left-style: none;
    }

  5. gspark
    Member
    Posted 7 years ago #

    I found a workable solution

    if ( isset($show_count) && $show_count )
    $link .= '<span>(' . intval($category->category_count) . ')</span>';

    this puts a < span > tag around the count then for CSS i used this

    position: relative;
    float: right;
    top: ;
    left: ;

Topic Closed

This topic has been closed to new replies.

About this Topic