WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Custom function -> plugin (3 posts)

  1. briansol
    Member
    Posted 6 years ago #

    Hi all,

    I've created a custom function called
    the_archive_content() which is a derivative of the_content() in the post-template.php file that i built to display a summary and not to print ads based on my custom id system.

    It works fine... but i just ran into an issue with an upgrade from 2.2.1 to to 2.2.2.

    Without thinking, i just uploaded the files, and thus it over-wrote my funtion.

    I had a back up, so no biggie.

    But, going forward, this is going to be an issue, so i'd like to convert it to something (hopefully a plugin) so i don't have to worry about this again.

    My custom them calls the new function name, so i just need a place to put it, really.

    Whats the best way to do this?

    Thanks!

  2. whooami
    Member
    Posted 6 years ago #

    the best way to create a plugin? follow the directions?

    if you can write a function, you can write a plugin, and its all in the documentation.

    <?php
    /*
    Plugin Name: blah plugin
    Plugin URI: http://www.blah.com
    Description: blah blah..
    Author: blah
    Version: 1.0
    Author URI: blah
    */
    function my_function() {
    ..
    echo 'blah';
    }

    then just call the function in your theme file -- just like you have been doing.

  3. briansol
    Member
    Posted 6 years ago #

    Easy enough. Thanks, i got it all sorted out now.

Topic Closed

This topic has been closed to new replies.

About this Topic