{"id":28875,"date":"2013-04-29T07:14:42","date_gmt":"2013-04-29T11:14:42","guid":{"rendered":"http:\/\/www.templatemonster.com\/help\/?p=28875"},"modified":"2016-04-13T06:09:32","modified_gmt":"2016-04-13T10:09:32","slug":"cherry-framework-how-to-add-log-inlog-out-options","status":"publish","type":"post","link":"https:\/\/www.templatemonster.com\/help\/cherry-framework-how-to-add-log-inlog-out-options.html","title":{"rendered":"Cherry Framework 3.x. How to add Log in\/Log out options"},"content":{"rendered":"<p><\/p>\r\n<p>This tutorial shows how to add Log in\/Log out features for WordPress Cherry Framework theme.<\/p>\r\n<p><a href=\"http:\/\/www.youtube.com\/watch?v=Dga3wEqVKhM?width=1280&amp;height=720\" rel=\"prettyPhoto\">Cherry Framework. Adding Log in\/Log out options<\/a><\/p>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2013\/04\/Cherry_FW_-Adding_Log_in_Log_out_options-1.png\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2013\/04\/Cherry_FW_-Adding_Log_in_Log_out_options-1-300x163.png\" alt=\"\" title=\"Cherry_FW_ Adding_Log_in_Log_out_options-1\" width=\"300\" height=\"163\" class=\"alignnone size-medium wp-image-28876\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/04\/Cherry_FW_-Adding_Log_in_Log_out_options-1-300x163.png 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/04\/Cherry_FW_-Adding_Log_in_Log_out_options-1-150x81.png 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/04\/Cherry_FW_-Adding_Log_in_Log_out_options-1.png 800w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\r\n<p>1. Open <strong>options.php<\/strong> file. You can find it in your theme folder. Usually it is called like themeXXXX (XXX are actual theme numbers). Add the following code after custom PHP code (check video version for detailed information):<\/p>\r\n<pre class=\"brush:php\">$options[] = array( \r\n&quot;name&quot; =&gt; &quot;Authentication&quot;,\r\n&quot;id&quot; =&gt; &quot;authentication&quot;,\r\n&quot;type&quot; =&gt; &quot;heading&quot;\r\n);\r\n$options[] = array( &quot;name&quot; =&gt; &quot;Display login links?&quot;,\r\n&quot;desc&quot; =&gt; &quot;Display login links in the header?&quot;,\r\n&quot;id&quot; =&gt; &quot;login_display_id&quot;,\r\n&quot;std&quot; =&gt; &quot;yes&quot;,\r\n&quot;type&quot; =&gt; &quot;radio&quot;,\r\n&quot;options&quot; =&gt; array(\r\n&quot;yes&quot; =&gt; &quot;Yes&quot;,\r\n&quot;no&quot;\t=&gt; &quot;No&quot;));\r\n$options[] = array( &quot;name&quot; =&gt; &quot;Logged-in title&quot;,\r\n&quot;desc&quot; =&gt; &quot;Logged-in title&quot;,\r\n&quot;id&quot; =&gt; &quot;site_admin&quot;,\r\n&quot;std&quot; =&gt; &quot;Site %username%&quot;,\r\n&quot;class&quot; =&gt; &quot;tiny&quot;,\r\n&quot;type&quot; =&gt; &quot;text&quot;);\r\n$options[] = array( &quot;name&quot; =&gt; &quot;&quot;,\r\n  &quot;desc&quot; =&gt; &quot;&quot;,\r\n  &quot;id&quot; =&gt; &quot;log_out&quot;,\r\n  &quot;std&quot; =&gt; &quot;Log out&quot;,\r\n  &quot;class&quot; =&gt; &quot;tiny&quot;,\r\n  &quot;type&quot; =&gt; &quot;text&quot;);\r\n$options[] = array( &quot;name&quot; =&gt; &quot;Register link.&quot;,\r\n  &quot;desc&quot; =&gt; &quot;Register link.&quot;,\r\n  &quot;id&quot; =&gt; &quot;sign_up&quot;,\r\n  &quot;std&quot; =&gt; &quot;Sign up&quot;,\r\n  &quot;class&quot; =&gt; &quot;tiny&quot;,\r\n  &quot;type&quot; =&gt; &quot;text&quot;); \r\n$options[] = array( &quot;name&quot; =&gt; &quot;Logged-out title.&quot;,\r\n  &quot;desc&quot; =&gt; &quot;Logged-out title.&quot;,\r\n  &quot;id&quot; =&gt; &quot;sign_in&quot;,\r\n  &quot;std&quot; =&gt; &quot;Sign in&quot;,\r\n  &quot;class&quot; =&gt; &quot;tiny&quot;,\r\n  &quot;type&quot; =&gt; &quot;text&quot;); \r\n$options[] = array( &quot;name&quot; =&gt; &quot;&quot;,\r\n  &quot;desc&quot; =&gt; &quot;&quot;,\r\n  &quot;id&quot; =&gt; &quot;login_questions&quot;,\r\n  &quot;std&quot; =&gt; &quot;Have an account?&quot;,\r\n  &quot;class&quot; =&gt; &quot;tiny&quot;,\r\n  &quot;type&quot; =&gt; &quot;text&quot;);\r\n$options[] = array( &quot;name&quot; =&gt; &quot;&quot;,\r\n  &quot;desc&quot; =&gt; &quot;&quot;,\r\n  &quot;id&quot; =&gt; &quot;word_delimiter&quot;,\r\n  &quot;std&quot; =&gt; &quot;or&quot;,\r\n  &quot;class&quot; =&gt; &quot;tiny&quot;,\r\n  &quot;type&quot; =&gt; &quot;text&quot;);<\/pre>\r\n<p>2. Code specified above will add <strong>Authentication <\/strong>tab in Cherry Framework <strong>Theme Options<\/strong>. <\/p>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2013\/04\/Cherry_FW_-Adding_Log_in_Log_out_options-2.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2013\/04\/Cherry_FW_-Adding_Log_in_Log_out_options-2-300x46.jpg\" alt=\"\" title=\"Cherry_FW_ Adding_Log_in_Log_out_options-2\" width=\"300\" height=\"46\" class=\"alignnone size-medium wp-image-28877\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/04\/Cherry_FW_-Adding_Log_in_Log_out_options-2-300x46.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/04\/Cherry_FW_-Adding_Log_in_Log_out_options-2-150x23.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/04\/Cherry_FW_-Adding_Log_in_Log_out_options-2.jpg 800w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\r\n<p>3. Open <strong>Authentication <\/strong>tab and click Save.<\/p>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2013\/04\/Cherry_FW_-Adding_Log_in_Log_out_options-3.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2013\/04\/Cherry_FW_-Adding_Log_in_Log_out_options-3-276x300.jpg\" alt=\"\" title=\"[SCM]actwin,0,0,0,0;\" width=\"276\" height=\"300\" class=\"alignnone size-medium wp-image-28878\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/04\/Cherry_FW_-Adding_Log_in_Log_out_options-3-276x300.jpg 276w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/04\/Cherry_FW_-Adding_Log_in_Log_out_options-3-138x150.jpg 138w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/04\/Cherry_FW_-Adding_Log_in_Log_out_options-3.jpg 800w\" sizes=\"(max-width: 276px) 100vw, 276px\" \/><\/a><\/p>\r\n<p>4. Now we need to copy <strong>wrapper-header.php<\/strong> file from <strong>&#8220;wp-content\/themes\/CherryFramework\/wrapper&#8221;<\/strong> folder to wrapper folder of themeXXXX (XXXX are actual theme numbers). Replace the file in case it is available in your template package. Open this file and add the following code:<\/p>\r\n<pre class=\"brush:php\">&lt;div class=&quot;row static-login-out&quot;&gt;\r\n&lt;div class=&quot;span3&quot; data-motopress-type=&quot;static&quot; data-motopress-static-file=&quot;static\/static-login-out.php&quot;&gt;\r\n&lt;?php get_template_part(&quot;static\/static-login-out&quot;); ?&gt;\r\n&lt;\/div&gt;\r\n&lt;\/div&gt;<\/pre>\r\n<p>5. In themeXXXX (XXXX are actual theme numbers) folder you need to create the folder called <strong>static<\/strong> in case it does not exist and add <strong>static-login-out.php<\/strong> file with the following code:<\/p>\r\n<pre class=\"brush:php\">&lt;?php \/* Static Name: Log in - out *\/ ?&gt;\r\n  &lt;div id=&quot;loginout&quot; class=&quot;clearfix&quot;&gt;\r\n&lt;?php\r\nif(of_get_option(&quot;login_display_id&quot;)==&quot;yes&quot;){\r\n$username = get_userdata(get_current_user_id())-&gt;user_login;\r\n$user_title = str_replace(&quot;%username%&quot;, $username, of_get_option(&quot;site_admin&quot;));\r\n$link_string_site = &quot;&lt;a href=\\&quot;&quot;.get_bloginfo('wpurl').&quot;\/wp-admin\/index.php\\&quot; class='register-link' title=\\&quot;&quot;.$user_title.&quot;\\&quot;&gt;&quot;.$user_title.&quot;&lt;\/a&gt;&quot;;\r\n$link_string_logout = '&lt;a href=&quot;'. wp_logout_url($_SERVER['REQUEST_URI']) .'&quot; title=&quot;'.of_get_option(&quot;log_out&quot;).'&quot;&gt;'.of_get_option(&quot;log_out&quot;).'&lt;\/a&gt;';\r\n$link_string_register = &quot;&lt;a href=\\&quot;&quot;.get_bloginfo('wpurl').&quot;\/wp-login.php?action=register&amp;amp;redirect_to=&quot;.$_SERVER['REQUEST_URI'].&quot;\\&quot; class='register-link' title=\\&quot;&quot;.of_get_option(&quot;sign_up&quot;).&quot;\\&quot;&gt;&quot;.of_get_option(&quot;sign_up&quot;).&quot;&lt;\/a&gt;&quot;;\r\n$link_string_login = &quot;&lt;a href=\\&quot;&quot;.get_bloginfo('wpurl').&quot;\/wp-login.php?action=login&amp;amp;redirect_to=&quot;.$_SERVER['REQUEST_URI'].&quot;\\&quot; title=\\&quot;&quot;.of_get_option(&quot;sign_in&quot;).&quot;\\&quot;&gt;&quot;.of_get_option(&quot;sign_in&quot;).&quot;&lt;\/a&gt;&quot;;\r\n if (!is_user_logged_in()) {\r\n  echo &quot;&lt;span&gt;&quot;.of_get_option(&quot;login_questions&quot;).&quot; &quot;.$link_string_login.&quot; &quot;.of_get_option(&quot;word_delimiter&quot;).&quot; &lt;\/span&gt;&quot;;\r\n  echo &quot;&lt;span&gt;&quot;.$link_string_register.&quot;&lt;\/span&gt;&quot;;\r\n  }else{\r\n  echo &quot;&lt;span&gt;&quot;.$link_string_site.&quot; &quot;.of_get_option(&quot;word_delimiter&quot;).&quot; &lt;\/span&gt;&quot;;\r\n  echo &quot;&lt;span&gt;&quot;.$link_string_logout.&quot;&lt;\/span&gt;&quot;;\r\n  }\r\n  }\r\n  ?&gt;\r\n  &lt;\/div&gt;<\/pre>\r\n<p>6. Refresh home page. Your site should look like on the screenshot in case you have performed all actions properly.<\/p>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2013\/04\/Cherry_FW_-Adding_Log_in_Log_out_options-4.png\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2013\/04\/Cherry_FW_-Adding_Log_in_Log_out_options-4-300x154.png\" alt=\"\" title=\"Cherry_FW_ Adding_Log_in_Log_out_options-4\" width=\"300\" height=\"154\" class=\"alignnone size-medium wp-image-28879\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/04\/Cherry_FW_-Adding_Log_in_Log_out_options-4-300x154.png 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/04\/Cherry_FW_-Adding_Log_in_Log_out_options-4-150x77.png 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2013\/04\/Cherry_FW_-Adding_Log_in_Log_out_options-4.png 800w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\r\n<p>Feel free to check the detailed video tutorial below:<\/p>\r\n<p><a href=\"http:\/\/www.youtube.com\/watch?v=Dga3wEqVKhM?width=1280&amp;height=720\" rel=\"prettyPhoto\">Cherry Framework. Adding Log in\/Log out options<\/a><\/p>\r\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to add Log in\/Log out features for WordPress Cherry Framework theme.<\/p>\n","protected":false},"author":39,"featured_media":28880,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[728],"tags":[1158,536,1419,1129,808,1510,1143],"_links":{"self":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/28875"}],"collection":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/users\/39"}],"replies":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/comments?post=28875"}],"version-history":[{"count":0,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/28875\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media\/28880"}],"wp:attachment":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media?parent=28875"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/categories?post=28875"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/tags?post=28875"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}