I published an issue a few days ago regarding how to Scroll to Single Post inside a custom Wordpress template that I am developing. Things I need within the nut spend would be to load just one publish right into a defined DIV whenever a particular link is clicked on after which scroll lower to that particular DIV holding the recently loaded content. Thinking about the dynamic content character of Wordpress or those of every other Content management systems, the Link to that link can't be a complete one.

Regrettably, there wasn't any concrete answer around at that time of your time, and so i made the decision to snoop around a bit. Because the primary problem was loading this content in dynamically, I choose to focus how I'm able to get it done with AJAX and JQUERY using blogging platforms:

To date, I've become a small idea from the great publish (Loading WordPress posts with Ajax and jQuery) by Emanuele Feronato. He essentially stores the publish ID within the rel attribute from the clickable link after which calls it. Well, you will find a couple of other steps to make this happen, however the reason I am only mentioning the publish ID at this time happens because it appears it is the only part of the process that is not right the publish ID loads in to the link's rel attribute but does not load in to the .load function.

Just to provide you with a much better concept of what I have become during my markup to date:

THE AJAX/JQUERY IN HEADER.PHP

$(document).ready(function(){

    $.ajaxSetup({cache:false});
    $(".trick").click(function(){
        var post_id = $(this).attr("rel");
        $("#single-home-container").html("loading...");
        $("#single-home-container").load("http://<?php echo $_SERVER[HTTP_HOST]; ?>/single-home/",{id:post_id});
    return false;
    });

});

INDEX.PHP

<?php get_header();?>

<!--home-->
<div id="home">

<!--home-bg-->
<img class="home-bg" src="<?php bloginfo('template_url');?>/images/home-bg.jpg" />
<!--home-bg-->

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <a class="trick" rel="<?php the_ID(); ?>" href="<?php the_permalink();?>">

        <div class="box element col<?php echo rand(2,4); ?>" id="<?php $category = get_the_category(); echo $category[0]->cat_name; ?>">               

            <?php the_post_thumbnail(); ?>

            <span class="title"><?php the_title(); ?></span>    

            <span class="ex"><?php the_excerpt(); ?></span>

        </div>

    </a>

    <?php endwhile; endif; ?>

</div>
<!--home-->

<div id="single-home-container"></div>

SINGLE-HOME.PHP (This Can Be A CUSTOM TEMPLATE)

<?php

    /*
    Template Name: single-home
    */

?>    

<?php

    $post = get_post($_POST['id']);

?>

    <!--single-home-->
    <div id="single-home post-<?php the_ID(); ?>">

    <!--single-home-bg-->
    <div class="single-home-bg">

    </div>
    <!--single-home-bg-->

    <?php while (have_posts()) : the_post(); ?>

        <!--sh-image-->
        <div class="sh-image">

            <?php the_post_thumbnail(); ?>

        </div>
        <!--sh-image-->

        <!--sh-post-->
        <div class="sh-post">

            <!--sh-cat-date-->
            <div class="sh-cat-date">

                <?php

                    $category = get_the_category(); 
                    echo $category[0]->cat_name;

                ?>

                - <?php the_time('l, F jS, Y') ?>

            </div>
            <!--sh-cat-date-->

            <!--sh-title-->
            <div class="sh-title">

                <?php the_title();?>

            </div>
            <!--sh-title-->

            <!--sh-excerpt-->
            <div class="sh-excerpt">

                <?php the_excerpt();?>

            </div>
            <!--sh-excerpt-->

            <!--sh-content-->
            <div class="sh-content">

                <?php the_content();?>

            </div>
            <!--sh-content-->

    </div>
    <!--sh-post-->        

    <?php endwhile;?>

    <div class="clearfix"></div>    

    </div>
    <!--single-home-->

Only for the record: Once the publish ID unsuccessful to load, I attempted setting up that specific Kubrick theme utilized in Emanuele Feronato's demo. I made the alterations based on his guide but nothing work.

Does anybody have idea what's happening or maybe there's every other method to dynamically load the publish ID in to the .load function?