• Resolved deko

    (@deko)


    With the basic WP HTML editor, I can click the “more” button from the tool bar (or alt+t) and the <!--more--> tag is inserted into the post editor.

    Can this be modified?

    I’d like it to insert something like this:

    <!–more–>
    My text here…

    Which file needs to be modified? xmlrpc.php?

    Other suggestions?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Something like this article help?
    Customizing_the_Read_More

    Thread Starter deko

    (@deko)

    Not really…

    I think I found it here:

    wp-includes/js/quicktags.js line#126:

    edButtons[edButtons.length] =
    new edButton('ed_more'
    ,'more'
    ,'<!--more--> <small>You may find this page easier to read with a different background shading.<br />Select your preference from the drop-down list.</small>'
    ,''
    ,'t'
    ,-1
    );

    The problem is I want to insert a form as well as that text.

    I’m at a complete loss in understanding what you wish to accomplish. (and don’t forget to wrap code in backticks)

    Thread Starter deko

    (@deko)

    Basically, just a shortcut for me.

    Whenever I write a post that has a <!--more--> tag, I want to automatically some text and a form.

    So, when I use alt+t, or click the “more” button, that form and text is inserted into the post editor.

    I’ve just about accomplished this by editing the file mentioned above. The only problem is my form requires the post id, which which is unknown until I save the post.

    But I can live with going back to insert that.

    The object here is to allow the user to select his own background image for easier reading. Many of my posts are several pages long.

    Thread Starter deko

    (@deko)

    Looks like you can add just about anything you want, including a form, to be inserted with that <!--more--> tag.

    You’ll break it if you have a line break in your code, however.

    Glad you got it sorted out (I understand now!)

    Thread Starter deko

    (@deko)

    The one thing that would make it really nice is if I could use some kind of template tag in place of the unknown PostID.

    For example:

    <form name="bgcolor" action="https://www.myblog.com/?p=[POSTID]#more-[POSTID]" method="post">

    Do you know of any template tag that will work like this in the post editor?

    Thread Starter deko

    (@deko)

    got it working!

    Here is the complete code:

    var pid = location.search.split("post=");
    edButtons[edButtons.length] =
    new edButton('ed_more'
    ,'more'
    ,'<!--more--><small>You may find this page easier to read with a different background color.<br />Select your preference from the drop-down list.</small></p><form name="bgcolor" action="http :// www . example . com/?p=' + pid[1] + '#more-' + pid[1] + '" method="post"><select style="width: 180px" name="color" onchange="bgcolor.submit()"><option selected="selected" value="default">select background color</option><option value="white">default</option><option value="yellow">yellow</option><option value="grey">grey</option></select></form>'
    ,''
    ,'t'
    ,-1
    );

    notes:
    1. </p> before <form> element
    2. no line breaks in the string following <!--more-->

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Can <!–more–> tag be modified?’ is closed to new replies.