WordPress.org

Ready to get started?Download WordPress

Forums

the_content into a variable (3 posts)

  1. AndreSC
    Member
    Posted 8 years ago #

    Inside an already severly customised Loop, I want to use the_excerpt to show the excrpt but want to also parse the content that would normally be displayed by the_content with php for some special customisation, e.g. show a reduced version of the first image in the post. Is this at all do-able? (as a quick php hack) or would something like this require creating a whole plugin?

    T.I.A.

  2. Michael_
    Member
    Posted 8 years ago #

    For parsing content I would write a plugin.

    See http://codex.wordpress.org/Plugin_API


    add_filter('the_content', 'your_parser_function', 10);

  3. AndreSC
    Member
    Posted 8 years ago #

    Thanx. Would that neccesarily change the_content throughout or could it involve an extra parameter via the template file to indicate if the plugin should be used or not?

Topic Closed

This topic has been closed to new replies.

About this Topic