Foofy
Forum Replies Created
-
Forum: Plugins
In reply to: Use Category Slug as link ID?Otto is right. Also, my code is kind of silly unless you want to allow other filters to modify the wp_list_categories output.
If you want more control over the HTML, use something like this:
<ul> <?php $categories = get_categories(); foreach($categories as $category) { ?> <li class='<?php echo $category->sulug; ?>'> <a href='<?php echo get_category_link($category->cat_ID); ?>'><?php echo $category->name; ?></a> </li> <?php } ?> </ul>
Also, get_categories can take the same parameters as wp_list_categories.
Forum: Plugins
In reply to: Use Category Slug as link ID?The list items have the category ID <i>number</i>, that should be all you need for specific styling with CSS. It’s easy enough to filter the list to add the IDs though. Just add this to your functions.php file.
// Register filter so we can edit the list generated by wp_list_categories add_filter('wp_list_categories', 'wp_list_categories_add_ids'); function wp_list_categories_add_ids($content) { // Use a regular expression to match the list item (and important bits like // the title) and pass it to a function which will return the replacement $content = preg_replace_callback('#<li(.*?)>(.*?)</li>#is', 'wp_list_categories_add_ids_callback', $content); return $content; } function wp_list_categories_add_ids_callback($matches) { // Build the replacement list item using the matches from the expression $replacement = '<li' . $matches[1] . ' id="' . sanitize_title_with_dashes($matches[2]) . '">'; $replacement .= $matches[2]; $replacement .= '</li>'; return $replacement; }
Forum: Plugins
In reply to: how to uninstall a plugin with the admin panel not working ?Hey copycatz,
Remove the plugin in your wp-content/plugins/ folder.
Forum: Fixing WordPress
In reply to: HTML in comments gets converted to entities when editingThanks! Found the specific ticket and patch. Here it is for reference:
Forum: Fixing WordPress
In reply to: Page links don’t work on categoriesActually, the above code breaks everything. I’m obviously too tired to know what I’m doing.
Forum: Fixing WordPress
In reply to: Page links don’t work on categoriesI fixed it! It took me a bit to understand the new way WordPress handles URL rewriting. It seems if no category base is specified (by just putting / in the option box) it sets it to “category/”.
This can be fixed by changing line 1079 in classes.php:
$this->category_structure = $this->front . 'category/';
To:
$this->category_structure = $this->front . '/';
Assuming that it is actually something that’s “broken” and needs to be fixed. I’m betting there’s a reason for it I’m just not aware of.
Forum: Themes and Templates
In reply to: Multiple blogs on one page.n/m, it pays to not be stupid (like me!) I eventually found what I was looking for, properly documented, just a little out of the way ’cause of the recent moving. ??