This plugin looks excellent and I *think* it can do what I want…but I can’t get it to do it!
I have a Learndash site with multiple courses.
I use ‘topic tags’ some of which relate to content across the different courses. (Eg. ‘examples’).
If someone is in ‘course 1’ and clicks ‘examples’ then I want the search result page to pull up only tagged topics from ‘COURSE 1’. Since those are relevant to the course the user is taking. I don’t want it to also bring up a listing of topics that they don’t have access to from other courses!
I figured a way to do this might be to use a unique ‘category’ for all topics in ‘course 1’. I could call it ‘category 1’.
Is there a way then to filter the results once you click on the tag so that it just displays the relevant content?
Hope that’s clear.
Thanks,
Mark
PS I’ve been playing with the ‘child of’ setting but just can’t get it to pull any content up. The entire tag cloud doesn’t display when I put a numnber in.
]]>To each event has assigned multiple subcategories. For example
Cat1: Cities
subcat1: athens
subcat2: london
…
cat2: Topic
subcat1: topic1
subcat2: topic2
….
I would like to display in different table or div the subcategories with parent cat1 and subcategories with parent cat2 …
Is there any php code that I can use? thanks
]]>Might be simple but then… i am using categories for to filter exhibitions on a yearly base, ie one category is 2018, one is 2019 etc. in a multisite install where i have two languages going (de & en using multisite for this).
When i translate a category with Multi Site Language Switcher a new category gets created within the other site/language and this newly created category has a different id than the original category.
I checked the always available category ‘General’ which comes from the core system and, checking the database, found that they both have the category id of ‘1’, for english (‘General’) and for german (‘Allgemein’). So ‘child_of’ in the function ‘wp_list_categories’ will work in both languages when set to ‘1’ and display all sub categories.
But it will not work set to any id in the original language that belongs to a year because the translated category, even if it has the same name, has a different id and the translated page will show zero results because ‘child-of’ points to the wrong id (the id of the oringinal category of the translated category).
How can one get around this? Messing with the db is no option. Has to be dynamic. Maybe it’s just late. Thanks for any input.
]]><div id="options" class="clearfix">
<?php
if ( has_nav_menu( 'primary' ) ){
wp_nav_menu(
array(
'theme_location' => 'primary',
'depth' => 3,
'container' => false,
'container_class' => false,
'menu_id' => 'main-menu',
)
);
} else {
echo '<a href="'. admin_url('nav-menus.php') .'">Set up a navigation menu now</a>';
}
$cats = get_categories('taxonomy=portfolio-category&child_of=XXXXXX');
?>
<ul id="homepage" class="option-set clearfix" data-option-key="filter">
<li><a href="#filter=.home" class="selected"><?php _e('All','fs'); ?></a></li>
<?php
foreach ($cats as $cat){
echo '<li><a href="#filter=.' . $cat->slug . '">' . $cat->name . '</a></li>';
}
?>
</ul>
</div>
I tried to get the correct id (current and filtered) but without success
Could you help me please?
Thanks,
Luca
I have several posts with two categories (1 Parent & 1 child(the child is always different))
What I need to do:
– get the post childs category
and!
– display the rest of the posts in the childs category
I want to display them on the single.php template
I am stuck with this
`<?php
$recentPosts = new WP_Query();
$recentPosts->query( array ( ‘category_name’ => ‘my-category-slug’, ‘posts_per_page’ => -1 ) );
?><div>
<?php while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?>
<?php echo get_the_excerpt(); ?>
</div>
<?php endwhile; ?>`
which of course doesn′t give me the current posts child category.
help is much appreciated
]]><?php
$subcategories = get_categories('&child_of=4&hide_empty'); // List subcategories of category '4' (even the ones with no posts in them)
echo '<ul>';
foreach ($subcategories as $subcategory) {
echo sprintf('<li><a href="%s">%s</a></li>', get_category_link($subcategory->term_id), apply_filters('get_term', $subcategory->name));
}
echo '</ul>';
?>
What is the code that will apply this code to the post the visitor is reading?
Appreciate your help in advance.
Thank you
]]>I’m still getting acquainted with WPs features on this menu scenario has me stumped.
Here is the structure of my Pages
Portfolio
— Print
— —?sample 1
— — sample 2
— — sample 3
— Web
— — sample 1
— — sample 2
— — sample 3
— Illustration
— — sample 1
— — sample 2
— — sample 3
Services
About
Contact
What I’m trying to achieve:
Level one links always visible:
Print Services About Contact
When the active page is Portfolio I would like the children of Portfolio to also display like:
Print Services About Contact
Print Web Illustration
I do not want the grandchildren of Portfolio to display.
I’ve been digging into the Codex and have tried every variation listed on this page and can’t find one that returns the above scenario.
Here is my current code for <nav>
<nav class="main-nav">
<ul>
<?php wp_list_pages('title_li=&depth=1&exclude=6'); ?>
</ul>
</nav>
Here is a link to website
Any suggestions?
]]>The link of childs of id=12:
https://www.ashermedical.com/site/?cat=12
if you click in “CIRURGIA GERAL”, you go to a page with all products/posts of this subcategory:
https://www.ashermedical.com/site/?cat=22
But how Can I do when you click in one of this products/posts, goes to it single post like:
https://www.ashermedical.com/site/?p=283
The code I′m using:
<?php
foreach((get_the_category()) as $childcat) {
if (cat_is_ancestor_of(12, $childcat)) {
echo '<span class="cat-links"><h3 class="entry-title"><a href="'.get_category_link($childcat->cat_ID).'">';
echo $childcat->cat_name .'</a></h3></span>';
echo '<div id="thumb-category"><a href="'.get_category_link($childcat->cat_ID).'">';
echo do_shortcode('[types field="imagem-1" alt='.($childcat->cat_ID).' title="'.get_category_link($childcat->cat_ID).'" size="thumbnail" align="none"]') . '</a><div>';
}}
?>
<?php endif; ?>
Thanks a lot for any help!
]]>I’m trying to make my Cars subnav stay open when on child pages.
ie:
Menu is:
– Home
– Cars (on click opens ‘Ford’ and ‘Dodge’)
–Ford
–Dodge
– Contact
Ford and Dodge Pages display thumbnails of relevant cars linking to individual pages about each car. However when clicking on a thumbnail and bringing up the individual page, the subnav menu of Cars disappears and I’m left with.
– Home
– Cars
– Contact
I want the Cars Nav to stay open on these individual page.. I’ve have a good look around – only found this which is very simular but un-resolved. https://www.ads-software.com/support/topic/show-subnav-of-sister-pages, is it something to do with the ‘depth’ => ‘3’ within the wp_nav_menu?
Many thanks in advance.
]]>Example: Page- Childpage ID=111 -Grandchild1
-Grandchild2
Childpage2 ID=134 -Grandchild3
-Grandchild4
-Grandchild5
I would like to query childpage 1 and 2 but only showing the latest page of the 5 grandchilds.
At the moment im using
<?php query_posts('post_type=page&child_of=111&showposts=1&monthnum=$current_month'); ?>
<?php while (have_posts()) : the_post(); ?>
<div class="green1">
<h1><?php the_title(); ?></h1>
<?php the_excerpt(); ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">weiterlesen...</a>
</div>
<?php endwhile; ?>
which works fine fpr 1 Childpage but i dont know how to make a query for more than one child of.
Would be cool if i could use a query to display the newest page out of 111 and 134
Greetings Baal Orun
]]>