Accordo
Forum Replies Created
-
Forum: Plugins
In reply to: Get a Page Template outstide the loopGreat! Your suggestion helps me very much!
I’ve find this post: https://archive.extralogical.net/2007/06/detect-template/In a comment there is what I’m looking for. If the page template is page-right-col.php show the content and a right sidebar, if not show only the content:
<?php if (get_post_meta($post->ID,'_wp_page_template',true) == 'page-right-col.php') : ?> <?php the_content(); ?> <?php include (TEMPLATEPATH . "/sidebar-right.php"); ?> <?php else : ?> <?php the_content(); ?> <?php endif; ?>
Thank you!
Forum: Plugins
In reply to: Get a Page Template outstide the loopNo one has a solution?
Forum: Hacks
In reply to: Display content/meta only for first postGreat work! Thank you very much Michael.
Forum: Hacks
In reply to: Sidebar menu with Child Page (SubPage) activeAwesome! Finally all is perfect!
Many thanksForum: Hacks
In reply to: Sidebar menu with Child Page (SubPage) activeFor me the better solutions is to have an html like this:
<li><a href="link1">Link1</a></li> <li class="current-page-item"><a href="link2">Link2</a> <ul> <li class="current-submenu-item"><a href="submenulink">Submenulink</a> <li><a href="submenulink">Submenulink</a> <li><a href="submenulink">Submenulink</a> </ul></li> <li><a href="link3">Link3</a></li> <li><a href="link4">Link4</a></li> </ul>
Forum: Hacks
In reply to: Sidebar menu with Child Page (SubPage) activeSorry but I need all links highlighted when I’m inside it.
For example if I’m visiting a SubPage of a Parent page I need the SubPage and the Parent page link both highlighed…
I don’t know how to fix this problem, is possible by functions.php?
Forum: Hacks
In reply to: Sidebar menu with Child Page (SubPage) activeWow! Great work webeingnet! All perfect, you have been very helpful. So I can understand also the usage of the various functions.
Only one more thing (!!): is possible to add a specific class to the main parent page link when is selected (current-page-item) and also to the child page if is selected (child-current-item)?
Many many thanks!
ByeForum: Hacks
In reply to: Sidebar menu with Child Page (SubPage) activeIf can help you this is quite perfect for me:
<?php $output = wp_list_pages('echo=0&depth=1&title_li=<h2>Top Level Pages </h2>' ); if (is_page( )) { $page = $post->ID; if ($post->post_parent) { $page = $post->post_parent; } $children=wp_list_pages( 'echo=0&child_of=' . $page . '&title_li=' ); if ($children) { $output = wp_list_pages ('echo=0&child_of=' . $page . '&title_li=<h2>Child Pages</h2>'); } } echo $output; ?>
I’ve taken it here: https://codex.www.ads-software.com/Function_Reference/wp_list_pages#List_Pages_by_Page_Order (List subpages even if on a subpage)
This display all the pages structure links correctly but the problem is that when you visit the parent or a child of parent he display only the child and not all the pages structure…
Forum: Hacks
In reply to: Sidebar menu with Child Page (SubPage) activePS: You could try get_permalink($id) to quick retreive permalinks of pages.
Reference:https://codex.www.ads-software.com/Function_Reference/get_permalink
Thanks,
I have tryed with this:<a href="<?php get_permalink(); ?> "><?php echo $page-> post_title ?></a>
but he apply the same visited page link to all pages of the list…
Forum: Hacks
In reply to: Sidebar menu with Child Page (SubPage) activeMany thanks webeingnet, I have just tried your code and the pages are printed well.
I noticed some things:
– when visiting a child page, I see only the main parent page and I need to display also the other child pages;– I need a different class for the selected top level page and for the selected child page so I can style it with css.
One more thing, I very appreciate, if is simple for you to explain to me how to add links to the respective pages.
Many thanks!!