Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #720607

    Hi,

    I have read other posts about editing the content of the default 404 page and successfully did so.

    I was able to change the page’s text content, and to remove some elements from it (search and recommended posts). Now I’ve got a very simple 404 page (see private content) with text only.

    However, I’d now like to add an extra element to it: a portfolio grid displaying a single portfolio item.
    I started by building this element using the Avia Layout Builder on a normal page (see private content). Then I’ve started to look for its php code in my site’s file… and this is where I’m stuck.

    Could you help me locate the code from the page I’ve created so that I can insert it into my 404 page?

    Thanks in advance,
    Robin

    #721800

    Hey Robin,

    Thank you for using Enfold.

    Use the “Insert Shortcode” button and generate the portfolio grid shortcode. You can then add it in the 404 template in combination with the do_shortcode function.

    // https://developer.wordpress.org/reference/functions/do_shortcode/

    Best regards,
    Ismael

    #721890

    Hi Ismael,

    Thank you for your help!! :)

    So I’ve generated the shortcode:
    [av_portfolio columns='1' one_column_template='default' items='1' contents='no' preview_mode='auto' image_size='portfolio' linking='' sort='no' paginate='no' query_orderby='rand' query_order='DESC']

    And included it in my 404 like this, following instructions on the link you gave me:
    <?php echo do_shortcode( '[av_portfolio columns='1' one_column_template='default' items='1' contents='no' preview_mode='auto' image_size='portfolio' linking='' sort='no' paginate='no' query_orderby='rand' query_order='DESC']' ); ?>

    However the 404 is now endlessly loading – do you know how I could fix this?

    Thanks again and all the best,
    Robin

    #722785

    Hi,

    Replace the single quote with quotes.

    <?php echo do_shortcode( "[av_portfolio columns='1' one_column_template='default' items='1' contents='no' preview_mode='auto' image_size='portfolio' linking='' sort='no' paginate='no' query_orderby='rand' query_order='DESC']" ); ?>

    Best regards,
    Ismael

    #723202

    Thank you Ismael!
    Works perfectly now :)

    #723576

    Hi,

    Great, glad you got it working :-)

    Please let us know if you should need any further help on the topic.

    Best regards,
    Rikard

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.