how to create shortcode in wordpress?

When I run the following i get:

Parse error: syntax error, unexpected ‘if’ (T_IF) in

function list_pages_function( $atts, $content ) {
        echo "Define topic and title";
        echo "Definir el tema y título";
        echo "Definisci il topic ed il titolo";
        echo "Définir le sujet et le titre";
  add_shortcode( 'output_pages', 'list_pages_function' );

If I remove return it is fine but when I place

  • 1.[output_pages]
  • the output won’t be within the

  • but it will be right at the top of the content breaking the layout

    Read more here: how to create shortcode in wordpress?

  • Leave a Reply

    Your email address will not be published. Required fields are marked *