Further to the above, is there a way to add a custom class?
Hi, I would think JavaScript is the most appropriate way. A oneliner with jQuery should be enough.
Not sure why you want to add a class. You can already target “div#gwolle_gb_write_button input”. Why would you want that?
Thanks Marcel.
The reason I wanted the ability to add a custom class is so I am not trying to override the specificity of the selector.
I already have a class labeled .button, which I wanted to use on the input element. I know I can do this obviously through JS once again, but wanted to know if it was possible without it.
Not a problem though, thanks for the clarification.
Leo
You can always use a filter, like the next part shows. It’s not tested, but should work. It will replace the $old with the $new.
You can place it in functions.php of your theme, or in your own plugin.
Make sure you get the raquo symbol right, it gets mangled here apparently.
<?php
function your_custom_function($form) {
// $form is a string
$old = 'value="» Write a new entry."';
$new = 'value="Anything you fancy."';
$form = str_replace( $old, $new, $form );
return $form;
}
add_filter( 'gwolle_gb_write', 'your_custom_function');
?>
Or alternatively:
<?php
function your_custom_function($form) {
// $form is a string
$old = 'value="» Write a new entry."';
$new = 'value="Anything you fancy." class="my_custom_class"';
$form = str_replace( $old, $new, $form );
return $form;
}
add_filter( 'gwolle_gb_write', 'your_custom_function');
?>
I like that approach, thanks Marcel!
Hi Marcel,
I tried implementing your script above but no changes took effect. I included this in the functions.php file.
Any thoughts?
Thanks,
Leo
It works here.
Make sure you get the string right, the raquo symbol needs to be a html entity, like & raquo; without the space.
Best is, you view soucre in your browser, and cut and paste the string.
Just thought I would report back Marcel. Your last response worked like a charm, thanks again mate!