List Sibling Pages By Tag
Date : March 29 2020, 07:55 AM
it should still fix some issue I believe I may have come up with an answer. This code may be a little rough, but as far as I can tell it works as needed: <?php
if($post->post_parent):
$postparent = $post->post_parent;
else:
$postparent = $post->ID;
endif;
$nextTagThumb='-1';
$tags = wp_get_post_tags($postparent);
foreach ($tags as $tag) :
if ($tags) {
$what_tag = $tags[($nextTagThumb+'1')]->term_id;
$tag_title = $tags[($nextTagThumb+'1')]->name;
echo '<div class="Saving_sare">'. "\n";
echo '<h4>'.$tag_title.'</h4>'. "\n";
echo '<ul>'. "\n";
$args=array(
'tag__in' => array($what_tag),
'post__not_in' => array($postparent),
'showposts'=>100,
'caller_get_posts'=>1
);
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
<?php endwhile;
}
echo '</ul>'. "\n";
echo '</div>'. "\n";
wp_reset_query();
$nextTagThumb = ($nextTagThumb+1);
}
endforeach;
?>
|
List children pages, unless none exist, in which case, list sibling pages, in WordPress
Date : March 29 2020, 07:55 AM
will help you I have a navigation structure like this: , this should either do it outright or at least show you how: <?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;
?>
|
Kentico V9 CSS List Menu webpart for 2nd and 3rd level pages
Date : March 29 2020, 07:55 AM
With these it helps Use /% for a path. ../% is a relative path. See more details in documentation.
|
List Kentico 7 published pages
Date : March 29 2020, 07:55 AM
hope this fix your issue I inherited a CMS with some pages that are hidden or archived with published pages beneath those and I'm trying to get a scope for pages that are available to be viewed that are linked via other pages in the site. I'm trying to distinguish between pages that have a "path" to them and those that are published but only directly accessible via URI. , This query should get you what you're looking for. SELECT *
FROM View_CMS_Tree_Joined
WHERE (NodeLinkedNodeID IS NULL OR NodeLinkedNodeID <= 0)
AND Published = 1
|
List of pages in Kentico
Tag : chash , By : picamiolo
Date : March 29 2020, 07:55 AM
I wish this helpful for you No hack about what you posted. In the documentation here and ObjectQuery documentation here it also shows another way to get your information: // Creates an instance of the Tree provider
TreeProvider tree = new TreeProvider(MembershipContext.AuthenticatedUser);
// Gets the published version of pages stored under the "/Articles/" path
// The pages are retrieved from the Dancing Goat site and in the "en-us" culture
var pages = tree.SelectNodes()
.ClassNames("custom.CustomPressRelease")
.Path("/Articles/", PathTypeEnum.Children)
.WhereLike("DocumentName", "Coffee%")
.Columns("NodeAliasPath", "DateIssued", "ContentTitle", "TeaserText", "GeoCoverage")
.OnSite("DancingGoat")
.Culture("en-us");
|