简体   繁体   English

如何自定义WordPress中的Subscribe2按钮外观?

[英]How to customize Subscribe2 button appearance in WordPress?

I'm very new to WordPress and have no PHP or CSS experience... 我是WordPress的新手,没有PHP或CSS经验...

I'm want to use Subscribe2 plugin in my blog, together with iNove theme. 我想在博客中使用Subscribe2插件以及iNove主题。 When I add the widget, the Subscribe/Unsubscribe buttons are rendered in the "classic" way, which makes the page quite ugly (the blog is at: http://www.adlerr.com ) 当我添加小部件时,“经典”方式呈现了“订阅/取消订阅”按钮,这使得页面非常难看(博客位于: http : //www.adlerr.com

替代文字

How can I customize the appearance of the buttons? 如何自定义按钮的外观? I'm ready to write some PHP/CSS if I get proper instructions... 如果得到正确的说明,我准备编写一些PHP / CSS。

The code outputting the buttons is here: 输出按钮的代码在这里:

$this->form = "<form method=\"post\" action=\"\"><p>" . __('Your email:', 'subscribe2') 
. "<input type=\"text\" name=\"email\" value=\"" . __('Enter email address...', 
'subscribe2') . "\" size=\"20\" onfocus=\"if (this.value == '" . __('Enter email     
address...', 'subscribe2') . "') {this.value = '';}\" onblur=\"if (this.value == '')     
{this.value = '" . __('Enter email address...', 'subscribe2') . "';}\" /></p><p><input 
type=\"submit\" class=\"button\" name=\"subscribe\" value=\"" . __('Subscribe', 
'subscribe2') . "\" />&nbsp;<input type=\"submit\" class=\"button\" name=\"unsubscribe\" 
value=\"" . __('Unsubscribe', 'subscribe2') . "\" /></p></form>\r\n";

And there are buttons will proper stying here : bottom right, the "Submit Comment" button, that is of class "button": 而且有按钮将适当stying 这里 :右下,“提交评论”按钮,即类的“按钮”:

替代文字

The code generating the Submit Comment button is: 生成“提交评论”按钮的代码为:

<input name="submit" type="submit" id="submit" class="button" tabindex="5" 
value="<?php _e('Submit Comment', 'inove'); ?>" />

What should I do to make the Subscribe/Unsubscribe buttons look like the "Submit Comment" button? 如何使“订阅/取消订阅”按钮看起来像“提交评论”按钮?

Your help is much appreciated, thanks. 非常感谢您的帮助。

The difference between the unstyled and styled buttons is that the unstyled buttons don't have an attribute of class="button". 无样式的按钮和有样式的按钮之间的区别在于,无样式的按钮没有class =“ button”属性。

You should be able to log into WP, click plugins, click edit on the Subscribe2 plugin and find where the input type=submit buttons are and add a class="button" to them. 您应该能够登录WP,单击插件,在Subscribe2插件上单击“编辑”,然后找到输入type = submit按钮的位置,然后向其中添加class =“ button”。

<input type="submit" class="button" value="Subscribe" name="subscribe"/>
<input type="submit" class="button" value="Unsubscribe" name="unsubscribe"/>

Edit: In your css file, you will want to create a class called button: 编辑:在您的css文件中,您将要创建一个名为button的类:

.button {
  background-color: #e0ffff;
  color: #ffffff;
}

You'll need to change/add these values to something that suits you. 您需要将这些值更改/添加到适合您的内容中。 You can find out more about css at w3schools . 您可以在w3schools中找到有关CSS的更多信息。 You will probably want to look at background, text, font, and box model. 您可能需要查看背景,文本,字体和框模型。

Alright, I got it this time! 好吧,这次我明白了!

Change line 949 in style.css to this: 将style.css中的949行更改为:

#submitbox #submit, .button {

Change line 960 in style.css to this: 将style.css中的960行更改为:

#submitbox #submit:hover, .button:hover {

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM