RSS Post Importer (redirect to original URL & open title in new tab)

Posted in: Newspaper
Post count: 8

*Please note when responding that I am not a developer*

I am using an RSS Importer and would like to add some functionality to the functions.php. I have the code for the Genesis but how do I amend it for the Newspaper theme?

//* Redirect posts to original URL
add_action( ‘template_redirect’, ‘nabm_original_post_redirect’ );
function nabm_original_post_redirect() {
if ( ! is_singular() ) {
return;
}
if ( $url = genesis_get_custom_field( ‘rss_pi_source_url’ ) ) {
wp_redirect( esc_url_raw( $url ), 301 );
exit;
}
}

//* Open post title links in new tab
function nabm_filter_entry_title() {
function nabm_post_title_output( $title ) {
$title = sprintf( ‘<h1 class=”entry-title” itemprop=”headline”>%s</h1>’, get_permalink(), the_title_attribute( ‘echo=0’ ), get_the_title() );
return $title;
}
add_filter( ‘genesis_post_title_output’, ‘nabm_post_title_output’, 15 );
}
add_action(‘genesis_header’, ‘nabm_filter_entry_title’);

  • This topic was modified 10 years by orenner.
  • This topic was modified 10 years by orenner.
  • This topic was modified 10 years by orenner.
Post count: 1291

Hi,

Unfortunately we didn’t do any tests with RSS Importer and we didn’t checked the genesis framework so i cannot provide a precise solution for this, sorry.

On the first part i’m not sure what the genesis function does, you have to replace it – http://screencast.com/t/erGXr86sL – i guess the url should be compared with one stored in a custom field but on your sample i see an assign (=), maybe it should be (==).

On the second part, the theme doesn’t have the same hooks as genesis. To open post links in a new tab you have to add target=”_blank” to the title link. The function for module title can be found here – http://screencast.com/t/kSaWUtXQJI

Hope this helps. If you don’t know how to find the solution for this i suggest that you hire a professional developer to help you with this task. You can find one on places like – http://studio.envato.com/

Thank you!

  • This reply was modified 10 years by Emil G.
Post count: 8

Resolved by changing to WP RSS Aggregator.

Thanks!

Viewing 3 posts - 1 through 3 (of 3 total)
The forum ‘Newspaper’ is closed to new topics and replies.