I am trying to pull a portion of a plugin into the wordpress homepage using the jQuery .load() method and I'm a little tripped up on the syntax on how to just pull in a section of the page. Heres my code:
//Get Current user and Home url
global $current_user;
get_currentuserinfo();
$kd_bpuser = $current_user->user_login;
$homeurl = get_home_url();
?>
<script>
//Pass home url and current user to javascript
var bpUser = <?php echo json_encode($kd_bpuser); ?>;
var bpUrl = <?php echo json_encode($homeurl); ?>;
var bpFullUrl = bpUrl +"/members/" + bpUser + "/forums/subscriptions/";
var bpData = "#bbp-author-unread-topics";
// console.log(bpFullUrl);
// console.log(bpUser);
// console.log(bpUrl);
</script>
<div id="bbpress-forums">
<script type="text/javascript">
//pull in members subscriptions page unread forum topics
jQuery( document ).ready(function( $ ) {
$("#bbpress-forums").load(bpFullUrl, bpData);
});
</script>
</div><!-- end bbpress-forums-->
Currently it just pulls in the whole page but I want it to just pull in this section: #bbp-author-unread-topics. Any help would be appreciated!