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 » Montezuma Theme » New Versions & Updates »

Patch 127-01: add code to allow do_shortcode() to be used in virtual templates


  #1  
Old Apr 18, 2015, 03:47 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
If you find this enhancement useful then donate. Donations encourage the continued update of this theme and without that encouragement, continued development could end.

Enhancement: The following patch will add the WordPress 'do_shortcode()' function to the 'Limited PHP Code' allowing it to be used in the virtual templates.

For example: say you use a plugin that allows responsive rotating images - like Soliloquy - and if supports shortcakes. With this enhancement you could edit the virtual sub template 'header.php' and change it from this:
HTML Code:
<div id="banner-bg" class="cf">
	<div id="banner" class="row">
		<div id="logo-area" class="col5">
			<<?php bfa_if_front_else( 'h1', 'h3' ); ?> id="sitetitle">
				<a href="<?php echo home_url(); ?>"><?php bloginfo( 'name' ); ?></a>
			</<?php bfa_if_front_else( 'h1', 'h3' ); ?>>
			<p id="tagline"><?php bloginfo( 'description' ); ?></p>
		</div>
		<?php wp_nav_menu( array( 
			'container' => 'nav', 
			'container_class' => 'menu-wrapper col7', 
			'container_id' => 'menu1-wrapper', 
			'menu_id' => 'menu1', 
			'menu_class' => 'cf menu', 
			'theme_location' => 'menu1', 
			'fallback_cb' => 'bfa_page_menu' 
		) ); ?>
	</div>
</div>

<a href="<?php bloginfo( 'rss2_url' ); ?>" class="rsslink" title="<?php _e( 'Subscribe to RSS Feed', 'montezuma' ); ?>"></a>
		

<div id="breadcrumbs1-bg">
	<nav id="breadcrumbs1" class="breadcrumbs lw">
		<?php bfa_breadcrumbs( 'breadcrumbs1' ); ?>
	</nav>
</div>
to something like this:
HTML Code:
<div id="banner-bg" class="cf">
	<div id="banner" class="row">
		<div id="logo-area" class="col12">
			<a href="http://www.yourdomain.com/">
               <img class="logo" alt="" src="http://www.yourdomain.com/wp-content/images/yourlogo.jpg">
            </a>
		</div>
  </div>
  
	<div id="header-image-row" class="row">
		<div id="header-image-area" class="col12">
  			<?php echo do_shortcode('[soliloquy id='34']'); ?>
		</div>
  	</div>
  
  <div id="pklmenu" class="row">
		<?php wp_nav_menu( array( 
			'container' => 'nav', 
			'container_class' => 'menu-wrapper col12', 
			'container_id' => 'menu1-wrapper', 
			'menu_id' => 'menu1', 
			'menu_class' => 'cf menu', 
			'theme_location' => 'menu1', 
			'fallback_cb' => 'bfa_page_menu' 
		) ); ?>
	</div>
</div>
This would create a 12 column header image that would use the soliloquy gallery '34' and display it on each page of the site.

you can install this by editing 'montezuma/includesget_whitelist.php' and adding the folowing code after line 488 (which is a blank line)
HTML Code:
		'do_shortcode' => array( 
			'type' => 'single',
			'examples' => array(
				"<?php echo do_shortcode('[gallery]'); ?>" 
					=> __( 'This function allows you to insert shortcodes into the Montezuma virtual temlpates', 'montezuma' ),
				"<?php echo do_shortcode('[soliloquy id='34']'); ?>" 
					=> __( 'This example show how you would use a shortcode provided by the Soliloquy plugin', 'montezuma' ),
			),
			'info' => __( 'This functions does not do the short code by itself. Always use it in combination with <echo>echo</code> as shown in the example.', 'montezuma' ),
		),
or you can replace the existing 'montezuma/includes/get_whitelist.php' with the attached file.

This will be in the next release.
Attached Files
File Type: zip get_whitelist.zip (9.9 KB, 2020 views)
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Last edited by juggledad; Jun 6, 2016 at 02:14 AM.

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the url path for virtual templates losersteelman Languages & Translations 1 Oct 15, 2013 08:26 AM
PATCH 113-07: allow use of bfa_get_template_part() in Virtual templates juggledad New Versions & Updates 0 Mar 20, 2013 10:40 AM
PATCH 113-03: Using 'the_content()' in a virtual template may incorrect results juggledad New Versions & Updates 0 Jan 6, 2013 02:07 PM
[SOLVED] Need help differentiating virtual and physical templates Michael4fm Montezuma Theme 5 Jan 3, 2013 03:30 PM


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


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