Support » Theme: Shapely » shapely_home_parallax: Parallax Section for FrontPage

  • Resolved SunnyOz

    (@sunnyoz)


    I have a website that is based on the Shapely wordpress theme. I’ve created a child theme from it, and have been able to customize the site exactly as I want.. everything looks great!

    On the home page, I have added two “[shapely] Parallax Section for FrontPage” widgets. The one I have a question about is the first one. It has a full background hero image, and a button (that says: “Log In Here”) to log into the site. All works fine.

    My problem is that I would like to put some php code around the button display, to check if the user is already logged in, and if so, hide the login button.

    I’ve tried looking through these files and folders: function, page, template pages, template parts, layouts, etc, and just can’t find the php file where you create the code for the parallax widget button, and specifically where you write the line that will end up looking like this:
    <a class="btn btn-lg btn-filled" href="http://mysite.com/login">Log In Here</a>

    Can you tell me what file contains the code that creates the button for the parallax widget for home page?

    Thanks,
    SunnyOz

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Never mind… I just now found the answer for myself.

    For those looking at this post in the future and want to do something similar, here is my solution:

    The file to change is located here:
    wp-content\plugins\shapely-companion\inc\widgets\class-shapely-home-parallax.php

    I changed this line of code:

    echo ('' != $button1 && '' != $button1_link) ? '<a class="btn btn-lg btn-filled" href="' . esc_url( $button1_link ) . '">' . wp_kses_post( $button1 ) . '</a>' : '';

    to this:

    if ( is_user_logged_in() ) {
    	echo ('' != $button1 && '' != $button1_link) ? '<a class="btn btn-lg btn-filled" href="#">Welcome - You are already logged on</a>' : '';
    } else {
    	echo ('' != $button1 && '' != $button1_link) ? '<a class="btn btn-lg btn-filled" href="' . esc_url( $button1_link ) . '">' . wp_kses_post( $button1 ) . '</a>' : '';

    Hope this helps.
    SunnyOz

    Awesome great to see you found the answer.

    Please advise if you have more questions.

    Have a fantastic day!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘shapely_home_parallax: Parallax Section for FrontPage’ is closed to new replies.