• Hello there,

    I am editing the wp-includes/link-template.php file in WordPress, and would like to use Ajax to load posts into my ID of #box-right. I am aware that there are many plugins for this usage but I am using my own HTML and CSS layout, and including posts (not having integrated my site with WordPress).

    I am using AJAX to load content in certain DIV’s within my site, I need to change the following code to load posts into my box-right div.

    return '<a href="' . previous_posts( false ) . "\" $attr>". preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&$1', $label ) .'</a>';

    The AJAX link looks like this:

    <a href="#" "onclick="javascript:ajax_loadContent('box-right','page-here.php');return false">

    I need to make the top link load the ajax, I thought it would look like this (I am new to PHP)

    return '<a href="#" onclick="javascript:ajax_loadContent(\'box-right\','. previous_posts( false ) . "\"');return false>$attr>". preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&$1', $label ) .'</a>';

    What am I doing wrong here?

    Cheers.

The topic ‘Noob question – PHP Link help’ is closed to new replies.