GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Wordpress PHP (https://gfy.com/showthread.php?t=903120)

MasterBlow 05-02-2009 01:26 AM

Wordpress PHP
 
How do I format the blogroll into two columns - create 2 css classes, 1 for each column?

GrouchyAdmin 05-02-2009 02:05 AM

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>";
}


fris 05-02-2009 03:52 AM

Quote:

Originally Posted by MasterBlow (Post 15810785)
How do I format the blogroll into two columns - create 2 css classes, 1 for each column?

http://wordpress.org/extend/plugins/wp-multicollinks/

MasterBlow 05-02-2009 09:44 AM

thnx guys :thumbsup


All times are GMT -7. The time now is 08:26 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123