karlwills
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: WordPress Search Formanyone?
Forum: Fixing WordPress
In reply to: 2 or 3 column categories in sidebarThanks for that, got it to work perfectly from the code you supplied.
Thanks for all your help, its much appreciated
Forum: Fixing WordPress
In reply to: 2 or 3 column categories in sidebart31os_,
thanks for that, i have had a look around your profile and found a couple of things about displaying posts in columns but i am not sure if they apply to what i am trying to achieve?
Basically i am trying to show the 20 most recent posts in 2 columns (10 in each).
thanks
Forum: Fixing WordPress
In reply to: 2 or 3 column categories in sidebarthanks, is that to display the posts? or is there something else i would need to change also?
Thanks again.
Forum: Fixing WordPress
In reply to: 2 or 3 column categories in sidebarsorry to bother you again,
is there any way i could manipulate the above code to display latest posts added in 2 columns?
Im trying to learn PHP at the moment but am having some difficulty understanding it all. I can grasp the basics but i think this is a little bit out of my depth!
Thanks
Forum: Fixing WordPress
In reply to: 2 or 3 column categories in sidebarOk yes, spotted the mistake (plus another).
<?php
// Grab the categories – top level only (depth=1)
$get_cats = wp_list_categories( ‘echo=0&title_li=&depth=1&hide_empty=0’ );
// Split into array items
$cat_array = explode(”,$get_cats);
// Amount of categories (count of items in array)
$results_total = count($cat_array);
// How many categories to show per list (round up total divided by 3)
$cats_per_list = ceil($results_total / 3);
// Counter number for tagging onto each list
$list_number = 1;
// Set the category result counter to zero
$result_number = 0;
?>
<ul class=”cat_col” id=”cat-col-<?php echo $list_number; ?>”>
<?php
foreach($cat_array as $category) {
$result_number++;if($result_number % $cats_per_list == 0) {
$list_number++;
echo $category.’<ul class=”cat_col” id=”cat-col-‘.$list_number.'”>’;
}
else {
echo $category.”;
}
}
?><!–
/* All UL elements */
.cat_col {
width:200px;
float:left;
display:block;
padding:0;
margin:0 5px 0 0;
overflow:hidden;
}
/* All LI elements */
.cat_col li {
clear:left;
display:block;
padding:8px;
margin:1px 0 0 0;
width:200px;
}#cat-col-1 {
/* CSS for first list only */
}
#cat-col-2 {
/* CSS for second list only */
}
#cat-col-3 {
/* CSS for third list only */
}
–>Should work as expected now.. ??
Brilliant, works perfectly!
Thank you very much for your help, I wouldn’t have been able to do what you have done and am very grateful to people like you who take the time to help others. Thanks again
Forum: Fixing WordPress
In reply to: 2 or 3 column categories in sidebarmany thanks for that.
The list now seems to have gone into 2 columns, with the first column only showing 1 category and the second holding the rest (around 20 or so categories.) there seems to be no third column….
I had a look at the code in firebug and no 3rd column seems to be generated by the code.
Sorry for the hassle!
Forum: Fixing WordPress
In reply to: 2 or 3 column categories in sidebarThanks again for your help, its much appreciated…
If you want to divide the total results evenly across 3 columns (automagically) i’ll need to modify the above code to suit what you want better.
That is exactly what i am looking for… is this easy to implement?
The result that i shown in the screenshot has the
- floated and a set width added to it.
Forum: Fixing WordPress
In reply to: 2 or 3 column categories in sidebarThanks for that,
I changed it like you said and it still seems to do the same thing. I have uploaded a screenshot to show you how it looks with your code: screenshot and here is how i am trying to get my code to look: result
Is there anything i could change to make it look like that?
Thanks
Forum: Fixing WordPress
In reply to: 2 or 3 column categories in sidebarthanks for that t31os_
I used your code on my website and it worked great…
one thing though, each list only displays 3 categories. I am looking for a 3 column list that each will hold 15 categories, could you please advise how this could be done? I am looking at displaying the categories as part of a directory website.
Thanks for your help
Forum: Fixing WordPress
In reply to: Need help caluclating future date in the Loop using custom fieldI am looking to do the same thing but am unsure where to place the query and what format should the dat be in the custom field?
Thanks
Forum: Fixing WordPress
In reply to: [Plugin: Contact Form 7] Contact Form Drop-Downcan anyone help please? still no solution…..
Forum: Fixing WordPress
In reply to: [Plugin: Contact Form 7] Contact Form Drop-DownI am still struggling with this, any help would be appreciated ??
Forum: Fixing WordPress
In reply to: [Plugin: Contact Form 7] CheckboxesI’m still having this problem, can anyone help?
Thanks