• Resolved janmendozaco

    (@janmendozaco)


    Hi,

    I was wondering if it’s possible to change the links of the posts to the lightbox of the featured image instead of directing it to the post page.

    Regards

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @janmendozaco,

    There isn’t a built-in way to achieve what you’re after but, if you’re fairly comfortable with HTML and PHP, you could edit your theme’s code to achieve what you want.

    The first step to that would be for you to set up a child theme.

    The following guides provide a good introduction to child themes, including steps to set one up:

    After you have completed that step, copy the parent’s content.php file to your child theme’s directory and then open it in your favourite text/code editor.

    Locate the following code in that file:

    <a href="<?php echo esc_url( boardwalk_get_link_url() ); ?>" class="entry-link"><span class="screen-reader-text"><?php _e( 'Continue reading <span class="meta-nav">&rarr;</span>', 'boardwalk' ); ?></span></a>

    The above code is defining the link for each of posts and is what you’ll need to edit to instead link to the URL for the featured image.

    The following function reference may help you with the above:

    https://codex.www.ads-software.com/Function_Reference/the_post_thumbnail_url

    Making the image appear in a lightbox will require some JavaScript. You may be able to find some good plugins or online tutorials to help with that.]

    Hope the above helps to point you in the right direction!

    Thread Starter janmendozaco

    (@janmendozaco)

    Hi,

    Thank you so much for this, Ms. Siobhan. I’ll try and study the links you gave me.

    Regards

    Sounds great! ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Post links to lightbox instead of post pages’ is closed to new replies.