Inserting php pages into text blocks

Posted in: Newspaper
Post count: 13

How can I insert a php page into a block?
I know I have an option of appending php code in function.php and inserting it into text blocks via shortcodes.
I am trying to drop the whole output of the php page into a section wo modifying the template on the back end. Is that possible?

Thanks

Post count: 6535

HI

You can try to generate a shortcode for your custom php page then use it directly in Visual Composer. Check this link for more details about how to add a new shortcode: https://codex.wordpress.org/Function_Reference/add_shortcode Here is a basic example: http://screencast.com/t/3RkFBLEp0WUnhttp://screencast.com/t/cYP2rtkqYhttp://screencast.com/t/PDez39nJdT

function custom_shortcode(){
echo "This is my shortcode";
}
add_shortcode('shc', 'custom_shortcode');

Hope this helps.
Thanks!

Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Newspaper’ is closed to new topics and replies.