stflag
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Same article, two different layouts depending on categoryHere are two solutions that were suggested to me:
1. Keep track of the latest category visited in a $_SESSION variable and thus you would know how to style the single article.
By: Jacob Guite St-Pierre (Montreal, QC, Canada) https://twitter.com/JacobGSP2. In categories Templates, customize the permalink by adding a query variable such as &skin=cat_id at the end of the permalink.
Then in single.php, check the presence of the query variable ‘skin’. In the case where it is there, wp_enqueue_style a CSS file that would manage the wanted look and/or include another single_skin_CAT_ID.php with the markup and the appropriate template tags.
By: Alexandre Simard (Montreal, QC, Canada) https://twitter.com/qbert72Solution #2 worked better for us and solved the problem.
Thanks again to the Montreal WordPress Community to have helped me out with this very tricky issue!
Cheers,
StfForum: Themes and Templates
In reply to: Same article, two different layouts depending on categoryThanks FlashBuddy.
We have multiple templates for our categories, our issue is calling the article to display in that template.
The context is that we’re launching a WordPress news website. A news article must be displayed in its news category (Business for example) with a certain layout but then we also want to display the same article in a weekly Case Study which has a different layout.
In other words we want the article layout to be different whether we are in Business or in the Case Study page.
How do you manage the URL of the article in this case?
Thanks.