WordPress.org

Ready to get started?Download WordPress

Forums

Moving search box in *CHILD THEME** of Twenty Eleven (9 posts)

  1. mattshepherd
    Member
    Posted 2 years ago #

    **I am already working in a child theme. I do not need to be told how to create or work within a child theme. Thanks!**

    With that out of the way, what in the following do I need to modify to move the search box? I have used display:none on the blog title and subtitle, so the image appears at the top of the screen.

    I have cut and pasted the following from the original Twenty-Eleven stylesheet into the child theme stylesheet:

    [CSS code moderated - a link to your site is enough to access the stylesheets]

    I've tried modifying the values in:

    #branding #searchform

    and

    #branding .only-search #searchform

    and

    #branding .with-image #searchform

    but nothing I change seems to make any difference.

    Here is the site address: http://writing.shep.ca.

    I have tried the advice in this thread:
    http://wordpress.org/support/topic/twenty-eleven-move-search-box?replies=3

    but it does not make any difference.

    What needs to be changed to change the position of the search box?

    Any help appreciated!

  2. mattshepherd
    Member
    Posted 2 years ago #

    I apologize for the overlong code cut-and-paste, which I now know exceeds board regs. If it gets (justifiably) trimmed from this post, the code was the "Search Form" section of style.css for Twenty Eleven in its entirety.

  3. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    **I am already working in a child theme. I do not need to be told how to create or work within a child theme. Thanks!**

    very good ;-)

    where do you want to move the searchform to?

    if you want to move it into the menu bar, try adding this to style.css of your theme:
    #branding #searchform { top: 295px; }

    if the result does not immediately show in the browser, try clearing the browser cache, by pressing 'CTRL F5' for instance.

    (btw: if you use the option dashboard - appearance - header: display text [no] the searchform would automatically get moved into the menu bar)

  4. mattshepherd
    Member
    Posted 2 years ago #

    It’s more an issue with how the site displays on mobile devices such as my iPad, and how it turns up when I switch to a single column with no sidebar -- I'm trying to figure out what to tweak to shift the search box around until I find a happy medium for single-column display and iPad display.

    Does

    #branding #searchform { }

    control its total positioning on the page (i.e. is that the sole line I should need to muck around with to move it around)?

    I'm going to feel pretty stupid if this was a cache issue -- I've been CTRL-R to reload, but haven't forced the cache. I'm going to mess around on my lunch break and see what I can see.

    Thanks!

  5. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    for smaller screens/handheld devices, the 'responsive structure' part in the last third of style.css of Twenty Eleven influences some of the positions.

    you might need to check which of those styles are targeted at the search form.

  6. mattshepherd
    Member
    Posted 2 years ago #

    Aha! That's exactly the sort of thing I need to know. I'll mess around, break things, cry, repair things, and come back if I need a bit more help. For now, I think that's what I need to know to dig into trying to make things act the way I want.

    Thanks again!

  7. msapsard
    Member
    Posted 2 years ago #

    I have had the same problem. Changing the top attribute in the twentyeleven css file as below works:

    #branding #searchform {
    position: absolute;
    top: 3.8em; /* changing to say 2.0em works */
    right: 7.6%;
    text-align: right;
    }

    but it does not work in the child form. How did you fix it?

  8. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    @msapsard

    please post a link to your site.

    without seeing the style.css of the child theme in the context of the theme, there is not much to suggest.

  9. msapsard
    Member
    Posted 2 years ago #

    alchymyth,
    Thanks for the reply. Whilst composing a reply to you, I noticed that the trailing '}' below was missing. The code now works.

    /* import parent css file */
    @import url("../twentyeleven/style.css");

    #branding #searchform {
    position: absolute;
    top: 1em;
    right: 7.6%;
    text-align: right;
    }

Topic Closed

This topic has been closed to new replies.

About this Topic