Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #699924

    Hi,
    I’ve created a one-page website in Enfold, and added a portfolio grid with 30+ objects. I’ve set that I would like 20 objects to be displayed on the first page, and the remaining on the next pages.
    The grid is placed in a Color Section with a Section ID “transactions”.
    Under the grid the visitor can click Page 2. When I hold the cursor above the pagenumber I can see that the link is “website”/page/2/
    When the page reloads, it brings the visitor all the way back up to the welcome section. They then have to scroll down to the transactions section one more time to see the objects on page 2.

    I would like page 2 (and later) to link back to the Color Section with the Section ID “transactions”. Something like “website”/#transactions/page/2/
    However, I’m unable to find out if it is possible to define this without going into any .php details or similar. I’m just a novice in webdesign.

    Any ideas from anyone on the forum?

    #700525

    Hi jarlsberg,

    Could you post a link to the site in question so that we can take a closer look please?

    Regards,
    Rikard

    #701802

    Hi.
    The site is jarlsbergpartners.no. The direct link to the transactions is http://jarlsbergpartners.no/#transaksjoner
    Scroll down on the page. Click page 2, and note that the link http://jarlsbergpartners.no/page/2/ take you back to the top of the page. I want it to take me back to the top of that section.

    • This reply was modified 8 years ago by jarlsberg.
    #702697

    Hi,

    Thank you for the info.

    Please add this in the functions.php file.

    function add_custom_script(){
    ?>
    <script type="text/javascript">
    (function($){
    function b() {
    		$('.pagination .inactive').click(function(e) {
    			e.preventDefault();
    
    			var news = $('#transaksjoner'),
    				link = $(this).attr('href'),
    				anchor = $(news).attr('id');
    
    				if(!news.length) return;
    
    				var link = link + '#' + anchor;
    				window.location.href = link;
    		});
    	}
    
    	b();
    })(jQuery);
    </script>
    <?php 
    }
    add_action('wp_footer', 'add_custom_script');

    Best regards,
    Ismael

    #702785

    Thank you. I’m sure that will work. However, I’m unable to check. Because when I added this to functions.php the entire web site disappeared. I have engaged a firm to check out what happened, but updating functions.php from the admin panel was obviously not the correct way to do it. I will let you know how well the function works when we hopefully have recovered the site.

    #702919

    Hi,

    Ok, thanks for the feedback. If you want to remove the code you can do so by using FTP software and edit it manually. If you should need any further help from us then please post admin login details in private.

    Best regards,
    Rikard

    #703178

    Our site is now back up again. It was a spelling error in a comment above the script that ruined functions.php.

    For the benefit of others that may read this ticket; the script above works perfect. Both on Windows 10 with Firefox, and Android using Dolphin.

    #703572

    Hi,

    Great, glad you found the problem and thanks for the feedback :-)

    Please open a new thread if you should have any further questions or problems.

    Best regards,
    Rikard

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Link to next page when using Portfolio Grid in Enfold one-page website’ is closed to new replies.