Jump to content
TourKick (Clifford P)

Do Any Or All Of The Shortcodes Have A Php Counterpart?

Recommended Posts

TourKick (Clifford P)

Looking at http://demo.pagelin.co.in/framework/tools/ , I see quite a few shortcodes that I want to use in my custom section. I'm going to use custom fields and taxonomies per post and use a page template for all of the posts of a specified CPT.

For example:



[pl_raw]

[pl_tabs]


[pl_tabtitlesection type="tabs"]

[pl_tabtitle active="yes" number="1"]Video[/pl_tabtitle]

[pl_tabtitle number="2"]Photos[/pl_tabtitle]

[pl_tabtitle number="3"]Details[/pl_tabtitle]

[pl_tabtitle number="4"]Contact[/pl_tabtitle]

[/pl_tabtitlesection]


[pl_tabcontentsection]

[pl_tabcontent active="yes" number="1"]

Video here

[/pl_tabcontent]

[pl_tabcontent number="2"]

[gallery]

[/pl_tabcontent]

[pl_tabcontent number="3"]

custom field content

[/pl_tabcontent]

[pl_tabcontent number="4"]

[contact-form to="[email protected]"] -- jetpack forms (grunion contact form shortcode)

[/pl_tabcontent]

[/pl_tabcontentsection]


[/pl_tabs]

[/pl_raw]

I verified this works in WYSIWYG on a single post.

How do I setup this "content outline" in a php template (i.e. custom section on a CPT page template)?

Thank you.

Share this post


Link to post
Share on other sites
TourKick (Clifford P)

1) I am curious just for general information if each shortcode has a php counterpart, so please answer that question still.

2) But I think using something like Post Snippets ( http://wordpress.org.../post-snippets/ ) and then just calling those blocks of code within the custom section would be easier than trying to open and close php tags within a template/section. I've used the plugin before with shortcodes inside a Post Snippet, and it's worked well. However, when I have a snippet of the code above ( http://screencast.com/t/S0ew5R8J3 ) and in my custom section I call this snippet ( http://screencast.com/t/CK55jeGN ), then it displays just the code in plain text, not the actual rendering of it ( http://screencast.com/t/SX8xq2xT ). But if I use the Post Snippets shortcode, it looks like it renders, but it really doesn't -- the first tab is shown but the other tabs aren't clickable ( short video showing my clicks: http://screencast.com/t/nS1ceCoYMw8 ).

My guess is that it has to deal with the order of when each "thing" is loaded (I may be way off though).

If you have another snippet plugin that for sure is compatible, please let me know. I assume it's something within PageLines though (like maybe something I can put in functions.php to tell PageLines to load after that plugin? -- am I in dream land? lol).

Thank you.

Share this post


Link to post
Share on other sites
TourKick (Clifford P)

(Edited after posting -- it's getting late)

#2 (above), I DID NOT resolve the issue...

using this (found in the plugin's "Help" area) doesn't work (just plain text):


$my_snippet = get_post_snippet( 'test1' );

echo $my_snippet;
But using this just outputs nothing at all:
echo do_shortcode('[test1]');[/code]

Maybe php coders see the error of my ways with the "get_post_snippet" function, but then I'd say the plugin's Help section should be improved.

Regardless, it's likely not a PageLines / Plugin conflict.

Thank you.

Share this post


Link to post
Share on other sites
Rob

As you lastly point out, PHP coders need to look at your goals and assist.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
TourKick (Clifford P)

Simon or anyone else have a reply? Thank you.

Share this post


Link to post
Share on other sites
Rob

Simon does not work Sundays, nor does he moderate the forum on a regular basis.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
TourKick (Clifford P)

I didn't know Simon wasn't here actively. I see his comments all over. He gets around. :-) Is any dev or "half-dev" actually a moderator that could look at this?

Share this post


Link to post
Share on other sites
Rob

Half-dev? Cute! I like that.

Simon sure does get around, but even he needs a day off once in a rare while. In that, I'm jealous of him.

Some developers do answer here, but since you're really looking for a customization that is complex, it's really not going to help you to obtain assistance in a forum. As I've pointed out elsewhere, if things aren't done right, it's quite easy to crash your entire site. Isn't it worth the investment to hire a pro and make sure you don't end up with a white screen or an error?

They're not too expensive, and worth the effort to get a few quotes.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
TourKick (Clifford P)

this seems to say not to do that

DO NOT mass email the Pros. Don't ask them to bid out on work either.

Share this post


Link to post
Share on other sites
Jenny

Some advice given to me to pass on..

You would need to enque the javascript used by the accordion section (if that's what you want to implement), but it would be easier for you to just copy the entire mark-up for the accordion and use it in your CPT instead of using shortcodes.

Hope that helps!


Jenny :: Web designer at Simple Mama (follow me at @simplemamacom)

Check out Share Me, a social sharing add-on for DMS that is super simple to set up.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×