A. Ensure the oik_add_shortcodes action has been run.
Scenario
You have in your theme’sheader.php
or footer.php
file code such as
You appear to be a bot. Output may be restricted
echo do_shortcode( "[nivo]" ); echo do_shortcode( "[bw_tides tideurl=http://www.tidetimes.org.uk/chichester-harbour-entrance-tide-times.rss]" );When you display the page the shortcodes are not expanded. You just get
[nivo]
[bw_tides tideurl=http://www.tidetimes.org.uk/chichester-harbour-entrance-tide-times.rss]
- The plugins for the shortcodes ( oik-nivo-slider and uk-tides are activated
- The plugin upon which they depend ( oik ) is also activated
- There are no shortcodes in the page content nor text widgets
Explanation
- To save a little time on each page load, the oik base plugin defers registering shortcodes until it believes it’s necessary.
- It determines this by checking for a
[
in any content that may be expected to contain shortcodes. - When it sees a
[
it invokes the oik_add_shortcodes action. - Plugins such as oik-nivo-slider and uk-tides respond to this action, and define their own shortcodes
- It’s possible that by the time you get to your code, the oik based shortcodes have not been registered, so the codes don’t get expanded.
Solution – PHP code change
Change your code to force the registration of shortcodesYou appear to be a bot. Output may be restricted
do_action( "oik_add_shortcodes" ); echo do_shortcode( "[nivo]" ); echo do_shortcode( "[bw_tides tideurl=http://www.tidetimes.org.uk/chichester-harbour-entrance-tide-times.rss]" );Depending on where you put the code you may need to enclose it in starting and ending PHP tags.
Solution – no PHP code
Introduce a shortcode into your content or a text widget. You may choose to use a shortcode which appears to produce no output, such as [clear][clear]
- bw_business – Display your Business name
- bw_company – Company name
- bw_copyright – Format a Copyright statement
- bw_email – Email primary contact (formal)
- bw_follow_me – Display defined social media follow me links
- bw_logo – Display the company logo
- bw_power – Powered by WordPress
- bw_tel – Telephone number (inline)