WordPress.org

Ready to get started?Download WordPress

Forums

MyCurator
[resolved] Remove Blockquote (6 posts)

  1. unconsultancy
    Member
    Posted 1 year ago #

    Hi,

    Is it possible to remove the blockqoute from the excerpt from all future posts (I have removed in manually from existing posts)?

    http://wordpress.org/extend/plugins/mycurator/

  2. mtilly
    Member
    Plugin Author

    Posted 1 year ago #

    If you mean to remove the excerpt text within the blockquote (and its blockquote tag) then yes, just set the Option "Excerpt length in words:" to 0. No excerpt text in a blockquote will be added to the post. You will only have a link in the post, either to the original page or the saved, readable page, depending on the link option you set.

    If you mean to just remove the blockquote tag, but leave the excerpt text, then there is no Option setting for this. We do provide a filter in the code - 'mct_ai_postcontent' where you could remove the blockquote tags and do any other formatting or changing of the text before it is saved. Of course this would require some coding.

  3. unconsultancy
    Member
    Posted 1 year ago #

    Thanks.

    Yes it was the v2nd of those options I was after. Can you point me towards the file in which the mct_ai_postcontent can be edited. I should be able to give it a go.

  4. mtilly
    Member
    Plugin Author

    Posted 1 year ago #

    It would be best to put the code in the functions.php file in your theme directory (under wp-content/themes/). You can read about Filters and Functions.php.

    You can place the following code at the end of the functions.php file on a line before the ?> that ends it. This way you won't have to update the code every time MyCurator is updated. You will have to re-add the code to functions.php when you update your theme.

    I haven't tested it but it should remove the blockquotes and leave the link, but you will have to adjust it for formatting such as spacing or line breaks.

    add_filter('mct_ai_postcontent','my_curator_filter');
    function my_curator_filter($content){
        $content = strip_tags($content,'<a>'); //strip tags, but leave the link <a> tag
        //Add any other formatting to the $content variable here
        return $content;  //make sure to return the $content
    }

    For reference the filter is applied in MyCurator_local_proc.php, just search for mct_ai_postcontent.

  5. unconsultancy
    Member
    Posted 1 year ago #

    Excellent thankyou. I've made the change and look forward to the new format when I next make a post live.

    Tim

  6. mtilly
    Member
    Plugin Author

    Posted 1 year ago #

    The filter will actually work when MyCurator creates new posts (either in the training page or into the live blog if the Topic is Active). It does not work when you [Make Live]. It will take affect on new posts created by MyCurator after you made the change. Existing posts before you made the change will still need to be edited.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic