Wordpress PHP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MasterBlow
    Confirmed User
    • Apr 2003
    • 2059

    #1

    Wordpress PHP

    How do I format the blogroll into two columns - create 2 css classes, 1 for each column?
  • GrouchyAdmin
    Now choke yourself!
    • Apr 2006
    • 12085

    #2
    You can do it the hard way if you really want, but render blogroll links allows pre, and post wrapping. If you need the logic to that, here's some an ancient routine I made in about 2004, it will return 'row1' or 'row2' by default - you ca specify the assigned variable you want displayed by naming it:

    Code:
    // This simple creature returns a numeric of 1, or 2, based upon the
    // global index for $gl['row']; You may set the prefix for this, or if passed as a boolean of TRUE for a secondary param; it will reset to '1'
    // -----------------
    function thisrow($name=FALSE, $reset=FALSE){
      global $gl;
      $name = (isset($name)) ? $name : "row"
      $gl['__row'] = ($reset) ? 1 : (($gl['__row']++%2) + 1);
      return($name . $gl['__row']);
    }
    Here's a sample:

    Code:
    $array = array("one","two","three","four","five");
    foreach ($array as $value) {
      echo "<div class =".thisrow("pie").">$value</div>";
    }

    Comment

    • fris
      Too lazy to set a custom title
      • Aug 2002
      • 55679

      #3
      Originally posted by MasterBlow
      How do I format the blogroll into two columns - create 2 css classes, 1 for each column?
      http://wordpress.org/extend/plugins/wp-multicollinks/
      Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

      Comment

      • MasterBlow
        Confirmed User
        • Apr 2003
        • 2059

        #4
        thnx guys

        Comment

        Working...