WordPress.org

Ready to get started?Download WordPress

Forums

Old School Function hacking for Corporate Blog (3 posts)

  1. fwallace99
    Member
    Posted 7 years ago #

    Hi all, hope you can help me.

    I'm customizing WordPress for a Corporate Blog. I need an old-school function hack to put Press Releases on the Sidebar of Every page.

    So obviously the Loop conditional won't do it for me (since it has to be page-independent, I have a number of static pages), I need to roll my own function with queries and the like. No biggie. I figure to clone an existing function and have it grab the title and first few lines of text out of the DB (fortunately I've got phpMyAdmin installed and I've got a test server for this). Put some div tags on it and I'm done.

    However, I'm having trouble figuring out where I can put my custom function. I've taken the default template, copied it and renamed it and hacked it up quite a bit CSS (style.css) and PHP-wise (sidebar.php and header.php and footer.php).

    I certainly don't want to put the function straight into the hacked template file sidebar.php, but there are a plethora of function files in wp-includes directory ... and I'm uncertain which function file I should use.

    I am using PHP5 and MySQL 5 and WordPress 2.05.

    Appreciate any pointers.

  2. Jon Bourne
    Member
    Posted 7 years ago #

    Create a file called functions.php in your template directory. WordPress will load any functions you define there, and you can then use them anywhere in your template.

  3. fwallace99
    Member
    Posted 7 years ago #

    thanks akbigdog. Will do.

    Thanks again.

Topic Closed

This topic has been closed to new replies.

About this Topic