latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Customizing PRo Login Widget

Home Forums Community Forum Customizing PRo Login Widget

This topic contains 6 replies, has 3 voices. Last updated by  Raam Dev 4 years, 1 month ago.

Topic Author Topic
Posted: Saturday Nov 10th, 2012 at 10:20 am #31224
Bruno
Username: brunoedig

Ok this should be fairly simple but I am simply clueless about PHP programming and I need a quick guidance.

I’ve added this

<?php echo s2member_pro_login_widget(); ?>

to a page I want to have the login form, and I’m now looking at this page here http://www.s2member.com/codex/stable/s2member/api_functions/package-functions/#src_doc_s2member_pro_login_widget() because I want to customize some stuff.

So question:

Example: “title” => “Membership Login” Title when NOT logged in, or leave this blank if you’d prefer not to show a title.

Where and how I insert this into that php command? Should it be inside the (), outside? I don’t know how to use variables on a PHP command, but I guess it can’t be that hard.

Any chance to implement options so I can change all these:

“sign up”, “password”, “username”, etc.

I want to write my own text in a different language.

Thanks!

List Of Topic Replies

Viewing 6 replies - 1 through 6 (of 6 total)
Author Replies
Author Replies
Posted: Monday Nov 12th, 2012 at 7:29 am #31287

To give it a custom title, you’d do something like this:

<?php echo s2member_pro_login_widget(array('title' => 'My Custom Title')); ?>

To translate the strings, create this dir/file: /wp-content/mu-plugins/s2hacks.php

<?php

add_filter('gettext_with_context', 's2_translation', 10, 4);
function s2_translation($translated, $original, $context, $domain)
{
	if ($domain === 's2member' && $context === 's2member-front')
		if ($original === 'Original')
			$translated = 'Translated';

	return $translated;
}

Change the original and translated strings to the ones you want. You can do that for each string repeating those two lines in the same hack.

You may find useful information in the Translations forum too: http://www.s2member.com/forums/forum/community/translations/

I hope that helps.

Posted: Monday Nov 12th, 2012 at 2:03 pm #31336
Bruno
Username: brunoedig

I see. Yeah that helps ;)

Thanks a lot!

Posted: Monday Nov 12th, 2012 at 5:46 pm #31366
Bruno
Username: brunoedig

Ahnn that didn’t do.

Code:

<div align="center">
<div style="width: 300px;" align="left">
<p style="text-align: center;"><?php echo s2member_pro_login_widget(array('title' => 'Login para Membros')); ?></p>
</div>
</div>

URL: http://empreendedorefetivo.com.br/ede/membership-options-page

It still says “Membership Login”

What am I missing?

Posted: Tuesday Nov 13th, 2012 at 1:59 am #31414
Raam Dev
Username: Raam
Staff Member

Do you have any caching plugins enabled? Could you try deactivating those and testing the page again?

Also, it shouldn’t matter, but out of curiosity could you try changing the single-quotes to double-quotes and see if that does anything:

<?php echo s2member_pro_login_widget(array("title" => "Login para Membros")); ?>
Posted: Tuesday Nov 13th, 2012 at 12:12 pm #31457
Bruno
Username: brunoedig

Dunno what was wrong before, but now I went to test it again and it worked :)

Thanks a lot guys! Really appreciated!

Posted: Tuesday Nov 13th, 2012 at 7:52 pm #31517
Raam Dev
Username: Raam
Staff Member

Glad to hear it’s working now, Bruno! Thanks for the update. :)

Viewing 6 replies - 1 through 6 (of 6 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.