Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Sidebars & Widgets »

Where does the shortcode for a custom widget go?


  #1  
Old Nov 16, 2011, 02:49 PM
jms5017's Avatar
jms5017
 
115 posts · Jul 2010
NY/NJ Metro area
From this thread
http://forum.bytesforall.com/showthr...dget+shortcode

It says: "Once you have created the new widget area, copy paste the shortcode [FrontpageSlideshow] into the widget."

I have a custom widget in my header area fine. Now I am trying to add the shortcode. Where the heck does the short code go? The plugin is wp-imageflow2 and the gallery has been uploaded to
wp-content/galleryimageflow2???
  #2  
Old Nov 16, 2011, 02:58 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
do you have a custom widget or a custom widget AREA? if you have a new widget area, then you need to add some widget not it. You might need a text widget in this situation
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Nov 16, 2011, 04:18 PM
jms5017's Avatar
jms5017
 
115 posts · Jul 2010
NY/NJ Metro area
I think I have a custom widget area called my_header_widget to which I added a text widget,
then tried adding the shortcode to the text widget.
The result of doing that was the shortcode appeared on the page exactly as I entered it instead of the gallery. I've been looking on the internet and I found this suggestion from stephanie leary who writes books about wordpress.


"Shortcodes are bracketed placeholders you can use while editing your content
that will be replaced with some other, more complicated content (like an embedded video or image
gallery) when your post is displayed to visitors. Unfortunately, shortcodes are processed only in
post/page content. You can use them in text widgets, however, if you enable theme in the theme
functions as shown in Listing 6-39.

Listing 6-39. Enabling shortcode parsing in text widgets
add_filter('widget_text', 'shortcode_unautop');
add_filter('widget_text', 'do_shortcode');
The first line ensures that a shortcode placed by itself on its own line won’t be surrounded by
paragraph tags. The second line actually parses the shortcode.

I added the two lines of code to the themes functions.php file
but that didn't work either.

the images for the plugin which is wp-imageflow2 are in wp-content/galleryimageflow2
and the shortcode I tried was [wp-imageflow2 dir=wp-content/galleryimageflow2]
Help is greatly appreciated.
  #4  
Old Nov 16, 2011, 04:20 PM
jms5017's Avatar
jms5017
 
115 posts · Jul 2010
NY/NJ Metro area
site is jkstest.info
  #5  
Old Nov 16, 2011, 05:54 PM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
A shortcode cannot be natively used in the standard text widget. To use a shortcode in a widget you either need to install a plugin that "enables" that option such as Shortcodes in Sidebar Widgets or using code like
PHP Code:
<?php echo do_shortcode('[your shortcode]'); ?>
in a php aware widget such as Linkable Title Html and Php widget.
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
  #6  
Old Nov 16, 2011, 06:39 PM
jms5017's Avatar
jms5017
 
115 posts · Jul 2010
NY/NJ Metro area
I've installed the "shortcodes in sidebar widget" as you suggested.The gallery still doesn't show up.

How do i know if I have a "php aware" widget to attempt to try to figure out where I would insert the
<?php echo do_shortcode('[your shortcode]'); ?>
code that you suggest?

The widget area is My_header_widget.
  #7  
Old Nov 16, 2011, 07:06 PM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
The Linkable title widget I mentioned is a php aware widget.
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.

Bookmarks

Tags
custom widget, shortcode

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Having shortcode issues, where in Ata should I look mad_science eCommerce & Atahualpa 3 Feb 10, 2011 11:40 PM
BUGFIX 361-04: Allow Custom Menu widget links to use same styling as Pages widget. juggledad Old Version fixes and change logs 1 Jan 22, 2011 08:40 AM
[SOLVED] How to add shortcode to a sidebar widget JakeThePeg Sidebars & Widgets 3 Sep 14, 2009 11:42 PM
Adding shortcode in custom template paulae Plugins & Atahualpa 1 May 21, 2009 04:20 PM
How do I enter shortcode? LemBook Sidebars & Widgets 8 May 17, 2009 06:40 PM


All times are GMT -6. The time now is 09:26 AM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.