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 » Center area post/pages » Excerpts, Read more, Pagination »

How to enter a php script


  #1  
Old Apr 15, 2009, 08:46 PM
bilalasd
 
4 posts · Apr 2009
Hi, I am trying to make a flash gaming website with wordpress and I have this piece of code

<embed src="<?php echo get_post_meta($post->ID, "swf_url", true); ?>" menu="false" quality="high" width="<?php echo get_post_meta($post->ID, "width", true); ?>" height="<?php echo get_post_meta($post->ID, "height", true); ?>" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />

that I found somewhere on the internet it embeds swf file in the post and the swf url depends on the post id. I had to put this somewhere in the post section of the index.php and I did put it under the "<!-- Post Body Copy -->" heading and it shows the swf file. But the problem is that on the front page it shows the whole game even though I have setted up in the settings to show only excerpt. Can anyone tell me what am I doing wrong.Am I placing the code in the wrong place?
If you wanna see where the code is you can see it at my site http://www.brgamez.com in the source code.
  #2  
Old Apr 16, 2009, 09:51 AM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
Wrap your code into a condtional statement to have it appear on single post pages only

<?php if ( is_single() ) { ?>
<embed src="<?php echo get_post_meta($post->ID, "swf_url", true); ?>" menu="false" quality="high" width="<?php echo get_post_meta($post->ID, "width", true); ?>" height="<?php echo get_post_meta($post->ID, "height", true); ?>" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
<?php } ?>
  #3  
Old Apr 16, 2009, 03:53 PM
bilalasd
 
4 posts · Apr 2009
Thank you very much for your help. It worked

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Image rotation PHP script needs a tweak paulae Sidebars & Widgets 9 Jun 14, 2009 12:41 PM
My <form> in Page can't find it's .php action script kathryn Atahualpa 3 Wordpress theme 2 Jun 7, 2009 10:08 AM
How do I enter shortcode? LemBook Sidebars & Widgets 8 May 17, 2009 06:40 PM
How to use export.php script file to save theme changes? Andante New Versions, & Updating 1 Mar 22, 2009 06:36 PM
Css Script Help I think. joestyer Atahualpa 3 Wordpress theme 2 Mar 10, 2009 02:34 PM


All times are GMT -6. The time now is 06:51 AM.


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