Terrycy
Forum Replies Created
-
Hi Amir, thanks for the fix, I had just posted a question regarding the same thing, and just as I posted the solution, the post was deleted…
Lesson learnt about reading other threads before posting!
I did mention that I thought the error was a result of turning off the ‘has_archive’ option
Forum: Plugins
In reply to: [Job Manager] [Plugin: Job Manager] Custom field to Application formIn the admin panel,
Go to “Settings” under “Job Manager” on the left nav.
Once in there, go to “App. Form Settings”, 4th tab from the left.
Scroll to the bottom of the page and there is a blank field, fill in the details, if you wish to change where it appears on the form, use the “up” “down” links.
If you want to add another custom field click “add new field” button and repeat the above.
When you are finished, make sure you press “Update Application Form” on the bottom of the page.Hello Chris,
I’m searching for a more advanced way of coding a menu, but in the process of creating/looking, I have come up with a nifty little snipet if you want to give it a go!In your chosen template, open page.php and pop the following in:
<?php if ($post->post_parent) { $ancestors=get_post_ancestors($post->ID); $root=count($ancestors)-1; $parent = $ancestors[0]; } else { $parent = $post->ID; } $page_data = get_page($page_id); ?>
This allows WP to identify where it is in terms of navigation, if you want to see the actual ID’s of the page just pop this in:
<?php print "<pre>"; print_r($ancestors); print "</pre>"; ?> <br/> Parent ID:<?php echo $parent?><br/>Page ID:<?php echo $page_id?>
The code above does nothing but prints out the information you may need.
Where you want to place your menu, try this:
<?php # must set child of to be dynamic wp_nav_menu( array( 'depth' => '1', 'theme_location' => 'primary', 'child_of' => '$PARENT') ); ?>
The tag:
$parent
is the ID of the parent page, this code is basically telling wordpress to only show the menu of it’s parent.
Failing that, I have also done this:<?php if($post->post_parent) $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0"); else $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0"); if ($children) { ?> <?php echo $children; ?> <?php } ?>
Hope this helps!
Tez