I'm using Wordpress 3.5.1 with a modified twentytwelve theme. My main site structure is based on the Smooth Slider plugin (jQuery Cycle).
I have Pages that contain only a shortcode (for example, [smoothslider id='4']
) to display Posts assigned to a slider. When I do a search on the site it returns result for individual posts only (and not for pages, of course). This is not what I want as there is no slider anymore. Those posts are not supposed to be displayed individually.
What I wish to do is instead of having the results with links to the single posts, have result links to the parent page. But posts have no parents so it would need to be taken from the menu_order (?) and set the results to those URLs.
Example
MENU:
- CAR [Page - Redirect to first child: car-1]
- car-1 [Page - Content: shortcode with "sliderid=1"]
- car-1a [Post - attached to sliderid=1 - Content: text+img]
- car-1b [Post - attached to sliderid=1 - Content: text+img]
- car-1c [Post - attached to sliderid=1 - Content: text+img]
- car 2 [Page - Content: shortcode with "sliderid=2"]
- car-2a [Post - attached to sliderid=2 - Content: text+img]
- car-2b [Post - attached to sliderid=2 - Content: text+img]
- car-1 [Page - Content: shortcode with "sliderid=1"]
Search results for "car":
- Results I get:
- example.com/car-1a,
- example.com/car-1b,
- example.com/car-2a
- etc.
- Results I want:
- example.com/CAR/car-1,
- example.com/CAR/car-2,
- etc.
id
s with the posts?