disable 'Add to favorite' link with whole element

This topic contains 9 replies, has 3 voices, and was last updated by  Giri 7 years, 11 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #213201

    Mario
    Expired Member
    Post count: 58

    Some links on the right side of detail-page are wrapped with the same class <p class=”edit-link”>..</p>. For example ‘Edit post’, ‘Add to favorite’ or ‘Business Owner’.
    Now i want disable just ‘Add to favorite’ link (complete paragraph) with CSS.

    The problem: if i am logged in, the related <p class=”edit-link”> element is in second position (first is ‘Edit post’). If not logged in, the p occures on first position. See Screenshots. Website for example: http://stage.radsport-spanien.de/veranstalter/rennradferien-mit-ciclo-costa-blanca/

    So no chance to select this with CSS-Selector. Any idea how to disable the whole <p> element (not just class geodir-addtofav)? Wouldn´t be a problem with different class names.
    Thank you very much in advance.

    #213396

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    sorry about that, I’ll make sure they change the class of the link to favorite-link instead of edit-link.

    If you provide admin credentials in a private reply, the develoeprs will patch your install once they fixed this.

    Let us know,

    Thanks

    #213601

    Mario
    Expired Member
    Post count: 58
    This reply has been marked as private.
    #213645

    Giri
    Expired Member
    Post count: 3155

    Hi sorry about your problem.

    But you can modify the class using our hooks.

    I have added the following code in your child theme. Let me know how this goes.

    Thanks

    
    
    
    remove_action('geodir_after_edit_post_link', 'geodir_add_to_favourite_link', 1);
    add_action('geodir_after_edit_post_link', 'geodir_add_to_favourite_link_modified', 1);
    function geodir_add_to_favourite_link_modified()
    {
        global $post, $preview;
        if (!$preview && geodir_is_page('detail')) {
            ?>
            <p class="edit_link geodir-favorite-html-wrap">
                <?php geodir_favourite_html($post->post_author, $post->ID); ?>
            </p>
        <?php
        }
    }
    #213650

    Mario
    Expired Member
    Post count: 58

    thanks. But now i am lost. The functions.php is overwritten and all my own edits and automated entrys by plugins/Avada theme are gone.
    Do you have a backup of this functions.php?

    #213656

    Giri
    Expired Member
    Post count: 3155

    Hello Mario, When I load your functions.php file, it was empty. Thats why I put new <?php tag and then added my custom code.

    Am i missing something?

    #213657

    Giri
    Expired Member
    Post count: 3155

    If there was some existing code I always append my code and never I would never replace that code with mine.

    So I think i’m missing something.

    #213660

    Giri
    Expired Member
    Post count: 3155

    Hey Mario, I just spoke with stiofan, he said the problem is with WP theme editor. He said sometimes it may not load existing code properly. This is a rare case. So looks like that problem happened in our case.

    I’m not sure how much modifications you have made in your child theme. Do you have any backup? Or can you ask your hosting to recover that file.

    In any way, don’t worry. I’ll be here to fix your problem if we can’t able to get backups.

    Thanks and sorry for the inconvenience.

    #213670

    Mario
    Expired Member
    Post count: 58

    i have a daily backup (really good tip for erveryone) from early morning.
    So i could rebuild the functions.php. Thank you, again 🙂 Thumbs up.

    #213673

    Giri
    Expired Member
    Post count: 3155

    Thank goodness. I feel relieved now 🙂

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

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket