I have created a short code called [contianer-narrow][/container-narrow]
which wraps your content in a twitter bootstrap class: .container-narrow
the issue is that the page title is not included. is there a way to say:
if this short code is used, include the page title, else forget it?
As for your concrete question:
You could theoretically parse the retrieved content before shortcodes are resolved for this specific one, set a flag and wrap the title on condition of that.
But it would make much more sense to trash the shortcode-approach and simply create a new page template.
(Especially so, given that the parsing for the shortcode, or at least its consequences, would have to happen in the used template file anyway)
Copy the contents of your theme’s
page.php
to a new file.Call that
page-narrow.php
.Prepend it by
And wrap the copied part in an element with the desired class.
I’d try something like this (not tested) :
Then you can use it like that :