567 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+4 more
iamdok says

Hi guys,

I have a buyer of my latest Flash banner over on Activeden who is trying to place it into the main page on their Wordpress Website, and they are having trouble.

I don’t have any experience of placing Flash objects in Wordpress sites specifically, but I imagine it’s much the same as placing it into a normal html page. (This I have experience of).

So can anyone tell me if there is anything specific to Wordpress websites which I should be aware of? And btw this item uses javascript code to feed mouse X & Y position back to the Flash Banner, to continuously reposition elements, so the embed code would need to bring this javascript with it.

Here is the embed code for a normal html page + reposition js code. Does this need to change for Wordpress?

http://pastie.org/1070512

Thanks,

Donagh

470 posts
  • Sells items exclusively on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Has sold $250,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+6 more
SaurabhSharma says
Hi Donagh,

If this flash is working fine in normal HTML page, it would be good if you embed entire HTML code into a php PAGE Template. i.e. Create a Wordpress page template with all this code inside it. Next, assign this template to the home page inside Wordpress. I guess there already would be a home page template. You just need to insert this code appropriately within php tags.

567 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+4 more
iamdok says

Hi SaurabhSharma,

Yes there is already a home page template, so in this case what you are saying is that the whole javascript swfObject code and the mouse position code is simply wrapped in php tags and inserted into the appropriate div?

Cheers,

Donagh

470 posts
  • Sells items exclusively on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Has sold $250,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+6 more
SaurabhSharma says

Nope. Not everything inside page template. The swfObject JS call and other head scripts should be included inside header.php. The body specific code (where you are checking mouse X and Y positions) should be included inside that particular PAGE template.

If your buyer knows how to do that, he will get an idea. Optionally, he can include some conditional checks inside header.php to hide those script calls from rest of the pages. (This is not required though. Just for efficiency. So that those scripts do not load unnecessarily on other pages).

Something like this:

header.php
----------------

<!-- JAVASCRIPT FILES -->
<script src="<?php bloginfo('template_url'); ?>/javascript/swfobject.js" type="text/javascript"></script>
<script type="text/javascript">
    var vars = { xmlPath:'<?php bloginfo('template_url'); ?>/xml/follow_banner_3d.xml'};
    var params = { scale:'noScale', salign:'lt', menu:'true', wmode:'transparent', allowfullscreen:'true', allowscriptaccess:'always' };
    var attributes = {};
    swfobject.embedSWF("follow_banner_3d.swf", "flashContent", "1000", "500", "10.0.0", "javascript/express_install.swf", vars, params, attributes );
</script>

//If the variables do not work directly, try to use bloginfo('template_url') in a separate var and pass them in swfObject.embedSWF()

Home Page Template
---------------------------------

<?php /*
Template Name: Home
*/
<script language="JavaScript1.2?> 
        - Body specific script for mouse X Y Pos here -

//rest of the HTML or PHP code

?>

This is just an overview for your idea. Final code will be much different.

567 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+4 more
iamdok says

Thanks a million for your help, and you time.

This will hopefully be enough to sort it out.

Regards,

Donagh

896 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+4 more
Gareth_Gillman says

put php command in the page.php / index.php (are they running a static homepage or a list of blog posts?

Just use the wp command if_is_home() { e.g.

 <?php if_is_home() {
  code for flash banner
 } ?>

Put that code where they want to put the slider, make sure they edit the page in the code editor (appearance > editor).

1029 posts
  • Has referred 500+ members
  • Has sold $500,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+6 more
ThemeBlvd says
Just use the wp command if_is_home() { e.g.
 &lt;?php if_is_home() {
  code for flash banner
 } ?&gt;

Didn’t really read this whole thread in detail, but just a note to correct the above…

if( is_home() ) {
    ...code here...
} 

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by