Amboary ny fahanao WordPress miaraka amin'ny Sary nasongadina sy ny fanambarana momba ny zon'ny mpamorona (Vatioty mialoha sy aorian'ny famoahana)
Zavatra iray mahaliana momba WordPress dia ny hoe sary asongadina tsy mbola nampidirina tao amin'ny RSS sakafo. Somary mampalahelo izany, satria ny fisafidianana na ny famolavolana ny sary asongadina dia mety hisarika ny saina ho amin'ny lahatsoratra iray.
Manomàna votoaty amin'ireo lahatsoratra ao amin'ny RSS Feed-nao
Tsy sarotra loatra ny manomana ny sary asongadina amin'ny atiny. Ity ny kaody nampiako tao amin'ny WordPress-ko functions.php
in my Child Theme file:
function prerssfeedcontent($content) {
global $post;
$current_year = date('Y');
$post_title = get_the_title( $post->ID );
$post_link = get_permalink( $post->ID );
$post_image = get_the_post_thumbnail( $post->ID, 'medium' );
// Add the featured image
if ( has_post_thumbnail( $post->ID ) ) {
$precontent = '<p class="thumb">';
$precontent .= '<a href="' .$post_link. '" title="' .$post_title. '">';
$precontent .= $post_image;
$precontent .= '</a></p>';
}
$content = $precontent . $content;
return $content;
}
add_filter('the_excerpt_rss', 'prerssfeedcontent');
add_filter('the_content_feed', 'prerssfeedcontent');
Fanampin'izay, te-hanampy votoaty amin'ny faran'ny lahatsoratra famahanako ihany koa aho.
Ampio ny atiny amin'ireo lahatsoratra ao amin'ny RSS Feed-nao
Rehefa mijery backlinks aho Martech Zone, Matetika aho no mahita fa misy tranonkala mangalatra ny votoatiny ary mamoaka izany ho azy manokana ao amin'ny tranokalany. Fanenjehana tsy misy fiafarany sady mampahory. Betsaka ny fotoana ahafahako manara-maso azy ireo; amin'ny fotoana hafa, afaka mitatitra azy ireo amin'ny tambajotran-dokany sy ny mpamatsy fampiantranoana azy aho. Saingy matetika, tsy mitonona anarana izy ireo ary sarotra harahina… raha tsy izany.
Vokatr'izany, ny hany safidiko dia ny mampifanaraka ny fahanako ary mampiditra fanambarana momba ny zon'ny mpamorona mba hahafahan'ireo mpitsidika tranonkala tsy nahazo alalana hahita ny loharano. Mba hanaovana izany dia nohavaoziko ny fiasa etsy ambony mba hanomanana sy hampidirana ny fampahalalana tiako.
function prepostrssfeedcontent($content) {
global $post;
$current_year = date('Y');
$post_title = get_the_title( $post->ID );
$post_link = get_permalink( $post->ID );
$post_image = get_the_post_thumbnail( $post->ID, 'medium' );
$company_title = "DK New Media, LLC";
$company_link = "https://martech.zone/partner/dknewmedia/";
// Add the featured image
if ( has_post_thumbnail( $post->ID ) ) {
$precontent = '<p class="thumb">';
$precontent .= '<a href="' .$post_link. '" title="' .$post_title. '">';
$precontent .= $post_image;
$precontent .= '</a></p>';
}
// Add the copyright
$postcontent = '<p>©';
$postcontent .= $current_year;
$postcontent .= ' <a href="'.$company_link.'">'.$company_title.'</a>, All rights reserved.</p>';
$postcontent .= '<p>Originally Published on Martech Zone: <a href="'.$post_link.'">'.$post_title.'</a></p>';
$content = $precontent . $content . $postcontent;
return $content;
}
add_filter('the_excerpt_rss', 'prepostrssfeedcontent');
add_filter('the_content_feed', 'prepostrssfeedcontent');
Azonao jerena ao amin'ny fahanako ny valiny… ny sary nasongadina dia aseho ary koa ny zon'ny mpamorona sy rohy loharano tany am-boalohany amin'ny faran'ny lahatsoratra tsirairay.