Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #409119

    Joy
    Buyer
    Post count: 991

    Hi guys, I’ve been trying to implement this within the sidebar but haven’t had luck. The link from the Supreme detail header has been removed and we are trying to relocate to the side bar. However, part of the code isn’t being accepted – and the link isn’t conditional and remains visible even if there is not email address input for the listing.

    I have tried several options, including hard-coding the geodirectory-compatibility.php but I’m stuck. This is the code I’m using:

    global $post;
    if (!isset($post->geodir_email) || empty($post->geodir_email)) {
    	?>
    	<a href="javascript:void(1);" class="b_send_inquiry2" onclick="jQuery( '.b_send_inquiry' ).click();">Send Enquiry</a>
    	<?php
    }

    I have followed this post: https://wpgeodirectory.com/support/topic/send-enquiry-form/

    I have tried to use it within a text widget that has been edited to accept php and also within a php widget. Please see the attached results. Adding an opening php code doesn’t have any effect also. Thank you.

    #409158

    Alex Rollin
    Moderator
    Post count: 10821

    Hello!

    As you saw, in the posts you referenced, this is based on the existing link functionality within the theme. A developer should be able to get your customization implemented with the filter so it can be used again outside the theme https://wpgeodirectory.com/support/topic/listing-detail-author-link/#post-361147

    We are currently working hard on GeoDirectory V2 which will make some of the most common requests easier regardless of what theme is being used.

    #409159

    Joy
    Buyer
    Post count: 991

    I am trying to do exactly that – use a link with the existing functionality of the theme. The link you referenced is to change the function of the “Send Enquiry” link, which is not what I am looking for.

    I simply want to add the “Send Enquiry” link into the sidebar instead of it being in the Supreme header.

    #409167

    Alex Rollin
    Moderator
    Post count: 10821

    Hello!

    If you removed the link, then you cannot recall the functionality with the snippet.

    If you did restore the theme functionality then the snippet could be used to duplicate the link, not move it.

    #409169

    Joy
    Buyer
    Post count: 991

    But that’s the problem. I have attached the image of the way the snippet is displaying when used in a php widget in my original post. The link and the pop-up form is just fine, but the conditions are being lost – meaning it should/should not display based on the listing email field being populated. The link for the “Send Enquiry” option is being displayed on listings with an without an email. Even if there is not action when an email is not present, it could be confusing, so I’m trying to figure out why half of the code is being lost.

    The functionality isn’t removed, it’s hidden in the header with CSS. Couldn’t I hide the supreme header link and rename this div so that it’s visible? It seems that the contact link can be set up more than once on a page so it should be a problem.

    #409218

    Alex Rollin
    Moderator
    Post count: 10821

    Hello!

    You can post the code you are using here and we can take a look at it.

    #409227

    Joy
    Buyer
    Post count: 991

    I have posted it on my very first attempt with this thread. Please reread the first post. Thank you.

    global $post;
    if (!isset($post->geodir_email) || empty($post->geodir_email)) {
    	?>
    	<a href="javascript:void(1);" class="b_send_inquiry2" onclick="jQuery( '.b_send_inquiry' ).click();">Send Enquiry</a>
    	<?php
    }
    #409257

    Alex Rollin
    Moderator
    Post count: 10821

    Hello!

    Just to confirm again, this is a site with Supreme?

    Please send over the site URL and WP Admin so we can take a look.

    #409271

    Joy
    Buyer
    Post count: 991
    This reply has been marked as private.
    #409305

    Kiran
    Moderator
    Post count: 3318

    Hi Joy,

    You have used incorrect logic in code. You have missing opening & closing PHP tags.
    I have updated snippet code in your widget:

    <?php global $post; if ( ! empty( $post ) && ! empty( $post->geodir_email ) ) { ?>
        <a href="javascript:void(1);" class="b_send_inquiry2" onclick="jQuery('.b_send_inquiry').click();">Send Enquiry</a>
    <?php } ?>

    Thanks,
    Kiran

    #409396

    Joy
    Buyer
    Post count: 991

    Thank you so much Kiran! I really appreciate that.

    Is there a way that I can have the actual php widget to respond to the same “if” statements used in this code? I have styled the widget to look good with the theme, the only problem I have now is that if there is no email address – the link does not show up, but there is a blank stylized button that will still appear. Any ideas?

    #409489

    Kiran
    Moderator
    Post count: 3318

    Hi Joy,

    The logic i used will not display link if there is blank value for email field.

    See attachments.
    1) With email
    2) Without email

    Let us know.

    Thanks,
    Kiran

    #409500

    Joy
    Buyer
    Post count: 991

    Thank you. I actually meant if I could apply the logic to a widget. On the site I am working on I styled the “Send Enquiry” link so that there was a background because I added it to the sidebar with css. So when the link isn’t visible, the background would still show. It looked strange.

    But no worries, the client decided to use a default email address for listings without an email contact, so the link shows all the time anyway. Thank you again.

    #409502

    Kiran
    Moderator
    Post count: 3318

    Thanks for letting us know 🙂

    Kiran

Viewing 14 posts - 1 through 14 (of 14 total)

The topic ‘Supreme, Send Enquiry – Sidebar’ is closed to new replies, this may be for inactivity, please open a new topic if you have a similar question.

  • How to add a new support ticket

    To open a new support ticket, first select the relevant forum and then click the "New Post" button. Example: You need support for the core plugin? Click on GeoDirectory Core Plugin support and click on the "New Post Button".
  • Support Policy

    Please read the support policy before starting to use the forum.
  • Are you a developer?

    Make Money with GD Jobs

    Get listed in the GeoDirectory Experts Directory. There may be a new client waiting for your services.
  • Looking for a GD developer?

    We do not provide customization services, but feel free to check out the GeoDirectory Experts Directory, there you'll find several freelance GD experts ready to start working with you.