lewismalpas
Forum Replies Created
-
Forum: Plugins
In reply to: Dynamic Menu HighlightingAnyone think they can help me with one?
Thanks!
Forum: Themes and Templates
In reply to: Query two custom posts and two custom taxonomiesHi Everyone,
After further reading I found my error and now everything is working as intended. I had ‘AND’ as the relationship which means the returned posts must be in both custom post types, instead I needed to use ‘OR’ for the relationship.
<?php query_posts( array( 'post_type' => array('client','events'), 'posts_per_page' => -1, 'tax_query' => array( 'relation' => 'OR', array( 'taxonomy' => 'tagevents', 'field' => 'slug', 'terms' => 'favourite' ), array( 'taxonomy' => 'eventtags', 'field' => 'slug', 'terms' => 'favourite' ) ) ) ); if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
Thanks!
Forum: Themes and Templates
In reply to: Query two custom posts and two custom taxonomiesHi CodeBotics,
Thanks for your reply, that all made perfect sense. Here is what I have now:
<?php query_posts( array( 'post_type' => array( 'client', 'events' ), 'tax_query' => array( 'relation' => 'AND', array( 'taxonomy' => 'tagevents', 'terms' => 'favourite' ), array( 'taxonomy' => 'eventtags', 'terms' => 'favourite' ) ) ) ); ?>
I presume I am missing something as no posts are currently being displayed?
Thanks!
Hi Zoe,
I am using custom post types but that shouldn’t affect the menu displaying on category pages, especially when you are viewing a category outside of a custom post type…
I think I may of found the function which is causing the menu to disappear, this must be the cause:
https://pastebin.com/x1kNYQTLNot exactly sure what the function is doing but I have removed it and everything seems to be working correctly now.
Thanks,
Lewis.Hi Zoe,
Here is the Pastebin for the header:
https://pastebin.com/az7u047ZThe theme is definitely based on TwentyTen so I presume this has something to do with the problem I am trying to overcome seeing as others have had the same problem (https://www.ads-software.com/support/topic/wp-nav-menu-dissapears-in-category-pages-1?replies=21)?
Thanks again for your help,
Lewis.
Hi Zoe,
Thanks for replying, the website can be found here:
https://www.lewismalpas.co.uk/pickledeggThanks,
Lewis.Forum: Themes and Templates
In reply to: Simple if statement with conditional tagsThat worked a charm, I understand the if statement, I will have to read up on the explode to see how that works!!!
Thanks so much buddy, tried to get that working for hours!
Forum: Themes and Templates
In reply to: Simple if statement with conditional tagsThanks Charity!
It’s almost there, however the links are being displayed at the bottom of the pages (i.e back to the blog is being displayed at the bottom of the blog page & the category link is at the bottom of the category page).
I want the links to only be displayed when a single post is being displayed – For example if the user has gone into “Uncategorised” then selected a single post the link at the bottom would say “Back to Uncategorised”.
Think that’s possible?
Thanks!
Forum: Themes and Templates
In reply to: Using wp_nav_menu for multiple menus with dynamic highlightingAnyone else know why this may be happening?
Thanks in advance!
Forum: Themes and Templates
In reply to: Using wp_nav_menu for multiple menus with dynamic highlightingIm developing it locally – It’s also a client project so I can’t release it to the public without consent. Sorry to be difficult I know you are trying to help…
I presume its something to do with the wp_nav_menu and the classes it generates? I’ve done some research and I know it creates menu classes (hence why I duplicated my code for the footer).
Forum: Themes and Templates
In reply to: Using wp_nav_menu for multiple menus with dynamic highlightingThanks for that, I realised that after a posted. Initially I had different ID’s but removed them to see if exact same code would work, forgetting to change them to classes.
Despite changing the ID’s to classes the problem still remains, I can’t figure it out because current_page_item works perfectly for the menu in the header and not in the footer (Yet the code is identical).
For some odd reason two links in the footer are fine and are showing the image above the link when the page is selected, however the remaining four seem to ignore the class.
Sorry must of missed that, sorry to waste your time!
Thanks for you help Michael