Cách thêm nội dung trước bài post
Chỉnh sửa đoạn code sau và thêm vào functions.php của theme đang dùng
function mh_before($content) { $beforecontent = 'Nội dung cần chèn'; // Sửa chỗ này fullcontent = $beforecontent . $content; return $fullcontent; } add_filter('the_content', 'mh_before');
Cách thêm nội dung cuối bài post
Chỉnh sửa và thêm code sau vào functions.php của theme đang dùng
function mh_after($content) { $aftercontent = 'Nội dung cần chèn'; //Sửa chỗ này $fullcontent = $content . $aftercontent; return $fullcontent; } add_filter('the_content', 'mhafter');
Thêm nội dung vào cả trước và sau bài post
Cũng chỉnh sửa và thêm code sau vào funtions.php của theme đang dùng
function mh_before_after($content) { $beforecontent = 'Nội dung trước bài viết'; $aftercontent = 'Nội dung sau/cuối bài viết'; $fullcontent = $beforecontent . $content . $aftercontent; return $fullcontent; } add_filter('the_content', 'mh_before_after');
Done!