Hazie nri WordPress gị site na iji onyonyo egosipụtara na nkwupụta nwebisiinka (Ọdịnaya gara aga na post)
Otu ihe na-adọrọ mmasị banyere WordPress bụ na agba oyiyi ewebatabeghị n'ime RSS nri. Nke a bụ ntakịrị ihe nwute, n'ihi na ịhọrọ ma ọ bụ chepụta onyonyo egosipụtara nwere ike ịdọrọ uche dị ukwuu na edemede.
Kwadebe ọdịnaya gaa na posts ndị dị na nri RSS gị
Ịmalite onyonyo egosipụtara na ọdịnaya gị adịghị esi ike. Nke a bụ koodu m gbakwunyere na WordPress m functions.php
na m Okwu Ụmụaka faịlụ:
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');
Na mgbakwunye, a chọkwara m itinye ọdịnaya na njedebe nke akwụkwọ nri m.
Tinye ọdịnaya na akwụkwọ ndị dị na nri RSS gị
Ka m na-enyocha backlinks ka Martech Zone, M na-ahụkarị na e nwere saịtị ndị na-ezu ohi ọdịnaya m ma na-ebipụta ya dị ka nke ha na saịtị ha. Ọ bụ ịchụpụ na-akawanye njọ. Enwere ọtụtụ oge m nwere ike ịchọta ha; oge ndị ọzọ, enwere m ike ịkọ ha na netwọk mgbasa ozi ha na ndị na-eweta nnabata. Ma ọtụtụ mgbe, ha na-na-n'ụzọ dị ukwuu amanyeghị aha na siri ike soro ala… ma ọ bụrụ na ọ bụla.
N'ihi ya, naanị nhọrọ m bụ ịhazi ndepụta m ma tinye nkwupụta nwebiisinka ka ndị ọbịa saịtị na-enweghị ikike nwere ike ịhụ isi mmalite. Iji mee nke a, emelitere m ọrụ dị n'elu iji kwado ma tinye ozi m chọrọ.
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');
Ị nwere ike ịlele nsonaazụ na ndepụta m… a na-egosipụta onyonyo a gosipụtara yana nwebisiinka na njikọ isi mmalite na njedebe nke ọkwa ọ bụla.