• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Search magnifying glass coding

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Search magnifying glass coding

This topic is: not resolved

Tagged: dashicons, magnifying glass, search box

  • This topic has 3 replies, 2 voices, and was last updated 11 years, 2 months ago by Annamarie.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • June 7, 2015 at 7:36 am #155188
    Annamarie
    Participant

    Hi

    Clearly something is wrong but I don't know what. I've followed various tutorials on how to get the magnifying glass icon in the search field. As far as I can tell i've done what is called for but no icon! A placeholder, yes. I suspect some conflicts? Don't know enough to know where they might be. And I haven't figured out where to change the box styling (border or text-family).

    Thanks for helping!

    http://test.sharinghousing.com
    June 7, 2015 at 10:47 am #155209
    bgigi
    Member

    Hi again Annamarie

    I looked at your site and tried to compare what I had with you. I see you are showing a S in your search box. I don't have anything else to add but this is the exact code I have in my genesis sample theme, functions.php and style.css, so maybe you can compare them one more time? If it does not resolve the issue I hope someone else can take a look at your specific issue, could be something else going on.

    Functions.php

    --Line 46

    //* Enqueue Dashicons
    add_action( 'wp_enqueue_scripts', 'enqueue_dashicons' );
    function enqueue_dashicons() {
    
    	wp_enqueue_style( 'dashicons' );
    
    }

    --Line 54

    //* Add Dashicon to search form button 
    add_filter( 'genesis_search_button_text', 'wpsites_search_button_icon' );
    function wpsites_search_button_icon( $text ) {
    	return esc_attr( '' );
    }

    Style.css

    --Line 644

    /* ## Search Form
    --------------------------------------------- */
    
    .search-form {
    	overflow: hidden;
    	position: relative;
    }
    
    .site-header .search-form {
    	float: right;
    	margin-top: 12px;
    }
    
    .entry-content .search-form,
    .site-header .search-form {
    	width: 50%;
    }
    
    .search-form input[type="submit"] {
        content: "\f179";
        display: inline-block;
        -webkit-font-smoothing: antialiased;
        font: normal 24px/1 'dashicons';
        vertical-align: top;
        background: #000;
        border: none;
        padding-left: 20px;
    }
     
    
    .search-form input[type="submit"]:hover {
    	color: #F15123;
    }
    June 7, 2015 at 10:55 am #155211
    Annamarie
    Participant

    Thanks!

    I tried replacing my php for yours. We're using different calls for the dashicons. Your code crashed my site. ??
    Go figure.

    I'll hope someone can steer me (us?) right.

    June 7, 2015 at 11:45 am #155240
    Annamarie
    Participant

    I'm getting closer!

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble