Hey Brad, cheers for your fix!
My only suggestion, change the post to read:
[wpcs]
The Short code works wonders.
e.
Hi Brad,
Yes nice fix. Now days i am busy with my work so not able to update this plugin. But i will add your code in next release
This works but if you want to place the shortcode in a specific place on a post/page (and not just at the top) you will need to add output buffering to the wp_content_slider() function:
Before anything is echoed (around line 492) add:
ob_start();
And just before the closing } of the function add:
$output_string = ob_get_contents();
ob_end_clean();
return $output_string;
Nice trick Brad.
I’m suggesting something else:
what if someone wants to post different slides (i.e slides with different image sources) in different places. Would that be hard to implement? (I’m looking at it…)
Example of interesting use:
- I chose to display [wpcs1] in my homepage for advertisement
- I chose to display [wpcs2] in my portfolio to show my last holidays in Cancun
How does that sound?
where does this bit go? in a Post or part of the theme?
exposedesign
Member
Posted 3 months ago #
This works but if you want to place the shortcode in a specific place on a post/page (and not just at the top) you will need to add output buffering to the wp_content_slider() function:
ob_start();
$output_string = ob_get_contents();
ob_end_clean();
return $output_string;
—-just a little lost HELP
Crownoflyfe:
Open the Content_Slide.php file
Search for the function “function wp_content_slider()” around line 254.
Somewhere before the first “echo” command copy/paste: ob_start();
After that scroll all the way to just about the end of the file somewhere around 342 I put:
$output_string = ob_get_contents();
ob_end_clean();
return $output_string;
Bradvin & exposedesign: Excellent work! Those are two nice additions to snilesh’s work.
snilesh, nice job on this plugin. I agree that these two functions should be in a future release.
I must be doing something wrong. I cannot get rjpalombo’s suggestion to work.
I’m pretty new at this, I don’t understand exactly where you mean “just about the end of the file somewhere” and I have no line 342. I feel like such a dork for posting that! hahah
I must be doing something wrong. I cannot get rjpalombo’s suggestion to work.
I’m pretty new at this, I don’t understand exactly where you mean “just about the end of the file somewhere” and I have no line 342. I feel like such a dork for posting that! hahah
*EDIT* Never mind, I spoke too soon, sorry about that!
I got it to work. For other users, follow the directions step by step from the first post down to what rjpalombo posted (if you want the slider to appear wherever you paste the short code)
The last bit of code: $output_string = ob_get_contents();
ob_end_clean();
return $output_string;
Needs to go at the very bottom of the PHP file between the last <? php } ?>