Of Menus, ShortCodes, and URL Search Parameters

[ad_1]

So here’s my problem. No, wait, first, I should mention that as of right now, this site is a freebie on [WordPress.com]), so, though I’m a programmer and web developer who’s no stranger to modifying CSS and HTML and PHP and even designing custom plug-ins from scratch, none of those are an option here. I’m also no stranger to the whole posts vs pages issue. Guess what I’m seeking here is ideas for a better way of doing something like this, either fixing what I’ve got, or going forward with other designs. Hopefully it’ll be a discussion of value to others seeking solutions in the future, not just me.

​

That said, I’m dealing with a site that’s mostly pages. Hundreds of NESTED pages. And what I wanted was an easy way to navigate these things automatically.

​

First, I picked out a THEME that would make part of this easy. Again, it had to be something stable and available free on [WordPress.com]) \- I chose Textbook, primarily because of the automatic “breadcrumb trail” feature. So far, so good.

​

Then there are the widgets. Which of course, without ability to tinker with the code, are site-wide. What I’m using in the widgets are two shortcodes, generating two menus. (1) a menu of SIBLING pages, to let the user easily navigate to other pages in the same category, and a “Drill Deeper” menu that shows all the immediate CHILD pages of the current page. Again, so far so good. The codes, with parameters limiting results, look like this…

​

[sibling-pages depth=’1′ exclude=’0,1,2,399′ title_li=’In This Section…’] [child-pages depth=’1′ exclude=’399′ title_li=’Digging Deeper…’]

​

(399 being a sample of specific pages I’ll always want to exlude from these menus, like a Home or Contact page or other stuff that will normally always be in the header anyway)

​

BUT then, I have a specific type of page where I’d like to display all the pages of that genre… and I used a specific TAG to indicate the pages I want to return.

​

Now, if’ you’ve got a little experience with WordPress, maybe you’re guessing my problem already. PAGES won’t display when you’re viewing a specific TAG. Only POSTS. Sigh.

​

Well, rummaging around the web a bit, I found a quick fix… just use a search url that specifies pages in the search result. Here’s the URL I used (the tag type I’m seeking after is bible\_questions…

​

[https://biblebasics411.wordpress.com/?s=&post\_type=page&tag=bible-questions])

​

So far so good… opps, not quote… the CHILD pages shortcode is coming up blank, which is as it should be, but the SIBLING shortcode is so unpredictable, it seems to be random. I’ve no clue what criteria it’s using for what the “parent” of the search results is. And of course, that’s not just an issue for the above URL (which is linked to a Questions button), but for any searches entered by site visitors as well. Sigh.

​

I’m willing to concede that MAYBE using nested Categories would have been better? Of course, categories only work with posts, not pages. And of course with basic WordPress, there’s no easy way to convert pages to posts without a plugin. But I stand my ground on the basic principle that all these things logically are pages as they’re intended, non-transitory static things that people will want to refer to again and again, not temporary in nature. And drilling down to the deepest levels, the questions are suggested further reading on the “Drill Deeper” menu for any given page. That’s working as intended. Until, of course, we get to the problem of a question that addresses a topic that’s on more than one page, and we want it to appear on both “menus”. Now we’re talking about something that would better be addressed with a judicious and well-planned use of tags?

​

Well, that’s where I’m at,and I’m open to suggestions. It’s why I’m here, after all. I thought maybe another approach instead of shortcodes would be to use one of the query blogs instead. The problem with that is that the output doesn’t look nearly as spiffy as the default search results in the Textbook theme. I suppose it might be possible to get a similar look but not without a lot of experimenting with custom CSS in different browsers. And I’ve not done that with [WordPress.com]) as of yet, not sure how much is allowed, and what would get overwritten when a theme gets an update, since no child themes are allowed.

​

Well, thanks for reading the whole shebang if you got this far 🙂

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer