The below code automatically generates Flash headings for each of the posts in one of my Wordpress themes. I want to edit the below code so that I can hardcode the headings on one of my static pages, instead of it using all of the ID variables (such as the_ID(); etc). Is anyone able to tell me what I should edit the below code to, in order change from a dynamic Flash header into a hard-coded Flash header? <div class="post" id="post-<?php the_ID(); ?>"> <div class="storytitle"> <div class="title" id="flash-<?php the_ID(); ?>"> <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a> </div> <script type="text/javascript"> // <![CDATA[ var so = new SWFObject("<?php bloginfo('template_directory'); ?>/title.swf", "flash-<?php the_ID(); ?>", "240", "240", "8", "#ffffff"); so.addVariable("titletext", "<?php the_title(); ?>"); so.addVariable("permalink", "<?php the_permalink() ?>"); so.write("flash-<?php the_ID(); ?>"); // ]]> </script> </div> Code (markup):
What exactly are you trying to accomplish by "hard-coding" the flash header? If all you want to change is the heading, I'd recommend using a custom field to define a new heading on the page to override the default title: http://codex.wordpress.org/Custom_Fields You could also create your own page template with a title of your choice and choose that page template when creating the page: http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates Although making a new page template with a unique title each time would be very inefficient for even a few pages.
What I'm trying to achieve, is to use the beautiful template design that already exists, and repeat the heading several times down the page. The hard-coding will apply to only one page template, as you have kindly suggested. I'm still at a loss as to how to do this, so your feedback is greatly appreciated
Take the only the code from <script type="text/javascript"> // <![CDATA[ var so = new SWFObject("<?php bloginfo('template_directory'); ?>/title.swf", "flash-<?php the_ID(); ?>", "240", "240", "8", "#ffffff"); so.addVariable("titletext", "<?php the_title(); ?>"); so.addVariable("permalink", "<?php the_permalink() ?>"); so.write("flash-<?php the_ID(); ?>"); // ]]> </script> Ignore the rest of the code as it's all layout and wp post functions Place in page that you want to show flash.... You may need some CSS to get the layout where you need it. But that will put the flash were you want it.