Tagged: shortcodes
- This topic has 13 replies, 2 voices, and was last updated 3 years, 6 months ago by
Steve.
-
AuthorPosts
-
-
July 25, 2018 at 8:01 am #9148
redsoxfan99ParticipantSo I have inherited a WordPress site built on PikList which I have never worked on before. We I try to place a salesforce shortcode for a form in the content editor it is not working. Again, I am brand new to Piklist, any help would be greatly appreciated. I am running WP 4.9.7 and Pkilist version 0.11.4. on Linux server.
Attachments:
You must be logged in to view attached files. -
July 25, 2018 at 12:38 pm #9158
SteveKeymaster@redsoxfan99– Welcome to the Piklist community! We’re here to help.
I’m not clear on the second screenshot. Is it partially rendering the shortcode?
If you place the shortcode in the TEXT tab, instead of VISUAL, does it work better?
-
July 25, 2018 at 1:38 pm #9161
redsoxfan99ParticipantSteve thanks for the welcome and quick response. I have placed the shortcode both ways in visual and text and saved the page and still the same. I placed some plain text in there to show you that content is being pulled over just the shortcode is not being processed correctly.
Attachments:
You must be logged in to view attached files. -
July 25, 2018 at 2:16 pm #9165
SteveKeymasterCan you post the code thats creating the salesforce shortcode? A good place to post is: https://gist.github.com/
-
July 25, 2018 at 2:19 pm #9166
redsoxfan99ParticipantI am a bit confused. This shortcode is from this plugin: https://brilliantplugins.com/downloads/salesforce/
I am not creating a shortcode. I am using the one provided by the plugin.
Let me know if you need anything else.
Thanks again for the help.
-
August 6, 2018 at 12:48 pm #9183
redsoxfan99ParticipantOK after weeks of no support I am not sure what to do. I have inherited this site that uses piklist. The page uses a piklist editor but when I place a short code from a salesforce form plugin, the editor just dumps out the shortcode. So I tried another short code and the same. The Piklist Editor is not processing the shortcode and sees it as normal text. I have saved the shortcode multiple times in the Piklist editor and nothing. The shortcode DOES WORK in the Normal WordPRess Editor but not the PIKLIST Editor. Can someone please help.
This is NOT a shortcode I created within Piklist. This is a shortcode from another plugin. We have an option on a page where it uses a PIKLIST Editor to enter extra content.
Attachments:
You must be logged in to view attached files. -
August 6, 2018 at 2:36 pm #9185
SteveKeymasterHow are you outputting the shortcode in the front of your site?
-
August 6, 2018 at 2:52 pm #9186
SteveKeymasterIf you want WordPress to render your shortcode on the front of your site, you need to use this WordPress filter:
https://developer.wordpress.org/reference/hooks/the_content/Something like this should work:
$speaker_request = get_post_meta($post->ID, 'your-custom-field-name'); echo apply_filters('the_content', $speaker_request);The standard WordPress editor automatically calls this filter, but you need to do it manually,
This will not fix the shortcode not rendering properly in the admin, but it will work on the frontend.
-
August 6, 2018 at 2:59 pm #9187
redsoxfan99ParticipantSteve,
thanks for the information. Again being new to Piklist, I see a WYSIWYG Editor in WordPress I assume that placing a shortcode there would get processed correctly. Thanks for letting me know that when you have an Pikslit Editor you have to do the extra step to process the shortocde. I guess when I was looking at the files, the original author has this code for the Editor and so I assumed that shortcodes would be working as when you look at the array options I see shortcode_buttons = true and wpautop = true.
function tab_fields($index = 0) { return array( array( 'type' => 'text', 'field' => 'tab_title', 'label' => 'Tab Title', 'columns' => 12 ), array( 'type' => 'editor', 'field' => 'editor_content', 'label' => 'Post Content', 'template' => 'field', 'options' => array( 'wpautop' => true, 'media_buttons' => true, 'shortcode_buttons' => true, 'teeny' => false, 'dfw' => false, 'quicktags' => true, 'drag_drop_upload' => true, 'tinymce' => array( 'resize' => false, 'wp_autoresize_on' => true ) ),I will give it a try.
Thanks,
Darren
-
August 6, 2018 at 3:19 pm #9188
SteveKeymasterThis is the way WordPress works. It has nothing to do with Piklist. If you want WordPress to process your shortcodes then you need to output with the filter. It’s the WordPress way
-
August 6, 2018 at 3:58 pm #9189
redsoxfan99ParticipantSo when I create a custom template, I can just call WordPress function ‘the_content()’ and if a shortocde is in the the MAIN WP Editor it gets displayed without have to use the filter. screenshots attached. So I do not understand your reasoning. On this page, I can place the Salesforce Form Shortocde in the Pages Main WordPRess Editor and it works. But this page has meta boxes below the Main Editor and has been coded to display a Piklist Editor. When I place the same shortcode in the Piklist Editor is not processing the shortcode correctly.
So I think we might be getting confused. Looks like the original developer created a custom template with custom Piklist fields to create an editor.
Attachments:
You must be logged in to view attached files. -
August 6, 2018 at 4:01 pm #9193
SteveKeymasterWordPress adds this filter for you when you use
the_content():
https://core.trac.wordpress.org/browser/tags/4.9/src/wp-includes/post-template.php#L240 -
August 7, 2018 at 7:22 am #9194
redsoxfan99ParticipantCorrect. I understand this. So the Piklist Editor does not do this?
-
August 7, 2018 at 11:58 am #9195
SteveKeymasterthe_content()is a WordPress function that OUTPUTS data. Piklist doesn’t have custom functions to output data. We let you use normal WordPress functions likeget_post_meta().
-
-
AuthorPosts
- You must be logged in to reply to this topic.