Title: Noob question &#8211; PHP Link help
Last modified: August 21, 2016

---

# Noob question – PHP Link help

 *  [Jackage95](https://wordpress.org/support/users/jackage95/)
 * (@jackage95)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/noob-question-php-link-help/)
 * 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.

## Tags

 * [pagination](https://wordpress.org/support/topic-tag/pagination/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [Jackage95](https://wordpress.org/support/users/jackage95/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/noob-question-php-link-help/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
