Paul Wright
Forum Replies Created
-
Forum: Plugins
In reply to: WP_PageNavi and WP_User_QueryLooks like the plugin doesn’t handle it all natively and you have to pass ‘paged’ variables to it.
Here is some working code:
[Code moderated as per the Forum Rules. Please use the pastebin]
Credit: https://wordpress.stackexchange.com/questions/30977/list-users-by-last-name-in-wp-user-query
Forum: Fixing WordPress
In reply to: get_post_meta on homepageHmm, this goes a bit deeper I think.
After changing to page-home.php (which correctly gets called), it still doesn’t retrieve the meta boxes. And now, the meta boxes I call in my header don’t work for the home either. This was working fine on home (and still does for single)
[Code moderated as per the Forum Rules. Please use the pastebin]
I also tried a global $post in there, but it didn’t help
Forum: Fixing WordPress
In reply to: get_post_meta on homepageSo in order to do this correctly, I have to create a physical page for home? I guess that is what I was trying to avoid.
I’ve switched home.php to front-page.php and it doesn’t help, next step would be to create a real page for home and set it as the static home page in settings and select a page template in the page screen. Is that the only way? I was hoping to not have a ‘real’ page for home for some reason.
Forum: Fixing WordPress
In reply to: get_post_meta on homepageOk, I will try front-page.php on that suggestion and switch the home to a static page.
What’s the recommended use case for home.php?
Forum: Fixing WordPress
In reply to: get_post_meta on homepageYep, sorry, fixed the URL
Forum: Fixing WordPress
In reply to: get_post_meta on homepageHello,
Thanks for the reply, but no, I’m using the hierarchy and a home.php template. I inserted your code anyway, but to no avail.
Forum: Plugins
In reply to: Multi-level wp_nav_menu return childrenHello,
Thank you for your time.
I actually didn’t realize that we were now (https://core.trac.www.ads-software.com/ticket/13976) able to use the same menu twice on a page. Because of that fix, yes, a CSS only solution using display:none on the first tier is possible.
Thanks for pointing me in that direction.
Paul
Forum: Plugins
In reply to: Multi-level wp_nav_menu return childrenWell,
While it is less than ideal, I have settled on a solution that uses the wp_nav_menu for the main nav and then wp_list_pages (with a call for children of current pages’ parent) for the subnav on pages that have one.
Paul
Forum: Plugins
In reply to: Multi-level wp_nav_menu return childrenI’m working away at this, but am having trouble translating object ID and element ID. Not 100% what the object ID is.
From what I see, the function above (in reverse):
adds the element to the child item array only if the element’s parent exists in the parent array.
To get items added to the parent array, the queried id must = the element’s object ID.
I believe I need to add more items to the parent array. I can successfully add the current page’s ancestor’s IDs, but the function is looking for object ID’s and so doesn’t find anything.
Forum: Plugins
In reply to: Multi-level wp_nav_menu return childrenI just can’t seem to add another if statement, testing for something like ‘ancestor’ in the $parents array. Anyone know what I should be testing for there?
Forum: Plugins
In reply to: [Plugin: BackWPup] Fatal ErrorCheers, worked like a charm.
Thanks again
Forum: Fixing WordPress
In reply to: On which WP folders should I enable zlib?Has anyone had success with enabling zlib for WordPress using php.ini files for the directories they need it enabled for?
Forum: Hacks
In reply to: filter wp_nav_menu to add current-menu-item for single.phpThank you for the reply.
That looks similar, yes, I’ll have a good look through it soon.
Forum: Plugins
In reply to: Highlight Current Category Single Page With New WP3.0 wp_nav_menuWhat I was needing was a way to highlight the page in the nav that was pulling specific categories. So my request wasn’t really clear. The best way to accomplish what I was looking for is to add a class to the body tag that names the category. Then you can use css to highlight the specific nav item.
<?php $class=”;
if(is_single()) {
$category = get_the_category();
$class .= $category[0]->slug;
}?>
<body <?php if (function_exists(‘body_class’)) body_class($class ); ?>>Then for instance with CSS,
.articles #menu-item-10 {
background-color:#000;
}Hope that helps someone else
Forum: Plugins
In reply to: Display title (and link) to a file in loop / excerptThat link is great, and the comments take it even further – thanks very much. I did a fair amount of digging to no avail.
I haven’t used the code yet, but on first look it does exactly what I want.
Thanks again