Posts: 7
Threads: 1
Joined: Dec 2013
Hello!
I would like to use shortcode for a excerpt plugin in the sidebar, but getsimple removes it. Looks like only html is allowed.
How can I override it?
Posts: 52
Threads: 2
Joined: May 2013
If I understand correctly, you already have a plugin that will throw you excerpts with the use of a shortcode, but the excerpt does not appear?
Second question, what exactly do you mean by "shortcode"? A php style shortcode consisting of <? ?> or some {mustage-like} tag?
Posts: 7
Threads: 1
Joined: Dec 2013
2014-01-11, 07:50:00
(This post was last modified: 2014-01-11, 07:50:38 by Klas.)
The shortcode looks lie this:
(% excerpt :portfolio, 340, html %)
It does not show up in the temple.
Is there an easy way to change this?
Posts: 52
Threads: 2
Joined: May 2013
As far as I know shortcodes/tags are only processed as long as they appear in the content field of the page. Eventually in other fields of the page as long as plugin supports it.
Shortcodes/tags won't work when placed in components or raw in template files.
Posts: 3,491
Threads: 106
Joined: Mar 2010
(2014-01-11, 07:50:00)Klas Wrote: (% excerpt :portfolio, 340, html %)
Are you using the
Pages Excerpts plugin?
If so, it can be used with a function in the template or components. I think it would be like:
PHP Code:
<?php echo page_excerpt('portfolio', 340, 'html'); ?>
Posts: 7
Threads: 1
Joined: Dec 2013
(2014-01-11, 19:51:42)Carlos Wrote: (2014-01-11, 07:50:00)Klas Wrote: (% excerpt :portfolio, 340, html %)
Are you using the Pages Excerpts plugin?
If so, it can be used with a function in the template or components. I think it would be like:
PHP Code:
<?php echo page_excerpt('portfolio', 340, 'html'); ?>
Thank you for your response, that will do it for the excerpts, but I have also an other problem, a mp3 plugin, who have the same syntax in its short-code. My bee that is not possible then, to use the short-code.
Posts: 3,491
Threads: 106
Joined: Mar 2010
Posts: 3,491
Threads: 106
Joined: Mar 2010
Nevermind, I suppose it's the Mp3 Plugin Extended.
Try inserting something like this in your sidebar:
PHP Code:
<?php echo exec_filter('content','(% mp3:yourfile.mp3 %)'); ?>
Posts: 7
Threads: 1
Joined: Dec 2013
(2014-01-15, 02:22:37)Carlos Wrote: Nevermind, I suppose it's the Mp3 Plugin Extended.
Try inserting something like this in your sidebar:
PHP Code:
<?php echo exec_filter('content','(% mp3:yourfile.mp3 %)'); ?>
Thanks for your help, great!
The thing is that the file are going to bee change regularly (newest program), so I think it have to bee some hack on the default regulation for the sidebar, so the short-code will function.
Posts: 7
Threads: 1
Joined: Dec 2013
Ok, I got a solution for this.
Added this code to the template and added a site with the slug name latest.
PHP Code:
getPageContent('latest');
Thanks every one for your time and help!
The site so far
Posts: 6,267
Threads: 182
Joined: Sep 2011
If I need to stick small arbitrary php code in my site. I use my component hook plugin.
Posts: 7
Threads: 1
Joined: Dec 2013
2014-01-22, 07:13:21
(This post was last modified: 2014-01-22, 07:13:40 by Klas.)
(2014-01-17, 00:25:09)shawn_a Wrote: If I need to stick small arbitrary php code in my site. I use my component hook plugin.
Thanks, but I almost build my own template anyway, so I stick with my solution.