• I want to make “read the rest of this entry” link become fancy and interesting.

    I found this code somewhere when i’m googling:

    <script type="text/javascript"
        src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.4.min.js">
        </script> <-- (I think this is unnecessary because wordpress already has jquery in it's directory, isn't it?) -->
        <script type="text/javascript"
        src="http://plugins.learningjquery.com/expander/jquery.expander.js">
        </script>
        <script type="text/javascript">
            $(function () {
                $('div.readmore').expander({
                    slicePoint: 200,
                    expandText: 'Click Here to Read More',
                    userCollapseText: 'Hide Text'
                });
            });
        </script>
    
    and this:
    <script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.js" type="text/javascript"></script> <-- (is this required?)-->
            <script type="text/javascript">
                $(document).ready(function() {
                    $(".message").hide();
                    $("span.readmore").click(function(){
                        $(".message").show("slow");
                        $(this).hide();
                    });
                });
            </script>
    
    But i don't know where these code to be inserted??!
    
    Below are the codes that i found in my theme directory that produce "read the rest of this entry" link.
    In my archive.php
    <div class="entry">
          <?php the_content() ?>
        </div>
    
    In my index.php
    <div class="entry">
          <?php the_content('Read the rest of this entry →'); ?>
        </div>
    
    In my page.php
    <div class="entry">
          <?php the_content('<p class="serif">Read the rest of this page »</p>'); ?>
          <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
        </div>
    
    In my single.php
    <div class="entry">
          <?php the_content('<p class="serif">Read the rest of this entry →</p>'); ?>
          <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
        </div>

    Hmm, anyone knows? I don’t know how to replace the above codes with those jquery.

  • The topic ‘How to ajaxed this??!’ is closed to new replies.