KRpano loader is a small wordpress plugin that creates shortcodes to easily add KRPano tours to your Wordpress site and display special content for each panorama in those tours.
- Go to the latest release
- Download the latest release. You should have a file named
krpano_loader-x.x.x
where x.x.x are the release number. - Extract the plugin folder and and move it to
wp-content/plugins/krpano_loader
. Make sure that the folder name is nowkrpano_loader
and that you have removed the release number from the name. - Go to the plugin management section in Wordpress and enable KRpano Loader.
- Clone the project into your
wp-content/plugins
directory
git clone git@github.com:senegalo/krpano_loader.git ./wp-content/plugins/krpano_loader
- Go to the plugin management section in Wordpress and enable KRpano Loader.
Currently the plugin doesn't manage the tours upload so you will have to upload them yourself. The plugin assumes that
all the tours generated by KRpano are uploaded into their own folder under the wp-content/uploads/tours
directory.
So create the wp-content/uploads/tours
folder and upload all your tours into it. Note that each tour folder name will be used in the shortcode to load it so avoid special charachters and spaces.
To embed a tour simply add the following shortcode in the page / post where you want the tour to appear.
[krpano tour='tour_name' width='500' height='300']
tour is the name of the folder under wp-content/uploads/tours/
you want to load
width is an optional parameter to set the width of the player. Default is 500
height is an optional parameter to set the height of the player. Default is 300
Each tour contains multiple scenes. They are defined in the tour.xml file generated by KRpano. Each scene contains a unique name parameter. To create a content that will only be shown when that scene is displayed add the following shorcode to the document containing the embed shortcode for the tour:
[krpano_scene name='unique_scene_name']
// all the content you can think of !
[/krpano_scene]
Say i upload my tour and i have now the following folder structure under the root of my Wordpress installation
wp-content
└─── uploads
└─── tours
└─── my_awesome_tour
| tour.xml
| tour.swf
| tour.js
...
and the following snippet from the wp-content/uploads/tours/my_awesome_tour/tours.xml
file:
<krpano version="1.19" title="Horemheb Tomb in Saqqara">
...
<scene name="scene_001" title="The Beach" >
...
</scene>
<scene name="scene_002" title="The Sun">
...
</scene>
</krpano>
In the page/post you want to display that specific tour use the following shortcode:
[krpano tour='my_awesome_tour' width='500' height='300']
where my_awesome_tour is the name of the folder under tours the tour is stored in.
In the page/post you already embeded the tour in add the following shortcodes where you want the content to appear:
[krpano_scene name='scene_001']
The beach is where most of the fish live. It's blue, it's Big and it's Deep.
[/krpano_scene]
[krpano_scene name='scene_002']
The Sun is nothing but a huge place where matter goes to get fused together. it's really a big complicated place !
[/krpano_scene]
In the above shortcodes the name parameter is the name of scene from the /tours/my_awesome_tour/tour.xml
file.
When the scene_001 is loaded it's specific content is displayed and everything else is hidden same for scene_002.