next/pre navigation problem in single-gallery.php
-
Hi all,
I am quite used to JS and CSS but very new at php.
Doing a website I tried to modify the next/previous navigation in the single-gallery.php. I am stuck, yet.
What I want to achieve is to exclude a specific category from the get_next(previous)_post.
Seems to be simple but i tried everything with that code:<?php
$prevPost = get_previous_post( $in_same_term = false, $excluded_terms = ‘intro-gallery’, $taxonomy = ‘gallery-category’ );
$nextPost = get_next_post( $in_same_term = false, $excluded_terms = ‘intro-gallery’, $taxonomy = ‘gallery-category’ );$root_first_categ = get_post_categories($post->ID, $only_first_cat = true, $taxonomy = ‘gallery-category’, $margin_elem_start = ”, $margin_elem_end = ‘ ‘, $delimiter = ‘, ‘, $a_class = ‘icon-root’, $show_cat_name = false);
?>
but couldn’t get it work.
On my page I have children pages under ?Galerien“ in which I posted a gallery that I named ?Intro Gallery“ (slug ‘intro-gallery’). That are the ones I want to exclude form the navigation. But always then the next and previous navigation item disappear.
Tried also:
$prevPost = get_previous_post($in_same_cat = false, $excluded_categories = ‘287’);
$nextPost = get_next_post($in_same_cat = false, $excluded_categories = ‘287’);
with names, IDs etc. Nothing. What I am doing wrong??Some one who could please help me out?
Thanks a lot
GaravaniLink:
parent Gallery page:
https://www.stefanseifert.com/IM_photo/?page_id=50
clicked on mini galleries below:
https://www.stefanseifert.com/IM_photo/?gallery=sabine-frank
- The topic ‘next/pre navigation problem in single-gallery.php’ is closed to new replies.