Site logo

[Support request] Can not make whole post clickable

Home Forums Support [Support request] Can not make whole post clickable

Home Forums Support Can not make whole post clickable

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1856494
    Stef

    Hi,

    @ejcabquina asked me to open a topic for this problem here.

    I am using the WP Show Posts plugin together with Generatepress Premium. I followed all the directions and hooked a piece of code in the footer section of my website:

    
    <?php
    jQuery( document ).ready( function( $ ) {
        #( '#wpsp-555 article' ).on( 'click', function( e ) {
            var _this = $( this ),
                url = _this.find( 'a' ).attr( 'href' );
    
            if ( url ) {
                window.location.href = url;
            }
        } );
    } );
    ?>
    

    This somehow does not work. A sample site is wirodakwerken.nl. When I click on posttexts on the homepage nothing happens.

    What am I doing wrong?

    Regards,

    Stef

    #1856772
    David
    Staff
    Customer Support

    Hi there,

    thats code is Javascript – it should be in <script> tags:

    <script>
    jQuery( document ).ready( function( $ ) {
        #( '#wpsp-555 article' ).on( 'click', function( e ) {
            var _this = $( this ),
                url = _this.find( 'a' ).attr( 'href' );
    
            if ( url ) {
                window.location.href = url;
            }
        } );
    } );
    </script>
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.