Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
  • #1263840


    I have not yet been able to find a solution to my specific problem.

    I have a link in my menu which I would like to anchor to an open ajax portfolio. I have been able to find a thread that defaults an ajax to open, but only if it is the first thing a user encounters on a page.

    It is possible a deeplink to that specific Ajax would work, but I have not yet been able to successfully make that happen.

    Preferably I would like the grid to default to All, but if a link is clicked in the menu, open Ajax portfolio preview.


    Hey bnewman1,

    Thank you for the inquiry.

    Would you like to open a specific portfolio item on page load? If that is what you want, the following documentation should help.


    But instead of anchors, we will use query strings or URL parameters containing the ID of the portfolio item.

    Example of a custom URL as shown in the documentation.

    Best regards,


    Hi Ismael,

    Appreciate the reply – I unfortunately do not need the item to open on page load, but rather on the click of an item in the main menu.

    I have updated the php file as suggested with the link above but am unable to create a link that will open the appropriate ajax portfolio preview.




    Sorry for the delay. We could attach an event listener to the menu item so that when it is clicked, the corresponding portfolio item will open.


    We could use this function to open the portfolio item, or dispatch a click event based on the menu item that was clicked.


    Best regards,


    No worries on the delay. I am not familiar with jquery at all. These changes would need to be made in the code placed in my php file?

    Whichever you recommend.

    Honestly if we could even just have the portfolio default to open without autoscrolling to the section, that would work fine. The site is basically a single page with anchor links in the menu. I just need the user to treat the first ajax portfolio preview like a section, and then have the other portfolios available to open if needed.



    Thank you for your patience.

    Would you like the Graham Capital menu item to open the first AJAX portfolio item in the page? If this is what you need, please try to use this snippet in the functions.php file.

    // trigger portfolio ajax on menu click
    function ava_script_events_container() {
        if ( wp_script_is( 'avia-default', 'registered' ) ) {
            wp_add_inline_script( 'avia-default', '(function($) {
    			(function($) {
    				$(document).ready(function() {
    				    // when the menu item with the ID 744 is clicked...
    				    $("#menu-item-744 a").on("click", function(event) {
    						// prevent the default action..
    						// , then dispatch a click event to the portfolio item with the ID 44 to open it
    						$(" a").trigger("click");
     add_action( 'wp_enqueue_scripts', 'ava_script_events_container', 9999);

    As explained in the script comments, this will open the portfolio entry with the ID 44 when the menu item Graham Capital or the menu item with the ID 744 is clicked.

    Best regards,


    Hi Ishmael,
    That is what I need-

    Unfortunately this change to the PHP file did not cause any changes to site function.

    Can you please advise? Really appreciate your help here.

    Thank you!




    The script should attach a click event listener to the Graham Capital menu item. Did you test that menu item?

    Would you mind if we access the dashboard and the file server so that we could test the modification? Please post the WP details in the private field and the FTP details as well if it is available. If FTP is not available, please make sure that the Appearance > Editor panel is accessible so that we could edit the files when necessary.

    Thank you for your patience.

    Best regards,

    This reply has been marked as private.


    Thank you for the info.

    The password for the username is incorrect, unfortunately. Please check it carefully or provide another valid account so that we could access the dashboard.

    Best regards,



    I thought I had responded but it appears not. Please see below:


    I figured it out! I was using the Portfolio slug not the Portfolio ID in the deeplink URL (which I was only able to figure out through using inspect element).

    I appreciate all your help!

    Perhaps in the portfolio grid deeplink instructions you could add a section clarifying how to access the Portfolio item ID, I think it would clear up the issue for a lot of people!




    I’m glad this was resolved. If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Portfolio Grid – Open to Ajax by Default’ is closed to new replies.