Support » Fixing WordPress » is there a shortcode to insert standard text?

  • I’m not sure how to put this problem into WordPress concepts, but here’s the issue. Any help pointing me to basic WordPress concepts, even if you can’t solve my problem would be helpful. (Mods, I mention Elementor in this post but I don’t think this is an Elementor issue.. I think there must be some standard wordpress concepts I need to understand.)

    I have a WordPress site for my computer science tutoring business, and there’s some “standard” text I want to insert in several pages. I don’t want to just copy and paste it, because I’d like to update it from time to time and automatically have all the updates shown.

    I don’t know if this is relevant, but I’m using Elementor and my concept of a “template” is something I learned from Elementor so I don’t know if it’s different in vanilla WordPress. So the idea is that I have a “page template” created in Elementor that shows pages in a certain way… to create a new page all I have to do is create the page and insert some text. This idea, a template to show a page in a certain way, must be a basic wordpress concept, right?

    What I’m getting at is that I want to insert this shortcode to show standard text in the middle of the page content, so I can’t make it part of the page template. So I’m wondering if there’s a shortcode that can do it.

Viewing 1 replies (of 1 total)
  • Hi.
    You can add any shortcode in your theme functions.php.
    This is very basic one to return ‘Hi!’ with p tag.
    It can be called by [std].

    function std_func( $atts ) {
    	return "<p>Hi!</p>";
    }
    add_shortcode( 'std', 'std_func' );
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.