• Resolved kekese

    (@kekese)


    Hi

    I have a problem with creating a shortcode.
    I read several documents, but I don’t get any output.

    in function.php:
    function headertext_function( $atts , $inhalt = null ) {
    return $inhalt;
    }
    add_shortcode( ‘headertext’, ‘headertext_function’ );

    in page.php:
    in the place where I want it to be with php-tag
    headertext_function( 'headertext' );

    in Backenend on the Start-home-page:
    [headertext]
    Essen in einer sch?nen und freundlichen Umwelt.
    [/headertext]

    what am I doing wrong?
    i want to display any text on the page with a shortcode.


    • This topic was modified 1 year, 10 months ago by kekese.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello, I think you are very close, in?page.php try replacing your code with:

    echo do_shortcode('[headertext]');

    Thread Starter kekese

    (@kekese)

    Thank for your Answer. But dosn’t work.
    I find another way with the Plugin ACF.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Shortcode insert’ is closed to new replies.