Tuesday 3 January 2012

Step By Step Guide To Creating A New Finance Aggregator Site

FeedWordPress Plugin Customization
1) Download and installed FeedWordPress Version 2009.0707

2) Require to upgrade of MagpieRSS after activating plugin (normal).

3) Syndicated a test feed (http://thefinance.sg) and found a whole long list of unwanted code appended to each post. After testing on other feeds, realized that the rest are ok and the problem is only on my feed.
4) Increased the excerpt length of the feed by editing ../wp-content/plugins/feedwordpress/syndicatedpost.class.php (L74 and L75)
Change the code to:
if (strlen($excerpt) > 503) :
$excerpt = substr($excerpt,0,500).'...';

5) How do I make the permalinks for post titles open in a new browser window? or [Private]

Note that since I will be making changes to index.php, archive.php and search.php in the theme folder, I will have to make sure I modify the files after each theme upgrade.

For thesis theme, I have to modify custom_functions.php. Not going to do this because the general consensus is that opening in a new window is bad.
Beware of Opening Links in a New Window [Usability and Information Architecture]

6) How to make feedwordpress retrieve only a short excerpt and not the entire post? Feedwordpress : truncate the article

Finally found the solution. Look for the file syndicatedpost.class.php and insert the code below above line 66.
 $content = substr($content,0,500).'...';
It is basically similar to to the excerpt code, it will retrieve from 0 - 500 words and post it into the content. Hence my code look something like this now.
$content = $this->item['description'];
endif;
$content = substr($content,0,500).'...';
$this->post['post_content'] = apply_filters('syndicated_item_content', $content, $this);
http://wordpress.org/extend/plugins/feedwordpress/

7) Point Permalinks to the local copy on this website.
Go to Syndication -> Posts -> Under 'Links' -> point to local copy on this website

8) Add a 'Read full article' at the end of the single syndicated post
Put this signature code to Thesis Theme, custom_functions.php
// Signature -> http://diythemes.com/forums/showthread.php?p=74152#post74152
function my_signature() {
if (is_single() && is_syndicated()) { ?>
<p><a href="<?php the_syndication_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><br/>Read the full article &rarr;</a></p>
<?    }
}
add_action ('thesis_hook_after_post' , 'my_signature');

9) Next post permalink is 'screwed'

Auto-resolved. I guess is because of point 7 - Point Permalinks to the local copy on this website.

Thesis Theme Customization

1) Rename ../wp-content/themes/thesis_151/custom-sample folder to ../wp-content/themes/thesis_151/custom
Feel really dumb - spent several hours figuring out why I couldn't customize the theme.

2) Edit ../wp-content/themes/thesis_151/custom/custom_functions.php. Note that there is no '?>' at the end - spent sometime combining the code together. Read the code below on the customization done so far.
<?php
// Adjust teaser lenght - http://diythemes.com/answers/customize-teasers/
add_filter('excerpt_length', 'my_excerpt_length');
function my_excerpt_length($length) {
return 100; }

// Remove comments -> http://diythemes.com/answers/change-0-comments-display/#rem_brac
remove_action('thesis_hook_after_post', 'thesis_comments_link');

// http://diythemes.com/forums/customization/5715-read-more-link-not-showing-post-excerpts.html?highlight=read
function home_read_more() {
if (is_home() || is_archive()) { ?>
<p><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>">Read the full article &rarr;</a></p>
<?php }
}
add_action('thesis_hook_after_post', 'home_read_more');

// Adsense Ads -> http://diythemes.com/forums/customization/10748-adsense-ads-under-nav-menu.html
function my_adsense_code () {
?>
<br/>
Adsense Code
<?php
}
add_action('thesis_hook_before_content', 'my_adsense_code');
- Still waiting for someone to guide me in implementing rotating javascript ads in the multimedia box.
- Figure out the best usage of the multimedia box


- Figure out how to categorize the feeds into three main headers - personal finance, investing and trading or should I rename my headers.

- Argh.... WP2.8.5 is out and thesis is now 1.6. Need to upgrade it and test how feedwordpress will be affected.

- When upgrading Wordpress, always do a manual upgrade so that we knowwhat files we are changing. http://codex.wordpress.org/Upgrading_WordPress

1 comment:

  1. Thank you for describing everything so beautifully Brisbane accounts will follow your advice...........

    ReplyDelete