how do I call this link reference in my genesis meta hook?

Community Forums Forums General Discussion how do I call this link reference in my genesis meta hook?

This topic is: not resolved

Tagged: 

This topic contains 4 replies, has 2 voices, and was last updated by  billmcq 1 year, 4 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #32718

    billmcq
    Participant
    Post count: 28

    I want to call the following in the meta for the homepage only. I have tried function files, enqueque …I cant get it to work/

    I tried this:

    /* —Add for autofill homepage search —*/
    add_action( ‘genesis_meta’, ‘homepage_autofill_quicksearch’ );
    function homepage_autofill_quicksearch() {
    if ( is_home () )
    ? >

    < ? p h p
    }

    and I also tried an enqueue in the functions file but I don't think it was right.. I know I can stick this in the genesis settings section in the header scripts area, but I only want it to be inserted into the meta code on the homepage only. Any help is greatly appreciated!!!
    Bill

    #32722

    billmcq
    Participant
    Post count: 28

    ?>

    <?php

    #32727

    billmcq
    Participant
    Post count: 28

    i cant post the code in the forum, but in between the php there is a <link rel = stylesheet reference

    #32729

    braddalton
    Participant
    Post count: 9194

    Paste the code on Pastebin or Github and link to it from here.

    You may also read FAQ No.5

    You can execute code using any Genesis hook and a conditional tag for the home page in a custom function or using the Genesis Simple hooks plugin but it depends on what code you want to execute.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #32797

    billmcq
    Participant
    Post count: 28

    Thanks for your response. ok getting close, but not quite.

    Using this functions file I am able to call the script and the accompanying css (even though I have not formatted the css yet) for a property search plugin and have it fire only on the homepage. This code enables a property search feature to work, and I am using my search code in a text widget in the footer currently for testing purposes.

    What is supposed to happen is that you start to type the area or neighborhood you want to search, and it will pull up a menu of matches as you are typing the area name or community name. Here it is in action: site

    It works as it is supposed to (meaning it does pull up the community names or area names as you start typing) now, so the enqueue is working, however this search feature is only actually working when used in the footer widget. It does not work for any other widget areas I have on the homepage.

    As you can see by the function code, I am using the genesis_meta as the hook for the insertion of the js script link and accompanying css link, however I notice these link calls are being placed at the bottom of the source code page, not the meta area as I created in the hook.

    Could this be why the feature only works in the footer widget area? Anyone have any suggestions to fix this. Been working on this for a long time, and I am really close! But I need it to work in other widget areas besides the footer!

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

You must be logged in to reply to this topic.