You didn’t say how you were going to implement the code: If you are using page templates or custom post pages, you could do this:
<?php
$user_id = get_current_user_id();
if ($user_id == 0) {
echo 'You are currently not logged in.';
} else {
echo do_shortcode('[pods-form name="user" id="'.$user_id.'" fields="my_field, my_field_2, my_field_3"]');
}
?>
are you looking to add this after your content or before on all pages you could add this to your functions.php
function 247070_before_after($content) {
$user_id = get_current_user_id();
if ($user_id == 0) {
$formstatement="You are currently not logged in.";
} else {
$formstatement = do_shortcode('[pods-form name="user" id="'.$user_id.'" fields="my_field, my_field_2, my_field_3"]');
}
$addlcontent = $formstatement;
$fullcontent = $content . $addlcontent; //move $addlcontent in front of $content to add your from to the front.
return $fullcontent;
}
add_filter('the_content', '247070_before_after');