Wordpress and flash?
July 03rd, 2009 | Author: Sunny
ok. First I want to say: This may not work, just my idea how Wordpress and flash work together.
Since WordPress uses Database, you can actually retrieve your Blog from the database. What you need to do is write a script to retrieve those data and display it as XML or whatever data format you like. Then your flash movie should read XML (or other data format) and display it.
This purpose only good for read only.. since we are not modifying the database.. so I guess this should work well. If you want to do more advance stuff, then the best way is first to see how the database tables related to each other, then do an appropriate updates for each modification.
If you have a better idea, please let me know…
Just cant stop when start…
June 19th, 2009 | Author: Sunny
Just can’t stop drawing after I started… it is fun. My wife asked me to draw a cute version of her… haha.. but not sure if this look like her…
WordPress Theme – My header.php
March 24th, 2009 | Author: Sunny
This is code for my header.php:
<?php
/**
* @package WordPress
* @subpackage mySmallProgramTheme
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<title><?php wp_title('«', true, 'right'); ?> <?php bloginfo('name'); ?></title>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="<?php bloginfo('atom_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<link rel="shortcut icon" href="<?php get_bloginfo('url') ?>/wp-content/themes/mysmallprogramtheme/image/favicon.png" type="image/png" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<?php if (is_singular() ) wp_enqueue_script('comment-reply');
?>
</head>
<body>
<div id="page">
<div id="header">
<div id="headerimage">
<a href="<?php echo get_option('home'); ?>" ><h1><?php bloginfo('name'); ?></h1></a>
<div class="description"><?php bloginfo('description'); ?></div>
</div>
First, I have setup some header information with bloginfo() in the Header tag. You may just take a look how I did that because you mostly will put the same header as mine.
After the Header Tag, I defined a Wrapper layer “page”
<div id="page">
This is the wrapper for all contents in my blog. In this wrapper, usually you will define four different parts(or layers).
1. Header
2. Content
3. Footer
4. Sidebar
And for this example, this file is called header.php, so I will define our “Header” layer here. Next 5 lines, I have defined my “Header”:
<div id="header">
<div id="headerimage">
<a href="<?php echo get_option('home'); ?>" ><h1><?php bloginfo('name'); ?></h1></a>
<div class="description"><?php bloginfo('description'); ?></div>
</div>
In the header layer, I have defined another wrapper called “headerimage”. This is because I want to wrap my Blog title and description in my header layer.
Later on, I will show you how I created index.php for my content layer. footer.php for my footer layer, and sidebar.php for my sidebar layer.
One more thing I forgot to mention, in header section, there is a php code:
<?php if (is_singular() ) wp_enqueue_script('comment-reply');
?>
is_singular() will check if this page is a single post (only one post on the page, and actually there is a template file called single.php that you may also define it yourself or by WordPress default template. single.php is liked index.php which I will call my header, sidebar, and footer files here except it only displays one post per page). In my case, I only want to include javascript for replying a comment when someone land on single.php, or else the code should not be included.
So, it looks pretty simple right? However, don’t forget the code above has no decoration, so you will have to define your own CSS style for each layer and wrapper, or otherwise you will only see plain text on your header.
body {
font-size: 62.5%; /* Resets 1em to 10px */
font-family: Arial, Helvetica, sans-serif;
background: #ffffff;
color: #333;
text-align: center;
}
#page {
border: none;
background:url(image/layoutbg.png) repeat-y bottom center;
}
#header {
background: url(image/headerpic.jpg) no-repeat top center;
}
#headerimage {
width: 830px;
height: 195px;
}
#header h1 {
font-size:36px;
text-align: center;
color: #903;
}
#header a, #header a:visited {
text-decoration: none;
color: #903;
}
#header a:hover {
text-decoration:underline;
}
#headerimage .description {
font-size:14px;
text-align: center;
color: #666;
font-family:Georgia, "Times New Roman", Times, serif;
font-style:italic;
}
body {
margin: 0px 0 20px 0;
padding: 0;
}
#page {
margin: 0px auto;
padding: 0;
width: 830px;
}
#header {
margin: 0 0 0 0px;
padding:0;
height:195px;
width: 830px;
}
#headerimage {
margin: 0;
}
#header h1 {
margin: 0;
padding:70px 0px 0px 0;
}
#headerimage .description {
margin: 0;
padding:1px 15px 0 0;
}
Please forgive my mess. I defined them twice because I kinda modified from the default WordPress Theme which it separates the style of structure and coloring in two parts. You may just group them in one depends on what you like.