WordPress.org

Ready to get started?Download WordPress

Forums

How to automate my WP to add short codes and tags after 1'st paragraph? (3 posts)

  1. danijelpendjer
    Member
    Posted 2 years ago #

    I would like to allowed my users with contributor role to add posts, but when I click on publish, or when contributor save a post for a review, tags or short codes by my choose need to be added automatically.

  2. RichardWPG
    Member
    Posted 2 years ago #

    Contributor can't publish posts directly. Check this out http://codex.wordpress.org/Roles_and_Capabilities

  3. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    if the added 'stuff' is always the same, you could possibly try to use a filter - http://codex.wordpress.org/Plugin_API/Filter_Reference

    in functions.php of your theme;
    example:

    add_filter('the_content','auto_add_content_after_paragraph');
    function auto_add_content_after_paragraph($text) {
      if( get_post_type() == 'post') :
        /*do whatever you need with $text ($text is the post content)*/
      endif;
      return $text;
    }

Topic Closed

This topic has been closed to new replies.

About this Topic