trixienolix
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: subpage conditional statemement not workingce_bradm: if you’re on nuclear or biomass page (both of which are subpages of what we do – id 131) then you should see the content for that page, underneath that should be 2 relevant blog posts and then 2 relevant resources.
alchymyth: I will have a go and report back
I’m currently trying out a version with query_posts and reset…
Forum: Fixing WordPress
In reply to: subpage conditional statemement not workingOK, here’s the original code that was messing up my sidebar tree and post_parent:
messes up sidebar conditionals
There are multiple loops and conditional statements.
If you could let me know what’s wrong with it i’d be really greateful. My knowledge of multiple loops is obviously lacking.Forum: Fixing WordPress
In reply to: subpage conditional statemement not workingjust seen your comment – will put the page back together and put it up
thanks you so muchForum: Fixing WordPress
In reply to: subpage conditional statemement not workingcan you advise me on which methos of adding multiple loops is best? There are many different examples out there, some using query_posts with a reset and others using wp_query. What are the advantages / differences of each method?
Forum: Fixing WordPress
In reply to: subpage conditional statemement not workingi’ve tried everything! I’ve used query_posts with a reset and now I’m using new WP_Query…
whenever i put a secondary loop onto my page, the sidebar loses the ability to check the tree or parent status…
I’m going to keep trying as it must just be something daft that I’m doing.
aaagggghhh!!Forum: Fixing WordPress
In reply to: subpage conditional statemement not workingok, it’s definitely something to do with teh code on my page.php – if i just have 1 loop it works fine (sidebar shows correct tree and parent info) but when I put my loops back in it goes wrong.
Could you help with my conditional statements and multiple loops??
Forum: Fixing WordPress
In reply to: subpage conditional statemement not workingthanks for your help. Reall appreciated.
I added your print_r code to my page (for anyone else that needs it, the actual code you need to put in the page is this:
<?php print_r($post); ?>
On my subpage i get this:
stdClass Object ( [ID] => 146 [post_author] => 1 [post_date] => 2011-07-26 12:44:02 [post_date_gmt] => 2011-07-26 12:44:02 [post_content] => CONTENT REMOVED FOR THIS FORUM [post_title] => Nuclear Energy [post_excerpt] => [post_status] => publish [comment_status] => open [ping_status] => open [post_password] => [post_name] => nuclear-energy [to_ping] => [pinged] => [post_modified] => 2011-07-26 14:55:32 [post_modified_gmt] => 2011-07-26 14:55:32 [post_content_filtered] => [post_parent] => 131 [guid] => https://XXX/?page_id=146 [menu_order] => 0 [post_type] => page [post_mime_type] => [comment_count] => 0 [ancestors] => Array ( [0] => 131 ) [filter] => raw )
I then added snippet 4 to my functions .php and altered my sidebar code to this (i added some code to test the tree code as well – see below):
<?php echo "<p>is page 'what-we-do' = " . is_page( 'what-we-do' ) . "</p>"; echo "<p>post parent = " . $post->post_parent . "</p>"; echo "<p>is tree = " . is_tree( '131' ) . "</p>"; ?> <?php if ( is_tree( '131' ) ) { if ( ! dynamic_sidebar('What We Do Sidebar') ) : endif; } else { if ( ! dynamic_sidebar('Main Sidebar') ) : endif; } ?>
When I’m on my page 131 I get the correct sidebar and the following info about it:
is page ‘what-we-do’ = 1
post parent = 0
is tree = 1But when I’m on my subpage of 131 (the nuclear energy page listed above I get this:
is page ‘what-we-do’ =
post parent = 0
is tree =even thought it is a subpage of page 131!
SO now I’m wondering if one of my multiple loops on the page is doing something odd to my conditional statements? I struggle with multiple loops so there’s a chance i’ve not done it right. Would that have this effect?
thank you in advance
Forum: Fixing WordPress
In reply to: subpage conditional statemement not workingThank you for looking.
I pasted your code in to my sidebar.php above my (now cleaned up!) code and this is what I get:is page ‘what-we-do’ =
post parent = 0this was on a subpage of “what-we-do”.
On the actual what-we-do page i get this:
is page ‘what-we-do’ = 1
post parent = 0and the correct sidebar shows up.
So it’s not picking up my page parent?
If i look at my rendered source code, my body tag should give me some more clues:
<body class="page page-id-146 page-child parent-pageid-131 page-template-default logged-in admin-bar single-author singular">
which looks like it is seeing the parent??Forum: Fixing WordPress
In reply to: subpage conditional statemement not workingsorry, code not in backticks again:
<?php if ( is_page( 'what-we-do' ) || '131' == $post->post_parent ) { ?> <?php if ( ! dynamic_sidebar('What We Do Sidebar') ) : ?><?php endif; ?> <?php } else { ?> <?php if ( ! dynamic_sidebar('Main Sidebar') ) : ?><?php endif; ?> <?php } ?>
Forum: Fixing WordPress
In reply to: secure login and pdf transferhi it’s more the security issue that I need to ensure is totally water tight. Do you know anything about setting up secure uploads / downloads with wp?
Forum: Themes and Templates
In reply to: Custom sidebar depending on referral pagehmm, i’ve had a quick scan but these just do what I’ve already done i.e. enable me to have different sidebars on different pages depending on the id, parent page or category. I can’t see that any of them enable me to have different sidebars based on the referral page… i’ll double check.
Forum: Themes and Templates
In reply to: Custom Menus on Different Pagesteknohippy – you’re right that if you don’t add a custom field for a menu then it defaults back to the one assigned to that location in the Appearance -> Menus. But this is what i *don’t* want to happen. I want it to default to no menu at all, including no html code.
I found the answer, in case anyone else want sto know… just use the fallback_cb code but with no value:
'fallback_cb' => ''
So my sidebar.php file looks like this now:
<!-- custom fields need to be inside the loop --> <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> <?php wp_nav_menu( array( 'fallback_cb' => '', 'theme_location' => 'sub-navigation', 'menu' => get_post_meta( $post->ID, 'MenuName', true) ) ); ?> content here as well <?php endwhile; ?>
Forum: Themes and Templates
In reply to: Custom Menus on Different Pagesok, just tested it and you don’t need to add the names into functions.php, so it’s a good solution. Thanks!
One question – if i don’t define a custom MenuName in a page or post then I don’t want it to show any menu. Can you tell me how to do this?
Forum: Themes and Templates
In reply to: Custom Menus on Different Pagesteknohippy I like your approach but you still have to set up the name of the different custom menus on the functions.php page don’t you? Which is fine if you’re a techy person, but if you’re handing the wp site over to a non-techy client then it’s not ideal either.
I’ve been trying to work out the ideal front-end user solution to this. I wonder whether widgetising the theme in the place you want the menu to go, then make the menus in the admin, then add these menus to the widgetised area using the menu widget. Then you’d need to get the widget logic plugin to do the conditional statements in a “friendly” non-techy way.
What does anyone think??
Forum: Plugins
In reply to: Newsletter – any recommendations?I’m looking through newsletter plugins now too and have looked at:
meenews, vertical response, Newsletter and g-lock double opt in.
I’m thinking so far that the g-lock one is the best for me.. i don’t want to have to use g-lock but you don’t have to and it lets you configure lots of settings. it also comes as a widget which is what I want and most importantly it allows you to export emails.