Disabled AJAX paging with embedded views when used in Views template files I am using a View in two different pages: page--front.tpl.php and views-view-grid--inside--page-1.tpl.php which is a custom display of a view.

This is the code that is used in both of these

print views_embed_view("loadcover","block",$nid);


and I also set Use AJAX:Yes in the Views settings. The problem is the View's Ajax paging works in the page--front.tpl.php but it's Ajax paging doesn't work in views-view-grid--inside--page-1.tpl.php, In this page the pager is appeared as a link not ajax. What is the problem?



UPDATE:

I tried 

print views_embed_view("loadcover","block",$nid);


in page.tpl.php and it worked with Ajax, Is there any problem with Views template files?

I found Disabled AJAX paging with embedded views when used in page.tpl.php it gave me some clues but still I'm unable to solve the problem.



UPDATE:

This is the complete code, This code is exactly the code that is works in page--front.tpl.php. I moved the print views_embed_view("loadcover","block",$nid); in different places of this code but it didn't work again. I guess the problem might be because of js codes that are not loaded in this page.

&lt;?php
global $base_url;
global $language;
$menu  = new stdClass();
$menu = buildMenuObject($menu);
$bookCounter = 0;
while ($bookCounter &lt; sizeof($view-&gt;result)){
    $nid = $view-&gt;result[$bookCounter++]-&gt;nid;
    if($bookCounter &lt;= 6)
    {
        $top = 222 + (188 * floor($bookCounter/7));
    }
    else 
        $top = 252 + (188 * floor($bookCounter/7));
    $node = node_load($nid);
    $wrapper = entity_metadata_wrapper('node',$node);
    $title = $wrapper-&gt;title-&gt;value();
    $detail = $wrapper-&gt;field_detail-&gt;value();
    $writer = $wrapper-&gt;field_writer-&gt;value();
    $edition = $wrapper-&gt;field_edition-&gt;value();
    $translators = $wrapper-&gt;field_translators-&gt;value();
    $publisher = $wrapper-&gt;field_publisher-&gt;value();
    $year = $wrapper-&gt;field_year-&gt;value();
    $nop = $wrapper-&gt;field_nop-&gt;value();
    $jelds = $wrapper-&gt;field_jeld-&gt;value();
    print "&lt;div style='top:".$top."px' class='lib-td-detail lib-td-detail-counter-$bookCounter library-td-detail-nid-".$nid."'&gt;";
        print "&lt;img class='lib-detail-close' src='".$base_url."/sites/all/themes/lib/images/cross.png' /&gt;";
        print "&lt;div class='library-fields-container lib-inside-fields-$nid'&gt;";
            print "&lt;div class='library-fields-right library-fields'&gt;";
                print "&lt;div class='library-title'&gt;";
                    print $title;
                print "&lt;/div&gt;";
                print "&lt;div class='library-field library-writer'&gt;";
                    print $menu-&gt;writer." : ". $writer;
                print "&lt;/div&gt;";
                print "&lt;div class='library-field library-edition'&gt;";
                    print $menu-&gt;edition." : ". $edition;
                print "&lt;/div&gt;";
                print "&lt;div class='library-field library-translators'&gt;";
                    print $menu-&gt;translators." : ". $translators;
                print "&lt;/div&gt;";
                print "&lt;div class='library-field library-publisher'&gt;";
                    print $menu-&gt;publisher." : ". $publisher;
                print "&lt;/div&gt;";
                print "&lt;div class='library-f-detail'&gt;";
                    print $detail;
                print "&lt;/div&gt;";
            print "&lt;/div&gt;";
            print "&lt;div class='library-fields-left library-fields'&gt;";
                print "&lt;div class='library-fields-left-top library-fields-top'&gt;";
                    print views_embed_view("loadcover","block",$nid);
                print "&lt;/div&gt;";
                print "&lt;div class='library-fields-left-bottom library-fields-bottom'&gt;";print "&lt;/div&gt;";
            print "&lt;/div&gt;";
        print "&lt;/div&gt;"; 
    print "&lt;/div&gt;"; 
} 

?&gt;
It looks like you are adding some chunks of code logic to your theme templates?  This is not usually recommended in a drupal instance.  Have you tried adding a context to include your loadcover view block on the view generating your grid, so that you do not need to print embed in the tpl?
https://www.drupal.org/project/context

Enable the module and go to /admin/structure/context/add  Set the name of this context, something like Book Grid Display.  We use a "Layout" tag group for things like this, but you could use "custom" or just about anything you want, it is optional.  Under the Conditions dropdown select Views, and on the list that appears to the right check the box in front of your Inside grid view.
Under Reactions select Block.  The theme regions will appear as well as the different groupings of blocks available on your system.  The last grouping is Views, select your Loadcover view and click the +Add on the theme region you are wanting (I assume Content since you were printing this in the content template).

The page content will have a weight of 0, and the drag-and-drop reorder likes to start at weight -10 so use the Show Row Weights to get it under the view grid if desired.  Or at least that is a quirk I have seen when using this method.

Another note, the views_field_view that was mentioned in a comment would allow you to add your Loadcover view as a field in your book grid view, so that you did not have to inject it with custom code from the theme logic layer.  If you were wanting to invoke LoadCover for each cell in your grid and I missed that part, then yes views_field_view would solve the problem for you instead of this context solution which will get you one instance of Loadcover.