A couple questions

This topic contains 13 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 7 years, 6 months ago.

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #10356
    Brett Golding
    Brett Golding
    Participant

    Hi,

    Just purchased your plugin. Great so far but I have just a couple of small issues.

    1. I am having trouble overriding the CSS. Either with an external stylesheet or your inline customizer. I am trying to change the background colour of the search bar. It has saved and updated but the changes do not reflect on the live site.

    2. I have some custom fields associated with a post type that I am using to search through. URL’s and icons that link to social media profiles. You will see on the site a demo of what I had setup previously, under sponsored anglers, setup before using your plugin. Is there a way for me to modify the theme files to include these links still on the front end? Can you point me in the right direction?

    3. The top search on the page I have sent you is displaying WooCommerce results. How do I limit these results to only blog posts and nothing else?

    Thank you very much for your time and keep up the good work.

    Brett.

    #10370
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    1. In some cases you will have to change the input field background as well because it might overlay the whole search bar. You can find it on the Theme Options -> Input field layout panel: https://i.imgur.com/EDHtvJt.png

    2. It might be possible.
    I’ve looked up a support thread where someone was using the social feather plugin, and I was able come up with a solution to include the icons on the front-end results: https://goo.gl/C6yk66

    Other possible resources:
    One is to use a filter to modify the results content to append the extra html code of the icons there. There is a tutorial on how to add WooCommerce add to cart buttons to results, which I believe is a good starting point: https://goo.gl/pVye7e

    Another one is to directly edit the plugin template files. Here is a detailed guide on how to do so: https://wp-dreams.com/knowledge-base/result-templating/

    3. On the General Options -> Sources panel you can select which post types to include. I believe you only need to enable the “Search in posts” option in this case. If the blog posts are in a specific category, you can also set up to include items from only that category on the Advanced Options -> Exclude results panel: https://i.imgur.com/ku0MbUD.png

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #10385
    Brett Golding
    Brett Golding
    Participant

    Thank you for the response. Do you know why in the CSS section when I enter custom CSS code why it is not saving?

    #10386
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    You mean the ajax search pro custom css on the Theme Options -> Custom CSS section?

    I just logged in and tried a random CSS, but it did save for me for some reason. I suspect it might be either maybe a browser plugin or an unknown bug yet.

    Can you try:
    – After copy/pasting the custom CSS, enter one more character and then just delete it. It might trigger the value change event, which I suspect is somehow not working correctly.
    – ..if that doesn’t work, try without browser plugins enabled
    – ..if none of this work, maybe a different browser? (preferably google chrome or mozilla firefox)

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #10387
    Brett Golding
    Brett Golding
    Participant

    Thanks Ernest,

    My external stylesheet seems to be overriding everything ok.

    With regards to my second point. I have studied the post you referred me to and tried testing by adding the following to my functions file…

    add_filter('asp_results', 'asp_social_shortcode', 1, 1); 
    function asp_social_shortcode( $results ) {
      foreach ($results as $k => $r) {
        $r->content .= "<p>Hello World!</p>";
      }
      return $results;
    }

    Unfortunately, it hasn’t done anything.

    I am outputting these custom fields with a loop as seen below.

                    <?php
    
                    //Define your custom post type name in the arguments
                    $args = array('post_type' => 'sponsored_anglers');
    
                    //Define the loop based on arguments
                    $loop = new WP_Query($args);
    
                    //Display the contents
                    while ($loop->have_posts()) : $loop->the_post();
                        $src = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), array(5600, 1000), false, ''); ?>
    
                                <div class="social-icons">
                                    <a target="_blank">"&gt;</a>
                                    <a target="_blank">"&gt;</a>
                                    <a target="_blank">"&gt;</a>
                                    <a target="_blank">"&gt;</a>
                                &lt;/div&gt;
                                
                    &lt;?php endwhile; ?&gt;

    Do you have any idea how to include these fields? They need to be present all of the time. I am preloading results as you can see from my site.

    #10390
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    I believe it’s because as I see the results content display is turned off, therefore the change is not visible. So first of all, you need to make sure it’s turned on. Go to the Layout Options -> Results layout panel and turn on the “Show description in results?” option: https://i.imgur.com/Pj0lnKu.png

    After that, the content should become visible on the front-end.

    In the second code you provided I cannot actually see any custom fields parsed, but I guess you want the social icons HTML part to be appended to the end of the description:

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #10445
    Brett Golding
    Brett Golding
    Participant

    Thanks Ernest for coming back to me.

    If you take a look at my ‘community.php’ page template file. You can see on line 343 onwards how I had set up the Custom Fields and passed in the Social Media URL’s before installing this plugin.

    Basic while loop.

    I have pasted your code into my functions.php file but it has had no effect. When I view the source code I am unable to locate the ‘social-icons’ div.

    What I am trying to achieve here is the social HTML icons under each Angler. However, stored in WordPress are unique URL’s for each Anglers social media feed.

    This is why I was previously using a loop in combination with the ACF plugin. To output the following.

    (see image, this text field is breaking my code)

    Under each Angler there were listed 4 social media icons, and the href for each icon was unique to the custom field inputted inside of that Anglers post in the backend of WordPress.

    I hope this makes more sense.

    • This reply was modified 7 years, 6 months ago by Brett Golding Brett Golding.
    • This reply was modified 7 years, 6 months ago by Brett Golding Brett Golding.
    • This reply was modified 7 years, 6 months ago by Brett Golding Brett Golding.
    Attachments:
    You must be logged in to view attached files.
    #10450
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Oh I see why now, there is one missing “&” sign in the foreach loop code, dang it!

    Additionally, based on your screenshot I’ve constructed a possible solution, including getting the fields and checking if they are empty as well. The “the_field” function would not work in this case, as this is not a classic wordpress posts loop, so each field needs to be parsed separately:

    I actually haven’t tested this code, but I’m almost sure it will place the HTML code into the results.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #10477
    Brett Golding
    Brett Golding
    Participant
    You cannot access this content.
    #10482
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Brett,

    After I turned on the “Show description (content) in results?” option, the code appears to be working , the HTML code is there, but there are no styles applied it so it’s basically invisible: https://i.imgur.com/XuNnlJo.png

    I’ve looked into the style.css file in the theme directory, and the social icon CSS is exclusive to an entry element, so it won’t apply to the search results. I recommend adding these changed rules to the style.css file in the theme directory as well:

    These are more generic rules, will apply to the search result elements as well.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #10509
    Brett Golding
    Brett Golding
    Participant

    Your awesome mate, thank you so much.

    I don’t suppose you know how to disable the links to the actual Angler pages do you? I am only looking to have the social icons clickable.

    Also in the search bars, they all say ‘search posts’. Is there a setting in the admin panel to change this text? I’d like it to say, for example, ‘search anglers’.

    Many Thanks.

    #10523
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    “I don’t suppose you know how to disable the links to the actual Angler pages do you? I am only looking to have the social icons clickable.”
    Actually, I know a very simple javascript trick for that. I suppose you only want the sponsored angler search results affected. In this case:

    Simply put this into the functions.php file in your active theme directory.

    “Also in the search bars, they all say ‘search posts’…”
    It’s possible to change that on the Layout Options panel: https://i.imgur.com/bLBi8xK.png

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #10524
    Brett Golding
    Brett Golding
    Participant

    Ernest thank you so much for your help.

    #10525
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


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

The topic ‘A couple questions’ is closed to new replies.