if you need to limit the creator of posts in the number of selected categories to one then I have good news for you.
NOTE: This code just change checkbox to radio in category form and doesn't validate it in backend!
if you need to limit the creator of posts in the number of selected categories to one then I have good news for you.
NOTE: This code just change checkbox to radio in category form and doesn't validate it in backend!
<?php /** * Add numerious for each widget in sidebar */ function htmlandcms_widget_classes($params) { static $classes; if (!isset($classes[$params[0]['id']])) { $classes[$params[0]['id']] = 1; } else { $classes[$params[0]['id']] += 1; } $params[0]['before_widget'] = "<div id='{$params[0]['id']}-{$classes[$params[0]['id']]}'>" . $params[0]['before_widget']; $params[0]['after_widget'] = $params[0]['after_widget'] . "</div>"; return $params; } add_filter('dynamic_sidebar_params', 'htmlandcms_widget_classes');
Sometimes we need to use $_GET params in custom pages for something like custom filter.
In my case i must create page with custom query_posts, filter this posts and glossary. In glossary links must look like site.com/glossary/a/ or site.com/glossary/b/
First we need to create page with slug 'glossary' and set permalink to Post name.
In theme directory copy page.php to page-glossary.php and put this code
If you need to add rel="fancybox" in the standard wordpress gallery, then this is a lesson for you.
Firstly what we need to do, its enqueue fancybox script, add image sizes for thumbnail and big picture and change implementation of gallery shortcode by default.
So let's do it.
Task to show random comment with link to post. The decision below. First we get all approved comments. If we have comments we get random number among of existing, then we print comment content, and put link to commented post. Thats all, we spent some time to do it and we hope our solution will be useful for you.
Task to show random comment with link to post. The decision below. First we get all approved comments. If we have comments we get random number among of existing, then we print comment content, and put link to commented post. Thats all, we spent some time to do it and we hope our solution will be useful for you.
Sometimes we need to add a lot of specific custom fields to the post (may be even depending on post category). Standard wordpress custom field metabox doesn't look very friendly. Of course you can use some plugin, like Custom Field Template, but you should consider that any plugin is an extension which is maintained by one or couple authors. You will always depend on it. More over plugins add database tables, there are a lot of security reasons for doing everything in wordpress way, using just core functionality.