This guide is for little advanced users, who know little bit of php.
We will suggest to try out below changes on test setup and check it is not breaking your website or app.
It will change only the app content, your website content remains as it is.
To Add before the content of all posts
Add this code to functions.php
add_filter( 'rest_prepare_post','androapp_overwrite_content_pre', 8, 3 ); function androapp_overwrite_content_pre($data, $post, $context) { $inner_data = $data->data; if(!($inner_data['type'] == "post" ||$inner_data['type'] == "page")){ return $data; } $textToBeAdded = "add your html code here"; $inner_data['pwapp_post_content'] = $textToBeAdded.$inner_data['pwapp_post_content']; return $data; }
To Add after the post content
Add this code to functions.php
Continue reading “AndroApp Tricks to change post content”