• Hey, everyone,

    I’m trying to center my Wysija sign-up form on this page:
    http://geekmylife.net/free-ebook-superhero-drinks

    I cannot for the life of me get this centered. The form won’t center when I use the WordPress page editor to center the form and text around it. The text will center, but the form won’t.

    I tried this fix to my theme’s style.css file that others said worked for them to center the submit button (at the very least):

    .form-valid-sub input[type="submit"] {
    	margin-left:auto;
    	margin-right:auto;
    }

    But this didn’t do anything.

    Any suggestions? If you provide me css coding please tell me exactly which file to put it in if you want me to put it in a Wysija stylesheet as opposed to my theme’s style.css file.

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator bcworkz

    (@bcworkz)

    Your link 404s. The directive you tried is the most reliable way to center content that’s not just plain text, so the problem is most likely the selectors you’ve chosen. Have you tried using your browser’s CSS analysis tool? Most are embedded somewhere, with Firefox, install the Firebug plugin.

    Thread Starter breebrouwer

    (@breebrouwer)

    Sorry, hadn’t published the page yet and didn’t remember. 🙁 It should be up now.

    Most of what you just said I have no idea what you’re talking about. I don’t know CSS very well other than editing what’s already in front of me or copying and pasting. Please explain?

    Moderator bcworkz

    (@bcworkz)

    In your theme’s style.css file, there is already a selector (the portion outside of curly braces {} ) .wysija-submit-field where you should add the directive lines

    margin-left:auto;
    margin-right:auto;

    to the other directives inside the curly braces.

    Also add the following selector/directive anywhere (except inside a curly brace block of directives) in the file on their own lines:

    .shortcode_wysija {
      text-align: center;
    }

    Actually, instead of editing your theme’s file, you should create a child theme so your changes are protected from theme updates.

    I’ve illustrated the use of the terms selector and directive, you will also see Rule and Style in their place in some documents. A CSS analysis tool is an advanced feature of most browsers that makes CSS styling much much easier. It makes it easy to identify the correct selectors and experiment with various directives to get the effect you want. If you use Firefox, you need to install the Firebug plugin in order to have access to such a tool. I know Chrome and IE have this tool embedded in the browser by default, I assume Opera and Safari do as well, but have not used them personally.

    If anything is still not clear, ask away.

    Thread Starter breebrouwer

    (@breebrouwer)

    Thanks, bcworkz. (Also, sorry for the late reply – on vacation.)

    I have actually tried this before and it centers everything all the time, which I don’t want it to do. I only want to center the form and submit button on some pages and not others.

    Moderator bcworkz

    (@bcworkz)

    No worries about late replies, it’s not my project that’s not getting fixed 🙂

    For conditional formatting to work, you’ll either need to identify what’s different between pages with centering and those without, ideally different classes so you can simply adjust the CSS. If no such differing classes exist, perhaps one template can be altered to output a different class, if that one template was for only those pages being centered.

    If separate templates do not work, you could insert conditional code on the template that only outputs the centering class if particular conditions are met. The crux is how to identify the correct pages via code. There’s a number of template tags like is_home() and is_archive() that may help. You could even load a bunch of IDs into an array and only output the centering class if the current post ID is in the array.

    As you can imagine, there’s many possibilities for identifying the correct pages that need centering, but without knowing your criteria or the nature of your data, it’s hard to suggest the best approach.

    Thread Starter breebrouwer

    (@breebrouwer)

    @bcworkz, that all sounds far too complicated for my time right now, so maybe what I’ll do is hire someone to do this all for me so I don’t have to worry about it!

    Thanks for ALL your help. I truly appreciate it.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Wysija Newsletters: centering’ is closed to new replies.