KS
Forum Replies Created
-
Forum: Requests and Feedback
In reply to: wp_get_archives exclude categoryI would also find this extremely useful. This plugin add the functionality, but it would make sense to add this to the core I think. We’ve got a couple of categories listed on a page, which can share an archive, but we have one category with very different posts and don’t want these mixed together.
Forum: Plugins
In reply to: current-cat in single post view with multiple categoriesI was looking to fix this as well and came across this tutorial which then linked to this plugin.
Instead of running the plugin (it’s just one function), I added it to my functions.php and now I get a current class for a category even when on a single page. Not sure if it works when having more than one level of categories, but might be worth giving it a try.
Forum: Fixing WordPress
In reply to: Page Parent Links To First Child Page?This might be what you’re looking for – Redirect to First Child
Forum: Plugins
In reply to: Custom Field Template: (Warning: Invalid argument supplied for foreach()…)We’ve also just come across this problem – did you manage to find a solution to it? Would be great if you could post, if so.
Forum: Fixing WordPress
In reply to: Multiple Users Same Email AddressThere was a plugin created for this problem – Allow Multiple Accounts – which used to work until 2.8.1 or 2.8.2, but unfortunately it hasn’t been updated since then and something seems to have changed in the code, so it doesn’t work any longer. Please post back if you find an alternative solution.
Forum: Fixing WordPress
In reply to: Problems using sIFR with qTranslate.The above would give you:
<script src="https://www.your-site.com/wp-content/themes/your-theme/js/your-sifr-file.js" type="text/javascript"></script>
Forum: Fixing WordPress
In reply to: Problems using sIFR with qTranslate.Hi there,
I would suggest using bloginfo to link to your files. You can reach various parts of the folder structure, such as root, template directory and so on. Using something like this in your header.php should work:
<script src="<?php echo bloginfo('template_url'); ?>/js/your-sifr-file.js" type="text/javascript"></script>
Give that a go and see how you get on.
Forum: Fixing WordPress
In reply to: Filter to change user role in adminNever managed to find a way of doing this. In the end, I used the Capability Manager plugin, which allowed me to create new groups.
Since I only really want to rename a user group when it’s displayed in the admin, it would still be great if it was possible with a filter (or other solution), as it would mean one plugin less!
Forum: Fixing WordPress
In reply to: List only grandparent pagesNot sure if this is what’s needed (or if you’re still looking), but here is a way to query for various levels of children.
Forum: Alpha/Beta/RC
In reply to: child_of not working in get_pagesHere is another way of getting the children of pages (you can even get the grand children) – query-child-of-page
Forum: Fixing WordPress
In reply to: Multiple meta_value for same pageIn the end we had someone help us figure this out. It might be that the solution is only suitable if you’re using the Flutter plugin, I’m not entirely sure, perhaps any custom field is fine.
Below is the code, perhaps it can help someone.
<?php //Get today date $today = strtotime("now"); //Revised query string $querystr = " SELECT wposts.* FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id AND wpostmeta.meta_key = 'startdatum' AND wpostmeta.meta_value > '" . date("Y-m-d", $today) . "' AND wposts.post_status = 'publish' AND wposts.post_type = 'page' ORDER BY wpostmeta.meta_value ASC LIMIT 0, 3 "; $dateIndexes = array(); $pageposts = $wpdb->get_results($querystr); ?> <?php if ($pageposts): ?> <ul> <?php foreach ($pageposts as $post): ?> <?php setup_postdata($post);?> <li><a href="<?php the_permalink() ?>"><b><?php the_title(); ?></b><br /> <?php //Get start date value $startdate_values = get_post_custom_values('startdatum'); $startdate_values_copy = $startdate_values; $start = 0; if (strlen($dateIndexes[$post->ID]) > 0 && $dateIndexes[$post->ID]>=0) { $start = $dateIndexes[$post->ID]+1; } $location_values = get_post_custom_values('ort'); sort($startdate_values); for ($i=$start; $i< count($startdate_values); $i++) { //Convert to date as it is stored as string in database $nextdate = strtotime($startdate_values[$i]); //Check if the date equals or greater than today if ($nextdate>=$today) { //Print out echo strftime('%e %b, %Y', $nextdate); $index = -1; //Find the right index before sortig for ($j=$start; $j< count($startdate_values_copy); $j++) { if ($startdate_values_copy[$j] == $startdate_values[$i]) { $index = $j; break; } } //Put into an array $dateIndexes[$post->ID] = $i; //If found, break the loop break; } } ?></a></li> <?php endforeach; ?> </ul> <?php else : ?> <p>No upcoming events</p> <?php endif; ?>
Since I didn’t go back to NAVT, I’m not sure if there was a solution. But in terms of Simple Sidebar Navigation, can’t you just use two widgets for your menus? You should be able to create as many menus as you want – for the site we used it for, we ran five SSN menus.
Forum: Plugins
In reply to: wp_query which gives only main pagesMight be easier to use wp_list_pages if you’re after a standard menu. You can define depth, exclude/include specific pages etc.
Forum: Fixing WordPress
In reply to: Depth of $post->post_parentThat bit of code from Otto42 works great, helped me limit the retrieved pages in a custom query. Thanks!
Forum: Plugins
In reply to: [Plugin: Co-Authors] Listing all posts by coauthor on author.phpMaybe there is a simpler solution, but this is how we solved it in the end. We did a custom query which looked for posts where the current author was either post_author, or _coauthor. Then we output a list of all those posts. This is the code:
$querystr = " SELECT DISTINCT wposts.* FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id AND (wposts.post_author = $curauth->ID OR (wpostmeta.meta_key = '_coauthor' AND wpostmeta.meta_value = $curauth->ID)) AND wposts.post_status = 'publish' AND wposts.post_type = 'page' ORDER BY wposts.post_title ASC "; $pageposts = $wpdb->get_results($querystr, OBJECT); ?> <?php if ($pageposts): ?> <ul id="utblista"> <?php foreach ($pageposts as $post): ?> <?php setup_postdata($post); ?> <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></li> <?php endforeach; ?> </ul> <?php else : ?> No courses. <?php endif; ?>