Wordpress template customisation

Discussion in 'WordPress' started by JakeThePeg, Nov 21, 2009.

  1. #1
    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):
     
    JakeThePeg, Nov 21, 2009 IP
  2. fish

    fish Well-Known Member

    Messages:
    450
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    120
    #2
    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.
     
    fish, Nov 22, 2009 IP
  3. JakeThePeg

    JakeThePeg Active Member

    Messages:
    230
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #3
    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 :)
     
    JakeThePeg, Nov 22, 2009 IP
  4. yoru_san

    yoru_san Peon

    Messages:
    44
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    waiting for programmer to help. good template idea.
     
    yoru_san, Nov 22, 2009 IP
  5. JakeThePeg

    JakeThePeg Active Member

    Messages:
    230
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #5
    Sorry mate, I'm not sure I understand what you are getting at?
     
    JakeThePeg, Nov 22, 2009 IP
  6. PopaWoody

    PopaWoody Well-Known Member

    Messages:
    314
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    140
    #6
    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.
     
    PopaWoody, Nov 26, 2009 IP