Hi,
Thanks for the reply, and the heads up.
Each post has more than one category.
Now, $_SERVER[‘HTTP_REFERER’] will show the permalink of the post. Even if I change the permalink mode to /%category%/%postname% the permalink will show only one category, which might not be the one which is selected in PageOne.
As far as I understand, this method can be used for subcategory navigation, provided one click on links with subcategory permalinks. (Note that I am clicking on permalink of a post, whose permalink reflects the last category, and NOT the selected category).
I would be more than glad if I am wrong.
The other solution – “get and store PageOne current category and then call it and use it on PageTwo” is the most obvious solution. But how could I implement it?
The way I could think of was to set a javascript variable onclick(‘menu item’). Then the problems are:
a) how could I send it to php?
b) how could I send the variable to another page?
I do not know any method of changing php variable on mouseclick. That could also be a solution.
————- Details about PageOne ————–
Here I need to tell in more details about PageOne. I call all items of ParentCategory in a loop.
<?php query_posts('cat=3&showposts='); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<li class="<?php foreach((get_the_category()) as $category ) { echo $category->cat_name . ' all'; } ?>">
<?php the_post_thumbnail('post-thumb'); ?>
<?php endwhile; ?>
<?php endif; ?>
Note that I have passed the subcategories as class of the
-
Now I use a menu :
<ul>
<li><a href="#cows" title="cows">cows</a></li>
<li><a href="#dogs" title="dogs">dogs</a></li>
<li><a href="#goats" title="goats">goats</a></li>
</ul>
Using the attr(‘href’) in javascript, I show or hide the list items of different categories (all, cows, dogs, goats), since I already have the <li class=”cows dogs all”>item1
in my html.
————– Details ends here —————–
Thanks,
banskt