Template PHP Tag

This topic contains 4 reply and 2 voices, and was last updated by fueledbydreams 10 years, 10 months ago
Viewing 4 Posts - 1 through 4 (of 4 total)
Author Posts
July 1, 2013 at 4:14 am 5438
fueledbydreams I would like to make a custom page template for the Project Mangers page other then the do_shortcode function I would prefer to use a PHP call. I tend to stay away from shortcode after reading (http://kovshenin.com/2013/dont-do_shortcode/) Is there a PHP call I can use in my template.
July 1, 2013 at 11:53 am 5447
Tareq Hasan Tareq Hasan

Currently there isn’t any special templating function like that, you could use a static call and see if that works. Cause I haven’t tried yet.

[php]
if ( class_exists( ‘CPM_Frontend’ ) ) {
CPM_Frontend::shortcode( array(‘id’ => ’37’) ); // pass the project ID
}
[/php]

July 1, 2013 at 1:43 pm 5450
fueledbydreams fueledbydreams

What if I dont want it to show a specific project, created a login page that requires the user to login then I wanted it to show only projects they are assigned to. So basically I am looking for the PHP call to replace [cpm]

July 1, 2013 at 3:52 pm 5460
Tareq Hasan Tareq Hasan

In that case, don’t pass the ID: CPM_Frontend::shortcode();

July 1, 2013 at 6:30 pm 5477
fueledbydreams fueledbydreams

That didn’t work, the php failed at that line.

Its not too big of a deal but it would be nice in a revision that a template tag could be added 🙂

Viewing 4 Posts - 1 through 4 (of 4 total)