Please follow me:
- Download and active plugin Related Posts by Taxonomy
- Insert the code below into the file functions.php :
// Code count the number of lines in text
function
count_paragraph(
$insertion
,
$paragraph_id
,
$content
) {
$closing_p
=
'</p>'
;
$paragraphs
=
explode
(
$closing_p
,
$content
);
foreach
(
$paragraphs
as
$index
=>
$paragraph
) {
if
( trim(
$paragraph
) ) {
$paragraphs
[
$index
] .=
$closing_p
;
}
if
(
$paragraph_id
==
$index
+ 1 ) {
$paragraphs
[
$index
] .=
$insertion
;
}
}
return
implode(
''
,
$paragraphs
);
}
//Insert a list of related articles between the content
add_filter(
'the_content'
,
'prefix_insert_post_ads'
);
function
prefix_insert_post_ads(
$content
) {
$related_posts
= do_shortcode(
'[related_posts_by_tax title=""]'
);
if
( is_single() ) {
return
count_paragraph(
$related_posts
, 1,
$content
);
}
return
$content
;
}
The results are as follows:
Life is fun when you always let go and then get back feeling happy
ReplyDeletehotmail.com entrar
I am so grateful to find your particular post. I have bookmarked this website and I will keep visiting you for further such interesting posts.
ReplyDeletecriar uma conta hotmail
amasya
ReplyDeleteantalya
antep
ardahan
artvin
Q0J5Z
görüntülü show
ReplyDeleteücretlishow
KNW