- This topic has 6 replies, 2 voices, and was last updated 8 years, 10 months ago by Tom.
-
AuthorPosts
-
June 19, 2015 at 7:14 am #115558Peter Duggan
http://www.khsmusic.info/home/site-map/
Thought I might be able to do this through GeneratePress Secondary Nav and display it on just that page through CSS, but not sure from trying to configure the Secondary Nav whether I can get this format with full ‘menu’ and no drop-downs?
It’s currently hand-coded as nested lists, but obviously I’d prefer it to update automatically when new pages are added so wondering if there’s a (relatively) simple way to do this?
June 19, 2015 at 9:08 am #115574TomLead DeveloperLead DeveloperHi Peter,
Why not use the “Custom Menu” widget, then apply your CSS to it?
You can add the widget to your content with this plugin: https://wordpress.org/plugins/widget-shortcode/
This will allow you to create a menu in “Appearance > Menus”, and then use it on the page with your custom CSS.
Let me know ๐
June 19, 2015 at 9:55 am #115591Peter DugganThanks, Tom
But I’ve just realised I should be able to do exactly what I want with the built-in ‘Pages’ widget when I’ve worked out how to apply that to just a single page. Not sure whether or not that *requires* another plugin (?), but I’ve just seen one called ‘Widget Logic’ that looks like it does the job…
June 19, 2015 at 11:23 am #115602Peter DugganSo close but not quite there yet…
The ‘Pages’ widget produces exactly the linked page list structure I want and I can obviously style the output how I like. But I’ve tried both ‘Widget Logic’ and ‘Widget Context’ plugins to restrict it to my ‘Site Map’ page with the following identical results:
1. I get the desired ‘Pages’ widget on the page I want.
2. I get a dummy widget (e.g. ‘Replace this widget content’ etc.) instead of no widget on every other page.Don’t know whether that’s caused by some conflict with GeneratePress or just me missing something, but still trying to find out!
June 19, 2015 at 11:32 am #115604Peter DugganAnd exactly the same behaviour with the ‘Display Widgets’ plugin…
Edit: have to try the ‘Widget Shortcode’ thing you suggested but I’d already forgotten about (sorry!) because I didn’t need to make the Custom Menu, so will give that a go and report back.
June 19, 2015 at 12:53 pm #115611Peter DugganOK, it’s done!
Installed/activated Widget Shortcode and replaced my whole ‘Site Map’ page with:
<div id="sitemap"> [widget id="pages-4"] </div>
(Where the widget is the standard ‘Pages’ widget sorted by page order.)
Then just kept my existing CSS with two small additions:#sitemap h2.widgettitle { display: none; } #sitemap li { margin: 0; padding: 0; }
To give me exactly what I’d coded before, but now auto-updating on creation of new pages. So problem solved, with apologies for initially missing the relevance of the Widget Shortcode plugin even without the Custom Menu I didn’t need from your answer!
I’ve got one other question about page ids, but will post that separately.
Thanks again
PJune 19, 2015 at 1:20 pm #115618TomLead DeveloperLead DeveloperSorry I didn’t get back to you sooner! Glad you got it working just the way you wanted ๐
-
AuthorPosts
- You must be logged in to reply to this topic.