{"id":79203,"date":"2018-04-17T21:26:42","date_gmt":"2018-04-17T21:26:42","guid":{"rendered":"https:\/\/br.wordpress.org\/support\/?post_type=topic&#038;p=79203"},"modified":"2018-04-19T00:18:24","modified_gmt":"2018-04-19T00:18:24","slug":"alterar-visualizacao-de-valores-de-produtos","status":"publish","type":"topic","link":"https:\/\/br.wordpress.org\/support\/topic\/alterar-visualizacao-de-valores-de-produtos\/","title":{"rendered":"Alterar visualiza\u00e7\u00e3o de valores de produtos"},"content":{"rendered":"<p>Ol\u00e1 galera da WordPress Brasil,<br \/>\nestou me batendo a algum tempo tentando resolver tal problema e ainda n\u00e3o consegui chegar a um resultado proveitoso.<\/p>\n<p><strong>Descri\u00e7\u00f5es atuais<\/strong><br \/>\nBem, atualmente estou apresentando duas formas de exibi\u00e7\u00e3o do pre\u00e7o em minha home.<br \/>\nExemplo:<br \/>\n<strong>R$ 100,00<\/strong> (Template)<br \/>\n<strong>Em ate: 10x de R$ 10,00<\/strong> (Plugin)<\/p>\n<p><strong>Descri\u00e7\u00e3o do problema<\/strong><br \/>\nGostaria de substituir as informa\u00e7\u00f5es do plugin nas informa\u00e7\u00f5es fixas do template e remover o plugin.<br \/>\nAo acessar o site aqui apresentado, perceba que o valor do plugin n\u00e3o se ajusta ao template como deveria. <\/p>\n<p><strong>Tentativas<\/strong><br \/>\nComo n\u00e3o sou especialista, vou na base da curiosidade fazendo backup e alterando.<\/p>\n<p><strong>1\u00aa<\/strong> ap\u00f3s a instala\u00e7\u00e3o do plugin, deletei a &#8220;class=&#8221;woocommerce-Price-amount amount&#8221;&#8221; respons\u00e1vel pela chamada de tal, mas logo o plugin parou de apresentar os valores;<br \/>\n<strong>2\u00aa<\/strong> tentei fazer a altera\u00e7\u00e3o diretamente no price, atribuindo a uma vari\u00e1vel o valor de &#8220;price&#8221; \/ 10, mas quando consegui chegar no valor de 1 parcela (para depois acrescentar o 10x), os pre\u00e7os influenciaram at\u00e9 no checkout;<br \/>\n<strong>3\u00aa <\/strong>tentei posicionar os valores mais para cima para que n\u00e3o interferisse a intera\u00e7\u00e3o do template, mas foi falho.<\/p>\n<p>Preciso alterar a visualiza\u00e7\u00e3o de todos os produtos para a parcela dividida em 10x sem juros sem que haja altera\u00e7\u00f5es no valor final do checkout.<\/p>\n<p>C\u00d3DIGOS <\/p>\n<p><strong>function.php<\/strong><\/p>\n<pre><code>&lt;?php \nfunction cutom_login_logo() {\necho &quot;&lt;style type=\\&quot;text\/css\\&quot;&gt;\nbody.login div#login h1 a {\nbackground-image: url(&quot;.get_bloginfo(&#039;template_directory&#039;).&quot;\/img\/imgLogin.png);\n-webkit-background-size: auto;\nbackground-size: auto;\nmargin: 0 0 25px;\nwidth: 320px;\n\n}\n&lt;\/style&gt;&quot;;\n}\n\nadd_action( &#039;login_enqueue_scripts&#039;, &#039;cutom_login_logo&#039; );\n\n#-----------------------------------------------------------------#\n# Default theme constants\n#-----------------------------------------------------------------#\ndefine(&#039;NECTAR_FRAMEWORK_DIRECTORY&#039;, get_template_directory_uri() . &#039;\/nectar\/&#039;);\ndefine(&#039;NECTAR_THEME_NAME&#039;, &#039;salient&#039;);\n\n#-----------------------------------------------------------------#\n# Load text domain\n#-----------------------------------------------------------------#\n\nadd_action(&#039;after_setup_theme&#039;, &#039;lang_setup&#039;);\nfunction lang_setup(){\n\t\n\tload_theme_textdomain(NECTAR_THEME_NAME, get_template_directory() . &#039;\/lang&#039;);\n\t\n}\n\n#-----------------------------------------------------------------#\n# Register\/Enqueue JS\n#-----------------------------------------------------------------#\n\n$options = get_nectar_theme_options(); \n$nectar_get_template_directory_uri = get_template_directory_uri();\n\nfunction nectar_register_js() {\t\n\t\n\tglobal $options;\n\tglobal $post;\n\tglobal $nectar_get_template_directory_uri;\n\n\tif (!is_admin()) { \n\t\t\n\t\t\/\/ Register \n\t\twp_register_script(&#039;modernizer&#039;, $nectar_get_template_directory_uri . &#039;\/js\/modernizr.js&#039;, &#039;jquery&#039;, &#039;2.6.2&#039;);\n\t\twp_register_script(&#039;respond&#039;, $nectar_get_template_directory_uri . &#039;\/js\/respond.js&#039;, &#039;jquery&#039;, &#039;1.1&#039;, TRUE);\n\t\twp_register_script(&#039;superfish&#039;, $nectar_get_template_directory_uri . &#039;\/js\/superfish.js&#039;, &#039;jquery&#039;, &#039;1.4.8&#039;, TRUE);\n\t\twp_register_script(&#039;respond&#039;, $nectar_get_template_directory_uri . &#039;\/js\/respond.js&#039;, &#039;jquery&#039;, &#039;1.1&#039;,TRUE);\n\t\twp_register_script(&#039;touchswipe&#039;, $nectar_get_template_directory_uri . &#039;\/js\/touchswipe.min.js&#039;, &#039;jquery&#039;, &#039;1.0&#039;, TRUE);\n\t\twp_register_script(&#039;flexslider&#039;, $nectar_get_template_directory_uri . &#039;\/js\/flexslider.min.js&#039;, array(&#039;jquery&#039;, &#039;touchswipe&#039;), &#039;2.1&#039;, TRUE);\n\t\twp_register_script(&#039;orbit&#039;, $nectar_get_template_directory_uri . &#039;\/js\/orbit.js&#039;, &#039;jquery&#039;, &#039;1.4&#039;, TRUE);\n\t\twp_register_script(&#039;flickity&#039;, $nectar_get_template_directory_uri . &#039;\/js\/flickity.min.js&#039;, &#039;jquery&#039;, &#039;1.1.1&#039;, TRUE);\n\t\twp_register_script(&#039;nicescroll&#039;, $nectar_get_template_directory_uri . &#039;\/js\/nicescroll.js&#039;, &#039;jquery&#039;, &#039;3.5.4&#039; ,TRUE);\n\t\twp_register_script(&#039;sticky&#039;, $nectar_get_template_directory_uri . &#039;\/js\/sticky.js&#039;, &#039;jquery&#039;, &#039;8.0.1&#039;, TRUE);\n\t\twp_register_script(&#039;nectar_prettyPhoto&#039;, $nectar_get_template_directory_uri . &#039;\/js\/prettyPhoto.js&#039;, &#039;jquery&#039;, &#039;7.0.1&#039;, TRUE);\n\t\twp_register_script(&#039;magnific&#039;, $nectar_get_template_directory_uri . &#039;\/js\/magnific.js&#039;, &#039;jquery&#039;, &#039;7.0.1&#039;, TRUE);\n\t\twp_register_script(&#039;nectar_parallax&#039;, $nectar_get_template_directory_uri . &#039;\/js\/parallax.js&#039;, &#039;jquery&#039;, &#039;1.0&#039;, TRUE);\n\t\twp_register_script(&#039;isotope&#039;, $nectar_get_template_directory_uri . &#039;\/js\/isotope.min.js&#039;, &#039;jquery&#039;, &#039;7.6&#039; ,TRUE);\n\t\twp_register_script(&#039;select2&#039;, $nectar_get_template_directory_uri . &#039;\/js\/select2.min.js&#039;, &#039;jquery&#039;, &#039;3.5.2&#039; ,TRUE);\n\t\twp_register_script(&#039;nectarSlider&#039;, $nectar_get_template_directory_uri . &#039;\/js\/nectar-slider.js&#039;, &#039;jquery&#039;, &#039;8.0&#039;, TRUE);\n\t\twp_register_script(&#039;iosSlider&#039;, $nectar_get_template_directory_uri . &#039;\/js\/jquery.iosslider.min.js&#039;, &#039;jquery&#039;, &#039;7.5&#039;, TRUE);\n\t\twp_register_script(&#039;fullPage&#039;, $nectar_get_template_directory_uri . &#039;\/js\/jquery.fullPage.min.js&#039;, &#039;jquery&#039;, &#039;8.0.1&#039;, TRUE);\n\t\twp_register_script(&#039;vivus&#039;, $nectar_get_template_directory_uri . &#039;\/js\/vivus.min.js&#039;, &#039;jquery&#039;, &#039;6.0.1&#039;, TRUE);\n\t\twp_register_script(&#039;nectarParticles&#039;, $nectar_get_template_directory_uri . &#039;\/js\/nectar-particles.js&#039;, &#039;jquery&#039;, &#039;8.0&#039;, TRUE);\n\t\twp_register_script(&#039;ajaxify&#039;, $nectar_get_template_directory_uri . &#039;\/js\/ajaxify.js&#039;, &#039;jquery&#039;, &#039;7.0&#039;, TRUE);\n\t\twp_register_script(&#039;tweenmax&#039;, $nectar_get_template_directory_uri . &#039;\/js\/tweenmax.min.js&#039;, &#039;jquery&#039;, &#039;1.18.0&#039;, TRUE);\n\t\twp_register_script(&#039;caroufredsel&#039;, $nectar_get_template_directory_uri . &#039;\/js\/caroufredsel.min.js&#039;, array(&#039;jquery&#039;, &#039;touchswipe&#039;), &#039;7.0.1&#039;, TRUE);\n\t\twp_register_script(&#039;owl_carousel&#039;, $nectar_get_template_directory_uri . &#039;\/js\/owl.carousel.min.js&#039;, &#039;jquery&#039;, &#039;1.3.3&#039;, TRUE);\n\t\twp_register_script(&#039;midnight&#039;, $nectar_get_template_directory_uri . &#039;\/js\/midnight.js&#039;, &#039;jquery&#039;, &#039;1.0&#039;, TRUE);\n\t\twp_register_script(&#039;twentytwenty&#039;, $nectar_get_template_directory_uri . &#039;\/js\/jquery.twentytwenty.js&#039;, &#039;jquery&#039;, &#039;1.0&#039;, TRUE);\n\n\t\tif ( floatval(get_bloginfo(&#039;version&#039;)) &lt; &quot;3.6&quot; ) {\n\t\t\twp_register_script(&#039;jplayer&#039;, $nectar_get_template_directory_uri . &#039;\/js\/jplayer.min.js&#039;, &#039;jquery&#039;, &#039;2.1&#039;, TRUE);\n\t\t}\n\t\twp_register_script(&#039;nectarFrontend&#039;, $nectar_get_template_directory_uri . &#039;\/js\/init.js&#039;, array(&#039;jquery&#039;, &#039;superfish&#039;), &#039;8.0.1&#039;, TRUE);\n\t\t\n\t\t\/\/ Dequeue\n\t\t$lightbox_script = (!empty($options[&#039;lightbox_script&#039;])) ? $options[&#039;lightbox_script&#039;] : &#039;pretty_photo&#039;;\n\t\t\/\/if($lightbox_script == &#039;pretty_photo&#039;) \n\t\t\twp_dequeue_script( &#039;prettyPhoto&#039; );\n\t\t\n\t\t\n\n\t\t\/\/ Enqueue\n\t\twp_enqueue_script(&#039;jquery&#039;);\n\t\twp_enqueue_script(&#039;modernizer&#039;);\n\n\t\t\/\/\/\/only load for IE8\n\t\tif(preg_match(&#039;\/(?i)msie [2-8]\/&#039;,$_SERVER[&#039;HTTP_USER_AGENT&#039;])) {\n\t\t\twp_enqueue_script(&#039;respond&#039;);\n\t\t}\n\t\t\n\t\t$portfolio_extra_content = (isset($post-&gt;ID)) ? get_post_meta($post-&gt;ID, &#039;_nectar_portfolio_extra_content&#039;, true) : &#039;&#039;;\n\t\t$post_content = (isset($post-&gt;post_content)) ? $post-&gt;post_content : &#039;&#039;;\n\n\t\tif(!empty($options[&#039;smooth-scrolling&#039;]) &amp;&amp; $options[&#039;smooth-scrolling&#039;] == &#039;1&#039;) wp_enqueue_script(&#039;nicescroll&#039;);\n\t\tif(!empty($options[&#039;portfolio_sidebar_follow&#039;]) &amp;&amp; $options[&#039;portfolio_sidebar_follow&#039;] == &#039;1&#039; &amp;&amp; is_singular(&#039;portfolio&#039;) ) wp_enqueue_script(&#039;sticky&#039;); \n\t\t\n\t\tif($lightbox_script == &#039;pretty_photo&#039;)  wp_enqueue_script(&#039;nectar_prettyPhoto&#039;);\n\t\telse if ($lightbox_script == &#039;magnific&#039;) wp_enqueue_script(&#039;magnific&#039;);\n\n\t\tif(stripos( $post_content, &#039;nectar_portfolio&#039;) !== FALSE || stripos( $portfolio_extra_content, &#039;nectar_portfolio&#039;) !== FALSE ||\n\t\t   stripos( $post_content, &#039;nectar_blog&#039;) !== FALSE || stripos( $portfolio_extra_content, &#039;nectar_blog&#039;) !== FALSE || \n\t\t   stripos( $post_content, &#039;vc_gallery type=&quot;image_grid&quot;&#039;) !== FALSE || stripos( $portfolio_extra_content, &#039;vc_gallery type=&quot;image_grid&quot;&#039;) !== FALSE ||\n\t\t   stripos( $post_content, &quot;vc_gallery type=&#039;image_grid&#039;&quot;) !== FALSE || stripos( $portfolio_extra_content, &quot;vc_gallery type=&#039;image_grid&#039;&quot;) !== FALSE ||\n\t\t   stripos( $post_content, &#039;type=&quot;image_grid&quot;&#039;) !== FALSE || stripos( $portfolio_extra_content, &#039;type=&quot;image_grid&quot;&#039;) !== FALSE ||\n\t\t   stripos( $post_content, &quot;type=&#039;image_grid&#039;&quot;) !== FALSE || stripos( $portfolio_extra_content, &quot;type=&#039;image_grid&#039;&quot;) !== FALSE || \n\t\t   is_page_template(&#039;template-portfolio.php&#039;) || is_archive() || is_home() || is_search()) {\n\n\t\t\twp_enqueue_script(&#039;isotope&#039;);\n\t    }\n\n\t    $page_full_screen_rows = (isset($post-&gt;ID)) ? get_post_meta($post-&gt;ID, &#039;_nectar_full_screen_rows&#039;, true) : &#039;&#039;;\n\t    if($page_full_screen_rows == &#039;on&#039;) wp_enqueue_script(&#039;fullPage&#039;);\n\n\t\tif ( floatval(get_bloginfo(&#039;version&#039;)) &lt; &quot;3.6&quot; ) {\n\t\t\twp_enqueue_script(&#039;jplayer&#039;);\n\t\t}\n\t\t\n\t\tif(stripos( $post_content, &#039;[recent_projects&#039;) !== FALSE || stripos( $portfolio_extra_content, &#039;[recent_projects&#039;) !== FALSE\n\t\t|| stripos($post_content, &#039;[carousel&#039;) !== FALSE || stripos( $portfolio_extra_content, &#039;[carousel&#039;) !== FALSE\n\t\t|| stripos($post_content, &#039;carousel=&quot;true&quot;&#039;) !== FALSE || stripos( $portfolio_extra_content, &#039;carousel=&quot;true&quot;&#039;) !== FALSE\n\t\t|| stripos($post_content, &#039;carousel=&quot;1&quot;&#039;) !== FALSE || stripos( $portfolio_extra_content, &#039;carousel=&quot;1&quot;&#039;) !== FALSE\n\t\t|| is_page_template(&#039;template-home-1.php&#039;)) {\n\t\t\twp_enqueue_script(&#039;caroufredsel&#039;);\t\n\t\t}\n\n\t\tif( stripos( $post_content, &#039;script=&quot;owl_carousel&quot;&#039;) !== FALSE || stripos( $portfolio_extra_content, &#039;script=&quot;owl_carousel&quot;&#039;) !== FALSE ) {\n\t\t\twp_enqueue_script(&#039;owl_carousel&#039;);\t\n\t\t}\n\n\t\tif(!empty($options[&#039;header-permanent-transparent&#039;]) &amp;&amp; $options[&#039;header-permanent-transparent&#039;] == &#039;1&#039;) {\n\t\t\twp_enqueue_script(&#039;midnight&#039;);\t\n\t\t}\n\n\t\twp_enqueue_script(&#039;nectarFrontend&#039;);\n\n\t\t$bg_type = (isset($post-&gt;ID)) ? get_post_meta($post-&gt;ID, &#039;_nectar_slider_bg_type&#039;, true) : &#039;&#039;; \n\t\tif(is_singular(&#039;post&#039;) &amp;&amp; (!empty($options[&#039;blog_next_post_link&#039;]) &amp;&amp; $options[&#039;blog_next_post_link&#039;] == &#039;1&#039;) ||\n\t\t   stripos( $post_content, &#039;project_style=&quot;3&quot;&#039;) !== FALSE || stripos( $portfolio_extra_content, &#039;project_style=&quot;3&quot;&#039;) !== FALSE ||\n\t\t   stripos( $post_content, &#039;project_style=&quot;5&quot;&#039;) !== FALSE || stripos( $portfolio_extra_content, &#039;project_style=&quot;5&quot;&#039;) !== FALSE || \n\t\t   stripos( $post_content, &#039;gallery_style=&quot;3&quot;&#039;) !== FALSE || stripos( $portfolio_extra_content, &#039;gallery_style=&quot;3&quot;&#039;) !== FALSE ||\n\t\t   stripos( $post_content, &#039;gallery_style=&quot;5&quot;&#039;) !== FALSE || stripos( $portfolio_extra_content, &#039;gallery_style=&quot;5&quot;&#039;) !== FALSE ||\n\t\t   stripos( $post_content, &quot;project_style=&#039;3&#039;&quot;) !== FALSE || stripos( $portfolio_extra_content, &quot;project_style=&#039;3&#039;&quot;) !== FALSE ||\n\t\t   stripos( $post_content, &quot;project_style=&#039;5&#039;&quot;) !== FALSE || stripos( $portfolio_extra_content, &quot;project_style=&#039;5&#039;&quot;) !== FALSE || \n\t\t   stripos( $post_content, &quot;gallery_style=&#039;3&#039;&quot;) !== FALSE || stripos( $portfolio_extra_content, &quot;gallery_style=&#039;3&#039;&quot;) !== FALSE ||\n\t\t   is_page_template(&#039;template-portfolio.php&#039;) || $bg_type == &#039;particle_bg&#039; || (get_post_type() == &#039;portfolio&#039; &amp;&amp; is_archive()) ) {\n\t\t\twp_enqueue_script(&#039;tweenmax&#039;);\n\t\t}\n\n\t\t$transition_method = (!empty($options[&#039;transition-method&#039;])) ? $options[&#039;transition-method&#039;] : &#039;ajax&#039;;\n\t\tif(!empty($options[&#039;ajax-page-loading&#039;]) &amp;&amp; $options[&#039;ajax-page-loading&#039;] == &#039;1&#039; &amp;&amp; $transition_method == &#039;ajax&#039;) {\n\t\t\twp_enqueue_script(&#039;nectarSlider&#039;);\n\t\t\twp_enqueue_script(&#039;fullPage&#039;);\n\t\t\twp_enqueue_script(&#039;ajaxify&#039;);\n\t\t}\n\t\telse if(!empty($options[&#039;ajax-page-loading&#039;]) &amp;&amp; $options[&#039;ajax-page-loading&#039;] == &#039;1&#039; &amp;&amp; $transition_method == &#039;standard&#039;) {\n\t\t\t\/\/simulated ajax workaround will go here\n\t\t}\n\n\t\t\n\t}\n}\n\nadd_action(&#039;wp_enqueue_scripts&#039;, &#039;nectar_register_js&#039;);\n\nfunction nectar_page_specific_js() {\n\t\n\tglobal $post;\n\tglobal $options;\n\tglobal $nectar_get_template_directory_uri;\n\n\tif(!is_object($post)) $post = (object) array(&#039;post_content&#039;=&gt;&#039; &#039;, &#039;ID&#039; =&gt; &#039; &#039;);\n    $template_name = get_post_meta( $post-&gt;ID, &#039;_wp_page_template&#039;, true );\n\t\n\t\/\/home\n\tif ( is_page_template(&#039;template-home-1.php&#039;) || $template_name == &#039;salient\/template-home-1.php&#039; ||\n\t     is_page_template(&#039;template-home-2.php&#039;) || $template_name == &#039;salient\/template-home-2.php&#039; ||\n\t     is_page_template(&#039;template-home-3.php&#039;) || $template_name == &#039;salient\/template-home-3.php&#039; ||\n\t     is_page_template(&#039;template-home-4.php&#039;) || $template_name == &#039;salient\/template-home-4.php&#039;) {\n\t\twp_enqueue_script(&#039;orbit&#039;);\n\t\twp_enqueue_script(&#039;touchswipe&#039;);\n\t}\n\n\t\/\/\/\/infinite scroll\n\t$portfolio_extra_content = get_post_meta($post-&gt;ID, &#039;_nectar_portfolio_extra_content&#039;, true);\n\t$post_content = $post-&gt;post_content;\n\t$posttype = get_post_type($post);\n\n\tif(stripos( $post-&gt;post_content, &#039;[nectar_blog&#039;) !== FALSE || stripos( $portfolio_extra_content, &#039;[nectar_blog&#039;) !== FALSE\n\t|| stripos( $post-&gt;post_content, &#039;pagination_type=&quot;infinite_scroll&quot;&#039;) !== FALSE || stripos( $portfolio_extra_content, &#039;pagination_type=&quot;infinite_scroll&quot;&#039;) !== FALSE\n\t|| (!empty($options[&#039;blog_pagination_type&#039;]) &amp;&amp; $options[&#039;blog_pagination_type&#039;] == &#039;infinite_scroll&#039;)\n\t|| (!empty($options[&#039;portfolio_pagination_type&#039;]) &amp;&amp; $options[&#039;portfolio_pagination_type&#039;] == &#039;infinite_scroll&#039;)\n\t|| (((is_archive()) || (is_author()) || (is_category()) || (is_home()) || (is_tag())) &amp;&amp; ( $posttype == &#039;post&#039;) &amp;&amp; (!is_singular())) ) {\n\t\t\n\n\t\twp_register_script(&#039;infinite_scroll&#039;, $nectar_get_template_directory_uri . &#039;\/js\/infinitescroll.js&#039;, array(&#039;jquery&#039;), &#039;1.1&#039;, TRUE);\n\n\t\twp_enqueue_script(&#039;infinite_scroll&#039;);\n\t\t\n\t\tif ( floatval(get_bloginfo(&#039;version&#039;)) &gt;= &quot;3.6&quot; ) {\n\t\t\twp_enqueue_script(&#039;wp-mediaelement&#039;);\n\t\t\twp_enqueue_style(&#039;wp-mediaelement&#039;);\n\t\t} \n\t\t\n\t\tif (class_exists(&#039;WPBakeryVisualComposerAbstract&#039;) &amp;&amp; defined( &#039;SALIENT_VC_ACTIVE&#039;)) {\n\t\t\twp_register_script(&#039;progressCircle&#039;, vc_asset_url(&#039;lib\/bower\/progress-circle\/ProgressCircle.min.js&#039;));\n       \t\twp_register_script(&#039;vc_pie&#039;, vc_asset_url(&#039;lib\/vc_chart\/jquery.vc_chart.min.js&#039;), array(&#039;jquery&#039;, &#039;progressCircle&#039;));\n\t\t\t\/\/wp_enqueue_script(&#039;vc_pie&#039;);\n\t\t}\n\n\t\twp_enqueue_script(&#039;flickity&#039;);\t\n\n\t\twp_enqueue_script(&#039;flexslider&#039;);\n\t\t\t\n\t}\n\t\n\t\n\t\/\/nectarSlider \n\tif(stripos( $post_content, &#039;[nectar_slider&#039;) !== FALSE || stripos( $portfolio_extra_content, &#039;[nectar_slider&#039;) !== FALSE\n\t|| stripos($post_content, &#039;type=&quot;nectarslider_style&quot;&#039;) !== FALSE || stripos( $portfolio_extra_content, &#039;type=&quot;nectarslider_style&quot;&#039;) !== FALSE) {\n\t\t\n\t\twp_enqueue_script(&#039;nectarSlider&#039;);\t\n\t}\n\n\t\/\/touch swipe\n\t$box_roll = get_post_meta($post-&gt;ID, &#039;_nectar_header_box_roll&#039;, true); \n\twp_enqueue_script(&#039;touchswipe&#039;);\n\t\n\n\t\/\/flickity\n\tif(stripos($post_content, &#039;[vc_gallery type=&quot;flickity&quot;&#039;) !== FALSE || stripos( $portfolio_extra_content, &#039;[vc_gallery type=&quot;flickity&quot;&#039;) !== FALSE\n\t|| stripos($post_content, &#039;style=&quot;multiple_visible&quot;&#039;) !== FALSE || stripos( $portfolio_extra_content, &#039;style=&quot;multiple_visible&quot;&#039;) !== FALSE\n\t|| stripos($post_content, &#039;style=&quot;multiple_visible_minimal&quot;&#039;) !== FALSE || stripos( $portfolio_extra_content, &#039;style=&quot;multiple_visible_minimal&quot;&#039;) !== FALSE\n\t|| stripos($post_content, &#039;style=&quot;slider&quot;&#039;) !== FALSE || stripos( $portfolio_extra_content, &#039;style=&quot;slider&quot;&#039;) !== FALSE) {\n\t\t\n\t\twp_enqueue_script(&#039;flickity&#039;);\t\n\t}\n\n\t\/\/fancy select\n\t$fancy_rcs = (!empty($options[&#039;form-fancy-select&#039;])) ? $options[&#039;form-fancy-select&#039;] : &#039;default&#039;;\n\tif($fancy_rcs == &#039;1&#039;) {\n\t\twp_enqueue_script(&#039;select2&#039;);\t\t\n\t}\n\t\n\t\/\/svg icon animation\n\tif(strpos($post_content,&#039;.svg&#039;) !== false || strpos($portfolio_extra_content,&#039;.svg&#039;) !== false) {\n\t     wp_enqueue_script(&#039;vivus&#039;); \n\t       \n\t}\n\n\t\/\/comments\n\tif ( is_singular() &amp;&amp; comments_open() &amp;&amp; get_option(&#039;thread_comments&#039;) )\n\twp_enqueue_script(&#039;comment-reply&#039;);\n\t\n}\n\nadd_action(&#039;wp_enqueue_scripts&#039;, &#039;nectar_page_specific_js&#039;); \n\n\/\/Remove wooCommerce prettyPhoto\nglobal $woocommerce;\nif($woocommerce) {\n\t\n\tfunction removeWooPrettyPhoto(){\n\t\twp_dequeue_style( &#039;woocommerce_prettyPhoto_css&#039; );\n\t    wp_dequeue_script( &#039;prettyPhoto-init&#039; );\n\t\twp_dequeue_script( &#039;prettyPhoto&#039; );\n\t}\n\t\n\tadd_action( &#039;wp_enqueue_scripts&#039;, &#039;removeWooPrettyPhoto&#039;, 99 );\n\n}\n\nif (!function_exists(&#039;remove_wp_open_sans&#039;)) :\n    function remove_wp_open_sans() {\n        wp_deregister_style( &#039;open-sans&#039; );\n        wp_register_style( &#039;open-sans&#039;, false );\n    }\n    add_action(&#039;wp_enqueue_scripts&#039;, &#039;remove_wp_open_sans&#039;);\n\nendif;\n\n#-----------------------------------------------------------------#\n# Register\/Enqueue CSS\n#-----------------------------------------------------------------#\n\n\/\/Main Styles\nfunction nectar_main_styles() {\t\n\t\t \n\t\t global $nectar_get_template_directory_uri;\n\n\t\t \/\/ Register \n\t\t wp_register_style(&#039;rgs&#039;, $nectar_get_template_directory_uri . &#039;\/css\/rgs.css&#039;, &#039;&#039;, &#039;8.0&#039;);\n\t\t wp_register_style(&#039;orbit&#039;, $nectar_get_template_directory_uri . &#039;\/css\/orbit.css&#039;);\n\t\t wp_register_style(&#039;twentytwenty&#039;, $nectar_get_template_directory_uri . &#039;\/css\/twentytwenty.css&#039;);\n\t\t wp_register_style(&#039;woocommerce&#039;, $nectar_get_template_directory_uri . &#039;\/css\/woocommerce.css&#039;,&#039;&#039;, &#039;8.0.1&#039;);\n\t\t wp_register_style(&#039;font-awesome&#039;, $nectar_get_template_directory_uri . &#039;\/css\/font-awesome.min.css&#039;, &#039;&#039;, &#039;4.6.3&#039;);\n\t\t wp_register_style(&#039;iconsmind&#039;, $nectar_get_template_directory_uri . &#039;\/css\/iconsmind.css&#039;, &#039;&#039;, &#039;7.6&#039;);\n\t\t wp_register_style(&#039;linea&#039;, $nectar_get_template_directory_uri . &#039;\/css\/fonts\/svg\/font\/arrows_styles.css&#039;);\n\t\t wp_register_style(&#039;fullpage&#039;, $nectar_get_template_directory_uri . &#039;\/css\/fullpage.css&#039;, &#039;&#039;, &#039;8.0&#039;);\n\t\t wp_register_style(&#039;nectarslider&#039;, $nectar_get_template_directory_uri . &#039;\/css\/nectar-slider.css&#039;, &#039;&#039;, &#039;8.0.1&#039;);\n\t\t wp_register_style(&quot;main-styles&quot;, get_stylesheet_directory_uri() . &quot;\/style.css&quot;, &#039;&#039;, &#039;8.0.1&#039;);\n\t\t wp_register_style(&quot;nectar-portfolio&quot;, $nectar_get_template_directory_uri . &quot;\/css\/portfolio.css&quot;, &#039;&#039;, &#039;8.0.1&#039;);\n\t\t wp_register_style(&quot;pretty_photo&quot;, $nectar_get_template_directory_uri . &quot;\/css\/prettyPhoto.css&quot;, &#039;&#039;, &#039;7.0.1&#039;);\n\t\t wp_register_style(&quot;magnific&quot;, $nectar_get_template_directory_uri . &quot;\/css\/magnific.css&quot;, &#039;&#039;, &#039;6.2&#039;);\n\t\t wp_register_style(&quot;responsive&quot;, $nectar_get_template_directory_uri . &quot;\/css\/responsive.css&quot;, &#039;&#039;, &#039;8.0.1&#039;);\n\t\t wp_register_style(&quot;select2&quot;, $nectar_get_template_directory_uri . &quot;\/css\/select2.css&quot;, &#039;&#039;, &#039;6.2&#039;);\n\t\t wp_register_style(&quot;non-responsive&quot;, $nectar_get_template_directory_uri . &quot;\/css\/non-responsive.css&quot;);\n\t\t wp_register_style(&quot;skin-ascend&quot;, $nectar_get_template_directory_uri . &quot;\/css\/ascend.css&quot;, &#039;&#039;, &#039;8.0&#039;);\n\t\t wp_register_style(&quot;box-roll&quot;, $nectar_get_template_directory_uri . &quot;\/css\/box-roll.css&quot;);\n\t\t wp_register_style(&quot;nectar-ie8&quot;, $nectar_get_template_directory_uri . &quot;\/css\/ie8.css&quot;);\n\n\t\t \n\t\t global $options;\n\n\t\t $lightbox_script = (!empty($options[&#039;lightbox_script&#039;])) ? $options[&#039;lightbox_script&#039;] : &#039;pretty_photo&#039;;\n\n\t\t \/\/ Enqueue\n\t\t wp_enqueue_style(&#039;rgs&#039;); \n\t\t wp_enqueue_style(&#039;font-awesome&#039;); \n\t\t wp_enqueue_style(&#039;main-styles&#039;);\n\t\t if($lightbox_script == &#039;pretty_photo&#039;) wp_enqueue_style(&#039;pretty_photo&#039;);\n\t\t else if ($lightbox_script == &#039;magnific&#039;) wp_enqueue_style(&#039;magnific&#039;);\n\t\t wp_enqueue_style(&#039;nectar-ie8&#039;); \n\t\t \n\t\t \/\/responsive\n\t\n\t\t if( !empty($options[&#039;responsive&#039;]) &amp;&amp; $options[&#039;responsive&#039;] == 1 ) { \n\t\t\twp_enqueue_style(&#039;responsive&#039;);\n\t\t } else { \n\t\t\twp_enqueue_style(&#039;non-responsive&#039;);\n\t\t\t\n\t\t\tadd_filter(&#039;body_class&#039;,&#039;salient_non_responsive&#039;);\n\t\t\tfunction salient_non_responsive($classes) {\n\t\t\t\t\/\/ add &#039;class-name&#039; to the $classes array\n\t\t\t\t$classes[] = &#039;salient_non_responsive&#039;;\n\t\t\t\t\/\/ return the $classes array\n\t\t\t\treturn $classes;\n\t\t\t}\n\t\t\t\n\t\t } \n\n\t\t \/\/\/\/Default fonts with extended chars\n\t\t global $options;\n\t\t if(!empty($options[&#039;extended-theme-font&#039;]) &amp;&amp; $options[&#039;extended-theme-font&#039;] != &#039;0&#039;) {\n\t\t\twp_enqueue_style( &quot;options_typography_OpenSans_ext&quot;, &quot;https:\/\/fonts.googleapis.com\/css?family=Open+Sans%3A300%2C400%2C600%2C700&amp;subset=latin%2Clatin-ext&quot;, false, null, &#039;all&#039; );\n\t\t\t\n\t\t }\n\t\t \n\t\t \/\/IE \n\t\t global $wp_styles;\n\t\t $wp_styles-&gt;add_data(&quot;nectar-ie8&quot;, &#039;conditional&#039;, &#039;lt IE 9&#039;);\n\t\t \n\t\t\/\/ajaxify needed \n\t\t$transition_method = (!empty($options[&#039;transition-method&#039;])) ? $options[&#039;transition-method&#039;] : &#039;ajax&#039;;\n\t\tif(!empty($options[&#039;ajax-page-loading&#039;]) &amp;&amp; $options[&#039;ajax-page-loading&#039;] == &#039;1&#039; &amp;&amp; $transition_method == &#039;ajax&#039;) {\n\t\t\twp_enqueue_style(&#039;wp-mediaelement&#039;);\n\t\t\twp_enqueue_style(&#039;fullpage&#039;);\n\t\t\twp_enqueue_style(&#039;nectarslider&#039;);\n\t\t\twp_enqueue_style(&#039;nectar-portfolio&#039;);\n\t\t}\n}\n\nadd_action(&#039;wp_enqueue_scripts&#039;, &#039;nectar_main_styles&#039;);\n\nfunction nectar_page_sepcific_styles() {\n\tglobal $post;\n\tif(!is_object($post)) $post = (object) array(&#039;post_content&#039;=&gt;&#039; &#039;, &#039;ID&#039; =&gt; &#039; &#039;);\n\t$portfolio_extra_content = get_post_meta($post-&gt;ID, &#039;_nectar_portfolio_extra_content&#039;, true);\n\t$post_content = $post-&gt;post_content;\n\n\t\/\/home\n\tif ( is_page_template(&#039;template-home-1.php&#039;) || is_page_template(&#039;template-home-2.php&#039;) || is_page_template(&#039;template-home-3.php&#039;) || is_page_template(&#039;template-home-4.php&#039;)) {\n\t\twp_enqueue_style(&#039;orbit&#039;); \n\t}\n\n\t\/\/full page\n\t$page_full_screen_rows = (isset($post-&gt;ID)) ? get_post_meta($post-&gt;ID, &#039;_nectar_full_screen_rows&#039;, true) : &#039;&#039;;\n\tif($page_full_screen_rows == &#039;on&#039;) wp_enqueue_style(&#039;fullpage&#039;);\n\n\t\/\/nectar slider\n\tif(stripos( $post_content, &#039;[nectar_slider&#039;) !== FALSE || stripos( $portfolio_extra_content, &#039;[nectar_slider&#039;) !== FALSE\n\t|| stripos($post_content, &#039;type=&quot;nectarslider_style&quot;&#039;) !== FALSE || stripos( $portfolio_extra_content, &#039;type=&quot;nectarslider_style&quot;&#039;) !== FALSE) {\n\t\t\n\t\twp_enqueue_style(&#039;nectarslider&#039;);\t\n\t}\n\n\t\/\/portfolio\n\tif(stripos( $post_content, &#039;nectar_portfolio&#039;) !== FALSE || stripos( $portfolio_extra_content, &#039;nectar_portfolio&#039;) !== FALSE ||\n\t   stripos( $post_content, &#039;recent_projects&#039;) !== FALSE || stripos( $portfolio_extra_content, &#039;recent_projects&#039;) !== FALSE ||\n\t   stripos( $post_content, &#039;type=&quot;image_grid&quot;&#039;) !== FALSE || stripos( $portfolio_extra_content, &#039;type=&quot;image_grid&quot;&#039;) !== FALSE ||\n\t   stripos( $post_content, &quot;type=&#039;image_grid&#039;&quot;) !== FALSE || stripos( $portfolio_extra_content, &quot;type=&#039;image_grid&#039;&quot;) !== FALSE || \n\t   is_page_template(&#039;template-portfolio.php&#039;) || is_post_type_archive(&#039;portfolio&#039;) || is_singular(&#039;portfolio&#039;) || is_tax(&#039;project-attributes&#039;) || is_tax(&#039;project-type&#039;)) {\n\n\t\twp_enqueue_style(&#039;nectar-portfolio&#039;);\n    }\n\t\n\t\/\/WooCommerce\n    if ( function_exists( &#039;is_woocommerce&#039; ) ) {\n    \twp_enqueue_style(&#039;woocommerce&#039;); \n\t}\n\n\tif(strpos($post_content,&#039;.svg&#039;) !== false &amp;&amp; strpos($post_content,&#039;icon color=&quot;Extra-Color-Gradient-1&quot;&#039;) !== false || \n\t   strpos($post_content,&#039;.svg&#039;) !== false &amp;&amp; strpos($post_content,&#039;icon color=&quot;Extra-Color-Gradient-2&quot;&#039;) !== false ||\n\t   strpos($post_content,&#039;.svg&#039;) !== false &amp;&amp; strpos($post_content,&quot;icon color=&#039;Extra-Color-Gradient-1&#039;&quot;) !== false ||\n\t   strpos($post_content,&#039;.svg&#039;) !== false &amp;&amp; strpos($post_content,&quot;icon color=&#039;Extra-Color-Gradient-2&#039;&quot;) !== false ||\n\t   strpos($portfolio_extra_content,&#039;.svg&#039;) !== false &amp;&amp; strpos($portfolio_extra_content,&#039;icon color=&quot;Extra-Color-Gradient-1&quot;&#039;) !== false ||\n\t   strpos($portfolio_extra_content,&#039;.svg&#039;) !== false &amp;&amp; strpos($portfolio_extra_content,&#039;icon color=&quot;Extra-Color-Gradient-2&quot;&#039;) !== false ||\n\t   strpos($portfolio_extra_content,&#039;.svg&#039;) !== false &amp;&amp; strpos($portfolio_extra_content,&quot;icon color=&#039;Extra-Color-Gradient-1&#039;&quot;) !== false ||\n\t   strpos($portfolio_extra_content,&#039;.svg&#039;) !== false &amp;&amp; strpos($portfolio_extra_content,&quot;icon color=&#039;Extra-Color-Gradient-2&#039;&quot;) !== false ) {\n\t\twp_enqueue_style(&#039;linea&#039;); \n\t}\n\n\tif(strpos($post_content,&#039;iconsmind-&#039;) !== false ||\n\t   strpos($portfolio_extra_content,&#039;iconsmind-&#039;) !== false) {\n\t\twp_enqueue_style(&#039;iconsmind&#039;); \n\t}\n\n\tglobal $options;\n\t$fancy_rcs = (!empty($options[&#039;form-fancy-select&#039;])) ? $options[&#039;form-fancy-select&#039;] : &#039;default&#039;;\n\tif($fancy_rcs == &#039;1&#039;) {\n\t\twp_enqueue_style(&#039;select2&#039;);\t\t\n\t}\n\n}\n\nadd_action(&#039;wp_enqueue_scripts&#039;, &#039;nectar_page_sepcific_styles&#039;);\n\n$page_transition_bg = (!empty($options[&#039;transition-bg-color&#039;])) ? $options[&#039;transition-bg-color&#039;] : &#039;#ffffff&#039;;\n$page_transition_bg_2 = (!empty($options[&#039;transition-bg-color-2&#039;])) ? $options[&#039;transition-bg-color-2&#039;] : $page_transition_bg;\n$page_transition_effect = (!empty($options[&#039;transition-effect&#039;])) ? $options[&#039;transition-effect&#039;] : &#039;standard&#039;;\n\n$transition_method = (!empty($options[&#039;transition-method&#039;])) ? $options[&#039;transition-method&#039;] : &#039;ajax&#039;;\nfunction nectar_page_transition_bg_fix() {\n\tglobal $page_transition_bg;\n\tglobal $page_transition_bg_2;\n\tglobal $page_transition_effect;\n\n\t\/\/set html bg color to match preloading screen to avoid white flash in chrome\n\tif($page_transition_effect == &#039;horizontal_swipe&#039;) {\n\t\t$css = &quot;html:not(.page-trans-loaded) { background-color: &quot;.$page_transition_bg_2.&quot;; }&quot;;\n\t} else {\n\t\t$css = &quot;html:not(.page-trans-loaded) { background-color: &quot;.$page_transition_bg.&quot;; }&quot;;\n\t}\n\n\twp_add_inline_style( &#039;main-styles&#039;, $css );\n\n}\n\nif(!empty($options[&#039;ajax-page-loading&#039;]) &amp;&amp; $options[&#039;ajax-page-loading&#039;] == &#039;1&#039; &amp;&amp; $transition_method == &#039;standard&#039;) add_action(&#039;wp_enqueue_scripts&#039;, &#039;nectar_page_transition_bg_fix&#039;);\n\n#-----------------------------------------------------------------#\n# Dynamic Styles\n#-----------------------------------------------------------------#\n\nfunction nectar_quick_minify( $css ) {\n\n\t$css = preg_replace( &#039;\/\\s+\/&#039;, &#039; &#039;, $css );\n\t\n\t$css = preg_replace( &#039;\/\\\/\\*[^\\!](.*?)\\*\\\/\/&#039;, &#039;&#039;, $css );\n\t\n\t$css = preg_replace( &#039;\/(,|:|;|\\{|}) \/&#039;, &#039;$1&#039;, $css );\n\t\n\t$css = preg_replace( &#039;\/ (,|;|\\{|})\/&#039;, &#039;$1&#039;, $css );\n\t\n\t$css = preg_replace( &#039;\/(:| )0\\.([0-9]+)(%|em|ex|px|in|cm|mm|pt|pc)\/i&#039;, &#039;${1}.${2}${3}&#039;, $css );\n\t\n\t$css = preg_replace( &#039;\/(:| )(\\.?)0(%|em|ex|px|in|cm|mm|pt|pc)\/i&#039;, &#039;${1}0&#039;, $css );\n\t\n\treturn trim( $css );\n\n}\n\nif (!function_exists(&#039;nectar_colors_css_output&#039;)) {\n\tfunction nectar_colors_css_output(){\n\t\tinclude(&#039;css\/colors.php&#039;);\n\t}\n}\nif (!function_exists(&#039;nectar_custom_css_output&#039;)) {\n\tfunction nectar_custom_css_output(){\n\t\tinclude(&#039;css\/custom.php&#039;);\n\t}\n}\n\nif (!function_exists(&#039;nectar_fonts_output&#039;)) {\n\tfunction nectar_fonts_output(){\n\t\tinclude(&#039;css\/fonts.php&#039;);\n\t}\n}\n\nif (!function_exists(&#039;nectar_page_specific_dynamic&#039;)) {\n\tfunction nectar_page_specific_dynamic(){\n\n\t\t ob_start(); \n\n\t\t echo &#039;&lt;style type=&quot;text\/css&quot;&gt;&#039;;\n\n\t\t \/\/\/\/page header\n\t\t global $post;\n\t\t global $options;\n\n\t\t $font_color = get_post_meta($post-&gt;ID, &#039;_nectar_header_font_color&#039;, true);\n\t\t if(!empty($font_color)) {\n\t\t\t echo &#039;#page-header-bg h1, #page-header-bg .subheader,  .nectar-box-roll .overlaid-content h1, .nectar-box-roll .overlaid-content .subheader, .page-header-no-bg h1, body .section-title #portfolio-nav a:hover i, .page-header-no-bg span, #page-header-bg #portfolio-nav a i, #page-header-bg span { color: &#039;. $font_color .&#039;!important; } &#039;;\n\t\t\t echo &#039;body #page-header-bg a.pinterest-share i, body #page-header-bg a.facebook-share i, body #page-header-bg .twitter-share i, body #page-header-bg .google-plus-share i, \n\t\t \t body #page-header-bg .icon-salient-heart, body #page-header-bg .icon-salient-heart-2 { color: &#039;. $font_color .&#039;; }&#039;;\n\t\t }   echo &#039;body .section-title #portfolio-nav a:hover i { opacity: 0.75; }&#039;;\n\n\t\t$logo_height = (!empty($options[&#039;use-logo&#039;]) &amp;&amp; !empty($options[&#039;logo-height&#039;])) ? intval($options[&#039;logo-height&#039;]) : 30;\n\t\t$header_padding = (!empty($options[&#039;header-padding&#039;])) ? intval($options[&#039;header-padding&#039;]) : 28;\n\t\t$nav_font_size = (!empty($options[&#039;use-custom-fonts&#039;]) &amp;&amp; $options[&#039;use-custom-fonts&#039;] == 1 &amp;&amp; !empty($options[&#039;navigation_font_size&#039;]) &amp;&amp; $options[&#039;navigation_font_size&#039;] != &#039;-&#039;) ? intval(substr($options[&#039;navigation_font_size&#039;],0,-2) *1.4 ) : 20;\n\t\t$dd_indicator_height = (!empty($options[&#039;use-custom-fonts&#039;]) &amp;&amp; $options[&#039;use-custom-fonts&#039;] == 1 &amp;&amp; !empty($options[&#039;navigation_font_size&#039;]) &amp;&amp; $options[&#039;navigation_font_size&#039;] != &#039;-&#039;) ? intval(substr($options[&#039;navigation_font_size&#039;],0,-2)) -1 : 20;\n\t\t\n\t\t$padding_top = ceil(($logo_height\/2)) - ceil(($nav_font_size\/2));\n\t\t$padding_bottom = (ceil(($logo_height\/2)) - ceil(($nav_font_size\/2))) + $header_padding;\n\t\t\n\t\t$search_padding_top = ceil(($logo_height\/2)) - ceil(21\/2) +1;\n\t\t$search_padding_bottom =  (ceil(($logo_height\/2)) - ceil(21\/2));\n\t\t\n\t\t$using_secondary = (!empty($options[&#039;header_layout&#039;])) ? $options[&#039;header_layout&#039;] : &#039; &#039;;\n\t\t\n\t\tif($using_secondary == &#039;header_with_secondary&#039;){\n\t\t \t$header_space = $logo_height + ($header_padding*2) + 34;\n\t\t}\n\t\telse {\n\t\t \t$header_space = $logo_height + ($header_padding*2);\n\t\t}\n\t\t\n\t\t\/\/woo product title\n\t\t$wooSocial = ( !empty($options[&#039;woo_social&#039;]) &amp;&amp; $options[&#039;woo_social&#039;] == 1 ) ? &#039;1&#039; : &#039;0&#039;;\n\t\t$wooSocialCount = 0;\n\t\t$wooProductTitlePadding = 0;\n\t\t\n\t\tif($wooSocial == &#039;1&#039;) {\n\t\t\tif(!empty($options[&#039;woo-facebook-sharing&#039;]) &amp;&amp; $options[&#039;woo-facebook-sharing&#039;] == 1) $wooSocialCount++;\n\t\t\tif(!empty($options[&#039;woo-twitter-sharing&#039;]) &amp;&amp; $options[&#039;woo-twitter-sharing&#039;] == 1) $wooSocialCount++;\n\t\t\tif(!empty($options[&#039;woo-pinterest-sharing&#039;]) &amp;&amp; $options[&#039;woo-pinterest-sharing&#039;] == 1) $wooSocialCount++;\n\t\t\tif(!empty($options[&#039;woo-google-plus-sharing&#039;]) &amp;&amp; $options[&#039;woo-google-plus-sharing&#039;] == 1) $wooSocialCount++;\n\t\t\tif(!empty($options[&#039;woo-linkedin-sharing&#039;]) &amp;&amp; $options[&#039;woo-linkedin-sharing&#039;] == 1) $wooSocialCount++;\n\n\t\t\t$wooProductTitlePadding = ($wooSocialCount*52) + 50;\n\t\t}\n\t\n\n\t\t\/\/hide scrollbar during loading if using fullpage option\n\t\t$page_full_screen_rows = (isset($post-&gt;ID)) ? get_post_meta($post-&gt;ID, &#039;_nectar_full_screen_rows&#039;, true) : &#039;&#039;;\n\t\tif($page_full_screen_rows == &#039;on&#039;) {\n\n\t\t\techo &#039;body,html  { overflow: hidden; height: 100%;}&#039;;\n\t\t}\n\t\t\/\/body border\n\t\t$body_border = (!empty($options[&#039;body-border&#039;])) ? $options[&#039;body-border&#039;] : &#039;off&#039;;\n\t\t$body_border_size = (!empty($options[&#039;body-border-size&#039;])) ? $options[&#039;body-border-size&#039;] : &#039;20&#039;;\n\t\t$body_border_color = (!empty($options[&#039;body-border-color&#039;])) ? $options[&#039;body-border-color&#039;] : &#039;#ffffff&#039;;\n\t\tif($body_border == &#039;1&#039;) {\n\t\t\t\n\t\t\t$headerColorScheme = (!empty($options[&#039;header-color&#039;])) ? $options[&#039;header-color&#039;] : &#039;light&#039;;\n\t\t\t$userSetBG = (!empty($options[&#039;header-background-color&#039;]) &amp;&amp; $headerColorScheme == &#039;custom&#039;) ? $options[&#039;header-background-color&#039;] : &#039;#ffffff&#039;;\n\t\t\t$activate_transparency = using_page_header($post-&gt;ID);\n\n\t\t\tif(empty($options[&#039;transparent-header&#039;]))\n\t\t\t\t$activate_transparency = &#039;false&#039;;\n\n\t\t\techo &#039;@media only screen and (min-width: 690px) { \n\t\t\tbody {padding-bottom: &#039;.$body_border_size.&#039;px; }\n\t\t\t.container-wrap { padding-right: &#039;.$body_border_size.&#039;px; padding-left: &#039;.$body_border_size.&#039;px; padding-bottom: &#039;.$body_border_size.&#039;px;} \n\t\t\t .midnightInner, #footer-outer[data-full-width=&quot;1&quot;] { padding-right: &#039;.$body_border_size.&#039;px; padding-left: &#039;.$body_border_size.&#039;px; }\n\t\t\t #slide-out-widget-area.fullscreen .bottom-text[data-has-desktop-social=&quot;false&quot;], #slide-out-widget-area.fullscreen-alt .bottom-text[data-has-desktop-social=&quot;false&quot;] {bottom: &#039;. intVal($body_border_size + 28) .&#039;px;}\n\t\t\t#header-outer, body #header-outer-bg-only  {box-shadow: none; -webkit-box-shadow: none;} \n\t\t\t .slide-out-hover-icon-effect.small, .slide-out-hover-icon-effect:not(.small) {margin-top: &#039;.$body_border_size.&#039;px; margin-right: &#039;.$body_border_size.&#039;px;}\n\t\t\t #slide-out-widget-area-bg.fullscreen-alt { padding: &#039;.$body_border_size.&#039;px;  }\n\t\t\t #slide-out-widget-area.slide-out-from-right-hover {margin-right: &#039;.$body_border_size.&#039;px;}\n\t\t\t .orbit-wrapper div.slider-nav span.left, .swiper-container .slider-prev { margin-left: &#039;.$body_border_size.&#039;px;} .orbit-wrapper div.slider-nav span.right, .swiper-container .slider-next { margin-right: &#039;.$body_border_size.&#039;px;}\n\t\t\t .admin-bar #slide-out-widget-area-bg.fullscreen-alt { padding-top: &#039;. intval($body_border_size+32) .&#039;px;  }\n\t\t\t #header-outer, body.ascend #search-outer, #header-secondary-outer, #slide-out-widget-area.slide-out-from-right, #slide-out-widget-area.fullscreen .bottom-text { margin-top: &#039;.$body_border_size.&#039;px; padding-right: &#039;.$body_border_size.&#039;px; padding-left: &#039;.$body_border_size.&#039;px; }\n\t\t\t #nectar_fullscreen_rows, body #slide-out-widget-area-bg:not(.fullscreen-alt) { margin-top: &#039;.$body_border_size.&#039;px; }\n\t\t\tbody:not(.ascend) .cart-menu-wrap .cart-menu , #slide-out-widget-area.fullscreen .off-canvas-social-links { padding-right: &#039;.$body_border_size.&#039;px!important; }\n\t\t\t.section-down-arrow, #slide-out-widget-area.fullscreen .off-canvas-social-links, #slide-out-widget-area.fullscreen .bottom-text { padding-bottom: &#039;.$body_border_size.&#039;px; } \n\t\t\t.ascend #search-outer #search #close, body[data-smooth-scrolling=&quot;0&quot;] #header-outer .widget_shopping_cart, #page-header-bg  .pagination-navigation { margin-right:  &#039;.$body_border_size.&#039;px; }\n\t\t\t#to-top { right: &#039;. intval($body_border_size+17) .&#039;px; margin-bottom: &#039;.$body_border_size.&#039;px; }\n\t\t\tbody[data-dropdown-style=&quot;minimal&quot;][data-header-color=&quot;light&quot;] #header-outer:not(.transparent) .sf-menu &gt; li &gt; ul { border-top: none; }\n\t\t\tbody:not(.ascend) #header-outer .cart-menu { background-color: &#039;.$body_border_color.&#039;; border-left: 1px solid rgba(0,0,0,0.1); }\n\t\t\t#fp-nav { padding-right: &#039;.$body_border_size.&#039;px; } .body-border-left {background-color: &#039;.$body_border_color.&#039;; width: &#039;.$body_border_size.&#039;px;} .body-border-right {background-color: &#039;.$body_border_color.&#039;; width: &#039;.$body_border_size.&#039;px;} .body-border-bottom { background-color: &#039;.$body_border_color.&#039;; height: &#039;.$body_border_size.&#039;px;} \n\t\t\t.body-border-top {background-color: &#039;.$body_border_color.&#039;; height: &#039;.$body_border_size.&#039;px;} } @media only screen and (max-width: 690px) { .body-border-right, .body-border-left, .body-border-top, .body-border-bottom { display: none; } }&#039;;\n\t\t\t\n\t\t\tif(($body_border_color == &#039;#ffffff&#039; &amp;&amp; $headerColorScheme == &#039;light&#039; || $headerColorScheme == &#039;custom&#039; &amp;&amp; $body_border_color == $userSetBG ) &amp;&amp; $activate_transparency != &#039;true&#039; ) {\n\t\t\t\techo &#039;#header-outer:not([data-using-secondary=&quot;1&quot;]):not(.transparent),  body.ascend #search-outer, body[data-slide-out-widget-area-style=&quot;fullscreen-alt&quot;] #header-outer:not([data-using-secondary=&quot;1&quot;]) { margin-top: 0!important; } .body-border-top { z-index: 9997; } #slide-out-widget-area.slide-out-from-right { z-index: 9997;} \n\t\t\t\t#nectar_fullscreen_rows, body #slide-out-widget-area-bg { margin-top: 0px!important; }\n\t\t\t\tbody #header-outer, body[data-slide-out-widget-area-style=&quot;slide-out-from-right-hover&quot;] #header-outer { z-index: 9998; }\n\t\t\t\t#header-outer[data-full-width=&quot;true&quot;]:not([data-transparent-header=&quot;true&quot;]) header &gt; .container, #header-outer[data-full-width=&quot;true&quot;][data-transparent-header=&quot;true&quot;].pseudo-data-transparent header &gt; .container { padding-left: 0; padding-right: 0; }\n\t\t\t\t@media only screen and (max-width: 1080px) and (min-width: 1000px) {\n\t\t\t\t\t.ascend[data-slide-out-widget-area=&quot;true&quot;] #header-outer[data-full-width=&quot;true&quot;]:not([data-transparent-header=&quot;true&quot;]) header &gt; .container { padding-left: 0!important; padding-right: 0!important; }\n\t\t\t\t}\n\t\t\t\tbody[data-header-search=&quot;false&quot;][data-slide-out-widget-area=&quot;false&quot;].ascend #header-outer[data-full-width=&quot;true&quot;][data-cart=&quot;true&quot;]:not([data-transparent-header=&quot;true&quot;]) header &gt; .container { padding-right: 28px; }\n\n\t\t\t\tbody:not(.ascend) #header-outer[data-full-width=&quot;true&quot;] header#top nav &gt; ul.product_added.buttons { padding-right: &#039;.intval($body_border_size+80) .&#039;px!important; }\n\n\t\t\t\tbody.ascend[data-slide-out-widget-area=&quot;true&quot;] #header-outer[data-full-width=&quot;true&quot;] .cart-menu-wrap { right: &#039;.intval($body_border_size+51) .&#039;px!important; }\n\n\t\t\t\tbody[data-slide-out-widget-area-style=&quot;slide-out-from-right&quot;] #header-outer[data-header-resize=&quot;0&quot;] {\n\t\t\t\t\t-ms-transition: transform 0.7s cubic-bezier(0.645, 0.045, 0.355, 1), background-color 0.3s cubic-bezier(0.215,0.61,0.355,1), box-shadow 0.40s ease, margin 0.3s cubic-bezier(0.215,0.61,0.355,1)!important;\n\t\t\t\t\t-webkit-transition: -webkit-transform 0.7s cubic-bezier(0.645, 0.045, 0.355, 1), background-color 0.3s cubic-bezier(0.215,0.61,0.355,1), box-shadow 0.40s ease, margin 0.3s cubic-bezier(0.215,0.61,0.355,1)!important;\n\t\t\t\t\ttransition: transform 0.7s cubic-bezier(0.645, 0.045, 0.355, 1), background-color 0.3s cubic-bezier(0.215,0.61,0.355,1), box-shadow 0.40s ease, margin 0.3s cubic-bezier(0.215,0.61,0.355,1)!important;\n\t\t\t\t}\n\n\t\t\t\t@media only screen and (min-width: 690px) { \n\t\t\t\t\tbody div.portfolio-items[data-gutter*=&quot;px&quot;][data-col-num=&quot;elastic&quot;] { padding: 0!important; }\n\t\t\t\t}\n\n\t\t\t\tbody #header-outer[data-transparent-header=&quot;true&quot;].transparent {  transition: none; -webkit-transition: none; }\n\t\t\t\tbody[data-slide-out-widget-area-style=&quot;fullscreen-alt&quot;] #header-outer { transition:  background-color 0.3s cubic-bezier(0.215,0.61,0.355,1); -webkit-transition:  background-color 0.3s cubic-bezier(0.215,0.61,0.355,1); }\n\t\t\t\tbody.ascend[data-slide-out-widget-area=&quot;false&quot;] #header-outer[data-header-resize=&quot;0&quot;][data-cart=&quot;true&quot;]:not(.transparent) { z-index: 100000; }\n\t\t\t\t&#039;;\n\n\t\t\t} else if($body_border_color == &#039;#ffffff&#039; &amp;&amp; $headerColorScheme == &#039;light&#039; || $headerColorScheme == &#039;custom&#039; &amp;&amp; $body_border_color == $userSetBG) {\n\t\t\t\n\t\t\t\techo &#039;#header-outer.small-nav:not(.transparent), #header-outer[data-header-resize=&quot;0&quot;]:not([data-using-secondary=&quot;1&quot;]).scrolled-down:not(.transparent), #header-outer.detached,  body.ascend #search-outer.small-nav, body[data-slide-out-widget-area-style=&quot;slide-out-from-right-hover&quot;] #header-outer:not([data-using-secondary=&quot;1&quot;]):not(.transparent), body[data-slide-out-widget-area-style=&quot;fullscreen-alt&quot;] #header-outer:not([data-using-secondary=&quot;1&quot;]).scrolled-down, body[data-slide-out-widget-area-style=&quot;fullscreen-alt&quot;] #header-outer:not([data-using-secondary=&quot;1&quot;]).transparent.side-widget-open { margin-top: 0px; z-index: 100000; }\n\t\t\t\tbody.ascend[data-slide-out-widget-area=&quot;true&quot;] #header-outer[data-full-width=&quot;true&quot;].transparent:not(.small-nav) .cart-menu-wrap,\n\t\t\t\tbody.ascend[data-slide-out-widget-area=&quot;true&quot;] #header-outer[data-full-width=&quot;true&quot;].scrolled-down .cart-menu-wrap { right: &#039;.intval($body_border_size+80) .&#039;px!important; }\n\t\t\t\tbody.ascend[data-slide-out-widget-area=&quot;true&quot;] #header-outer[data-full-width=&quot;true&quot;] .cart-menu-wrap,\n\t\t\t\tbody.ascend[data-slide-out-widget-area=&quot;false&quot;] #header-outer[data-full-width=&quot;true&quot;][data-cart=&quot;true&quot;] .cart-menu-wrap { transition: right 0.3s cubic-bezier(0.215, 0.61, 0.355, 1); -webkit-transition: all 0.3s cubic-bezier(0.215, 0.61, 0.355, 1); }\n\t\t\t\t.ascend #header-outer.transparent .cart-menu-wrap {width: 130px;}\n\t\t\t\tbody:not(.ascend) #header-outer[data-full-width=&quot;true&quot;] header#top nav &gt; ul.product_added.buttons { padding-right: &#039;.intval($body_border_size+80) .&#039;px!important; }\n\t\t\t\t#header-outer[data-full-width=&quot;true&quot;][data-transparent-header=&quot;true&quot;][data-header-resize=&quot;0&quot;].scrolled-down:not(.transparent) .container,\n\t\t\t\tbody[data-slide-out-widget-area-style=&quot;fullscreen-alt&quot;] #header-outer[data-full-width=&quot;true&quot;].scrolled-down .container,\n\t\t\t\tbody[data-slide-out-widget-area-style=&quot;fullscreen-alt&quot;] #header-outer[data-full-width=&quot;true&quot;].transparent.side-widget-open .container { padding-left: 0!important; padding-right: 0!important; }\n\n\t\t\t\tbody[data-header-search=&quot;false&quot;][data-slide-out-widget-area=&quot;false&quot;].ascend #header-outer[data-full-width=&quot;true&quot;][data-cart=&quot;true&quot;]:not(.transparent) header &gt; .container { padding-right: 28px!important; }\n\t\t\t\tbody.ascend[data-slide-out-widget-area=&quot;false&quot;] #header-outer[data-full-width=&quot;true&quot;][data-cart=&quot;true&quot;].transparent .cart-menu-wrap { right: &#039;.intval($body_border_size) .&#039;px!important; }\n\n\t\t\t\tbody.ascend[data-slide-out-widget-area=&quot;true&quot;]:not([data-slide-out-widget-area-style=&quot;fullscreen&quot;]):not([data-slide-out-widget-area-style=&quot;slide-out-from-right&quot;]) #header-outer[data-full-width=&quot;true&quot;][data-header-resize=&quot;0&quot;].scrolled-down .cart-menu-wrap,\n\t\t\t\tbody.ascend[data-slide-out-widget-area=&quot;true&quot;][data-slide-out-widget-area-style=&quot;fullscreen&quot;] #header-outer[data-full-width=&quot;true&quot;][data-header-resize=&quot;0&quot;].scrolled-down:not(.transparent) .cart-menu-wrap,\n\t\t\t\tbody.ascend[data-slide-out-widget-area=&quot;true&quot;][data-slide-out-widget-area-style=&quot;slide-out-from-right&quot;] #header-outer[data-full-width=&quot;true&quot;][data-header-resize=&quot;0&quot;].scrolled-down:not(.transparent) .cart-menu-wrap,\n\t\t\t\tbody[data-slide-out-widget-area-style=&quot;fullscreen-alt&quot;].ascend #header-outer[data-full-width=&quot;true&quot;].transparent.side-widget-open .cart-menu-wrap { right: &#039;.intval($body_border_size+50) .&#039;px!important; }\n\t\t\t\t\n\t\t\t\t@media only screen and (min-width: 690px) { \n\t\t\t\t\tbody div.portfolio-items[data-gutter*=&quot;px&quot;][data-col-num=&quot;elastic&quot;] { padding: 0!important; }\n\t\t\t\t}\n\t\t\t\t#header-outer[data-full-width=&quot;true&quot;][data-header-resize=&quot;0&quot;].transparent { -ms-transition: transform 0.7s cubic-bezier(0.645, 0.045, 0.355, 1),  background-color 0.3s cubic-bezier(0.215,0.61,0.355,1), margin 0.3s cubic-bezier(0.215,0.61,0.355,1)!important; transition: transform 0.7s cubic-bezier(0.645, 0.045, 0.355, 1),  background-color 0.3s cubic-bezier(0.215,0.61,0.355,1), margin 0.3s cubic-bezier(0.215,0.61,0.355,1)!important; -webkit-transition: -webkit-transform 0.7s cubic-bezier(0.645, 0.045, 0.355, 1),  background-color 0.3s cubic-bezier(0.215,0.61,0.355,1), margin 0.3s cubic-bezier(0.215,0.61,0.355,1)!important; }\n\t\t\t\tbody #header-outer[data-transparent-header=&quot;true&quot;][data-header-resize=&quot;0&quot;] { -ms-transition: transform 0.7s cubic-bezier(0.645, 0.045, 0.355, 1), background-color 0.3s cubic-bezier(0.215,0.61,0.355,1), box-shadow 0.40s ease, margin 0.3s cubic-bezier(0.215,0.61,0.355,1)!important; -webkit-transition: -webkit-transform 0.7s cubic-bezier(0.645, 0.045, 0.355, 1), background-color 0.3s cubic-bezier(0.215,0.61,0.355,1), box-shadow 0.40s ease, margin 0.3s cubic-bezier(0.215,0.61,0.355,1)!important; transition: transform 0.7s cubic-bezier(0.645, 0.045, 0.355, 1), background-color 0.3s cubic-bezier(0.215,0.61,0.355,1), box-shadow 0.40s ease, margin 0.3s cubic-bezier(0.215,0.61,0.355,1)!important; }\n\t\t\t\t#header-outer[data-full-width=&quot;true&quot;][data-header-resize=&quot;0&quot;] header &gt; .container { -ms-transition: padding 0.35s cubic-bezier(0.215,0.61,0.355,1); transition: padding 0.35s cubic-bezier(0.215,0.61,0.355,1); -webkit-transition: padding 0.35s cubic-bezier(0.215,0.61,0.355,1); }\n\t\t\t\t&#039;;\n\n\t\t\t\t$trans_header = (!empty($options[&#039;transparent-header&#039;]) &amp;&amp; $options[&#039;transparent-header&#039;] == &#039;1&#039;) ? $options[&#039;transparent-header&#039;] : &#039;false&#039;;\n\t\t\t\t$bg_header = (!empty($post-&gt;ID) &amp;&amp; $post-&gt;ID != 0) ? using_page_header($post-&gt;ID) : 0;\n\t\t\t\t$perm_trans = (!empty($options[&#039;header-permanent-transparent&#039;]) &amp;&amp; $trans_header != &#039;false&#039; &amp;&amp; $bg_header == &#039;true&#039;) ? $options[&#039;header-permanent-transparent&#039;] : &#039;false&#039;; \n\t\t\t\t\n\t\t\t\tif($perm_trans != &#039;1&#039;) {\n\t\t\t\t\techo &#039;@media only screen and (max-width: 1000px) and (min-width: 690px) { \n\t\t\t\t\t#header-outer,#nectar_fullscreen_rows, body #slide-out-widget-area-bg { margin-top: 0!important; } \n\t\t\t\t\t}&#039;;\n\t\t\t\t}\n\n\t\t\t} else if ($body_border_color != &#039;#ffffff&#039; &amp;&amp; $headerColorScheme == &#039;light&#039; ||  $headerColorScheme == &#039;custom&#039; &amp;&amp; $body_border_color != $userSetBG ) {\n\t\t\t\techo &#039;html body.ascend[data-user-set-ocm=&quot;off&quot;] #header-outer[data-full-width=&quot;true&quot;] .cart-outer[data-user-set-ocm=&quot;off&quot;] .cart-menu-wrap { right: &#039;.intval($body_border_size) .&#039;px!important; }\n\t\t\t\thtml body.ascend[data-user-set-ocm=&quot;1&quot;] #header-outer[data-full-width=&quot;true&quot;] .cart-outer[data-user-set-ocm=&quot;1&quot;] .cart-menu-wrap { right: &#039;.intval($body_border_size+77) .&#039;px!important; }&#039;;\n\t\t\t}\n\n\t\t}\n\n\t\t \/\/\/\/ header transparent option\n\t\tif(!empty($options[&#039;transparent-header&#039;]) &amp;&amp; $options[&#039;transparent-header&#039;] == &#039;1&#039;) {\n\t\t\t\n\t\t\t$starting_color = (empty($options[&#039;header-starting-color&#039;])) ? &#039;#ffffff&#039; : $options[&#039;header-starting-color&#039;];\n\t\t\t$activate_transparency = using_page_header($post-&gt;ID);\n\t\t\t\n\t\t\techo &#039;\n\t\t\t\t\t#header-outer.transparent header#top #logo, #header-outer.transparent header#top #logo:hover {\n\t\t\t\t\t \tcolor: &#039;.$starting_color.&#039;!important;\n\t\t\t\t\t }\n\n\t\t\t\t\t #header-outer.transparent header#top nav &gt; ul &gt; li &gt; a, \n\t\t\t\t\t #header-outer.transparent header#top nav ul #search-btn a span.icon-salient-search, \n\t\t\t\t\t #header-outer.transparent nav &gt; ul &gt; li &gt; a &gt; .sf-sub-indicator [class^=&quot;icon-&quot;], \n\t\t\t\t\t #header-outer.transparent nav &gt; ul &gt; li &gt; a &gt; .sf-sub-indicator [class*=&quot; icon-&quot;],\n\t\t\t\t\t #header-outer.transparent .cart-menu .cart-icon-wrap .icon-salient-cart,\n\t\t\t\t\t .ascend #boxed #header-outer.transparent .cart-menu .cart-icon-wrap .icon-salient-cart\n\t\t\t\t\t  {\n\t\t\t\t\t \tcolor: &#039;.$starting_color.&#039;!important;\n\t\t\t\t\t \topacity: 0.75!important;\n\t\t\t\t\t\ttransition: opacity 0.2s linear, color 0.2s linear;\n\t\t\t\t\t }\n\t\t\t\t\t#header-outer.transparent:not([data-lhe=&quot;animated_underline&quot;]) header#top nav &gt; ul &gt; li &gt; a:hover, #header-outer.transparent:not([data-lhe=&quot;animated_underline&quot;]) header#top nav .sf-menu &gt; li.sfHover &gt; a, #header-outer.transparent:not([data-lhe=&quot;animated_underline&quot;]) header#top nav .sf-menu &gt; li.current_page_ancestor &gt; a, \n\t\t\t\t\t#header-outer.transparent header#top nav .sf-menu &gt; li.current-menu-item &gt; a, #header-outer.transparent:not([data-lhe=&quot;animated_underline&quot;]) header#top nav .sf-menu li.current-menu-item &gt; a, #header-outer.transparent:not([data-lhe=&quot;animated_underline&quot;]) header#top nav .sf-menu &gt; li.current-menu-ancestor &gt; a, #header-outer.transparent:not([data-lhe=&quot;animated_underline&quot;]) header#top nav .sf-menu &gt; li.current_page_item &gt; a,\n\t\t\t\t\t#header-outer.transparent header#top nav &gt; ul &gt; li &gt; a:hover &gt; .sf-sub-indicator &gt; i, #header-outer.transparent header#top nav &gt; ul &gt; li.sfHover &gt; a &gt; span &gt; i, #header-outer.transparent header#top nav ul #search-btn a:hover span, #header-outer.transparent header#top nav ul .slide-out-widget-area-toggle a:hover span,\n\t\t\t\t\t#header-outer.transparent header#top nav .sf-menu &gt; li.current-menu-item &gt; a i, #header-outer.transparent header#top nav .sf-menu &gt; li.current-menu-ancestor &gt; a i,\n\t\t\t\t\t#header-outer.transparent .cart-outer:hover .icon-salient-cart, .ascend #boxed #header-outer.transparent .cart-outer:hover .cart-menu .cart-icon-wrap .icon-salient-cart\n\t\t\t\t\t\n\t\t\t\t\t{\n\t\t\t\t\t\topacity: 1!important;\n\t\t\t\t\t\tcolor: &#039;.$starting_color.&#039;!important;\n\t\t\t\t\t}\n\n\t\t\t\t\t#header-outer.transparent[data-lhe=&quot;animated_underline&quot;] header#top nav &gt; ul &gt; li &gt; a:hover, #header-outer.transparent[data-lhe=&quot;animated_underline&quot;] header#top nav .sf-menu &gt; li.sfHover &gt; a,\n\t\t\t\t\t #header-outer.transparent[data-lhe=&quot;animated_underline&quot;] header#top nav .sf-menu &gt; li.current-menu-ancestor &gt; a, #header-outer.transparent[data-lhe=&quot;animated_underline&quot;] header#top nav .sf-menu &gt; li.current_page_item &gt; a {\n\t\t\t\t\t\topacity: 1!important;\n\t\t\t\t\t}\n\n\t\t\t\t\t#header-outer[data-lhe=&quot;animated_underline&quot;].transparent header#top nav &gt; ul &gt; li &gt; a:after, #header-outer.transparent header#top nav&gt;ul&gt;li.button_bordered&gt;a:before {\n\t\t\t\t\t\tborder-color: &#039;.$starting_color.&#039;!important;\n\t\t\t\t\t}\n\n\t\t\t\t\t#header-outer.transparent:not(.directional-nav-effect) &gt; header#top nav ul .slide-out-widget-area-toggle a i.lines, \n\t\t\t\t\t#header-outer.transparent:not(.directional-nav-effect) &gt; header#top nav ul .slide-out-widget-area-toggle a i.lines:before,\n\t\t\t\t\t#header-outer.transparent:not(.directional-nav-effect) &gt; header#top nav ul .slide-out-widget-area-toggle a i.lines:after,\n\t\t\t\t\t#header-outer.transparent:not(.directional-nav-effect) &gt; header#top nav ul .slide-out-widget-area-toggle[data-icon-animation=&quot;simple-transform&quot;] .lines-button:after,\n\t\t\t\t\t#header-outer.transparent.directional-nav-effect &gt; header#top nav ul .slide-out-widget-area-toggle a span.light .lines-button i, #header-outer.transparent.directional-nav-effect &gt; header#top nav ul .slide-out-widget-area-toggle a span.light .lines-button i:after, #header-outer.transparent.directional-nav-effect &gt; header#top nav ul .slide-out-widget-area-toggle a span.light .lines-button i:before,\n\t\t\t\t\t#header-outer.transparent:not(.directional-nav-effect) .midnightHeader.nectar-slider header#top nav ul .slide-out-widget-area-toggle a i.lines, \n\t\t\t\t\t#header-outer.transparent:not(.directional-nav-effect) .midnightHeader.nectar-slider header#top nav ul .slide-out-widget-area-toggle a i.lines:before,\n\t\t\t\t\t#header-outer.transparent:not(.directional-nav-effect) .midnightHeader.nectar-slider header#top nav ul .slide-out-widget-area-toggle a i.lines:after,\n\t\t\t\t\t#header-outer.transparent.directional-nav-effect .midnightHeader.nectar-slider header#top nav ul .slide-out-widget-area-toggle a span.light .lines-button i, #header-outer.transparent.directional-nav-effect .midnightHeader.nectar-slider header#top nav ul .slide-out-widget-area-toggle a span.light .lines-button i:after, #header-outer.transparent.directional-nav-effect .midnightHeader.nectar-slider header#top nav ul .slide-out-widget-area-toggle a span.light .lines-button i:before  {\n\t\t\t\t\t\tbackground-color: &#039;.$starting_color.&#039;!important;\n\t\t\t\t\t}\n\t\t\t\t\t#header-outer.transparent header#top nav ul .slide-out-widget-area-toggle a i.lines,\n\t\t\t\t\t#header-outer.transparent header#top nav ul .slide-out-widget-area-toggle[data-icon-animation=&quot;simple-transform&quot;] a i.lines-button:after {\n\t\t\t\t\t\topacity: 0.75!important;\n\t\t\t\t\t}\n\t\t\t\t\t#header-outer.transparent.side-widget-open header#top nav ul .slide-out-widget-area-toggle a i.lines,\n\t\t\t\t\t#header-outer.transparent header#top nav ul .slide-out-widget-area-toggle[data-icon-animation=&quot;simple-transform&quot;] a:hover i.lines-button:after, \n\t\t\t\t\t#header-outer.transparent header#top nav ul .slide-out-widget-area-toggle a:hover i.lines, \n\t\t\t\t\t#header-outer.transparent header#top nav ul .slide-out-widget-area-toggle a:hover i.lines:before,\n\t\t\t\t\t#header-outer.transparent header#top nav ul .slide-out-widget-area-toggle a:hover i.lines:after {\n\t\t\t\t\t\topacity: 1!important;\n\t\t\t\t\t}\n\t\t\t&#039;;\n\n\t\t\t$dark_header_color = (!empty($options[&#039;header-transparent-dark-color&#039;])) ? $options[&#039;header-transparent-dark-color&#039;] : &#039;#000000&#039;;\n\n\t\t\techo &#039;#header-outer.transparent.dark-slide &gt; header#top nav &gt; ul &gt; li &gt; a, \n\t\t\t#header-outer.transparent.dark-row &gt; header#top nav &gt; ul &gt; li &gt; a,\n\t\t\t #header-outer.transparent.dark-slide:not(.directional-nav-effect) &gt; header#top nav ul #search-btn a span, \n\t\t\t  #header-outer.transparent.dark-row:not(.directional-nav-effect) &gt; header#top nav ul #search-btn a span, \n\t\t\t #header-outer.transparent.dark-slide &gt; header#top nav &gt; ul &gt; li &gt; a &gt; .sf-sub-indicator [class^=&quot;icon-&quot;], \n\t\t\t #header-outer.transparent.dark-slide &gt; header#top nav &gt; ul &gt; li &gt; a &gt; .sf-sub-indicator [class*=&quot; icon-&quot;],\n\t\t\t  #header-outer.transparent.dark-row &gt; header#top nav &gt; ul &gt; li &gt; a &gt; .sf-sub-indicator [class*=&quot; icon-&quot;],\n\t\t\t #header-outer.transparent.dark-slide:not(.directional-nav-effect) .cart-menu .cart-icon-wrap .icon-salient-cart,\n\t\t\t  #header-outer.transparent.dark-row:not(.directional-nav-effect) .cart-menu .cart-icon-wrap .icon-salient-cart,\n\t\t\t body.ascend[data-header-color=&quot;custom&quot;] #boxed #header-outer.transparent.dark-slide &gt; header#top .cart-outer .cart-menu .cart-icon-wrap i,\n\t\t\t body.ascend #boxed #header-outer.transparent.dark-slide &gt; header#top .cart-outer .cart-menu .cart-icon-wrap i,\n\t\t\t #header-outer.transparent.dark-slide .midnightHeader.nectar-slider header#top nav &gt; ul &gt; li &gt; a, \n\t\t\t #header-outer.transparent.dark-slide:not(.directional-nav-effect) .midnightHeader.nectar-slider header#top nav ul #search-btn a span, \n\t\t\t #header-outer.transparent.dark-slide .midnightHeader.nectar-slider header#top nav &gt; ul &gt; li &gt; a &gt; .sf-sub-indicator [class^=&quot;icon-&quot;], \n\t\t\t #header-outer.transparent.dark-slide .midnightHeader.nectar-slider header#top nav &gt; ul &gt; li &gt; a &gt; .sf-sub-indicator [class*=&quot; icon-&quot;],\n\t\t\t #header-outer.transparent.dark-slide:not(.directional-nav-effect) .midnightHeader.nectar-slider header#top .cart-menu .cart-icon-wrap .icon-salient-cart,\n\t\t\t body.ascend[data-header-color=&quot;custom&quot;] #boxed #header-outer.transparent.dark-slide .midnightHeader.nectar-slider header#top .cart-outer .cart-menu .cart-icon-wrap i,\n\t\t\t body.ascend #boxed #header-outer.transparent.dark-slide .midnightHeader.nectar-slider header#top .cart-outer .cart-menu .cart-icon-wrap i{\n\t\t\t \tcolor: &#039;.$dark_header_color.&#039;!important;\n\t\t\t }\n\n\t\t\t#header-outer.transparent.dark-slide:not(.directional-nav-effect) &gt; header#top nav ul .slide-out-widget-area-toggle a .lines-button i, \n\t\t\t#header-outer.transparent.dark-slide:not(.directional-nav-effect) &gt; header#top nav ul .slide-out-widget-area-toggle a .lines-button i:after,\n\t\t\t#header-outer.transparent.dark-slide:not(.directional-nav-effect) &gt; header#top nav ul .slide-out-widget-area-toggle a .lines-button i:before,\n\t\t\t#header-outer.transparent.dark-slide:not(.directional-nav-effect) .midnightHeader.nectar-slider header#top nav ul .slide-out-widget-area-toggle a .lines-button i, \n\t\t\t#header-outer.transparent.dark-slide:not(.directional-nav-effect) .midnightHeader.nectar-slider header#top nav ul .slide-out-widget-area-toggle a .lines-button i:after,\n\t\t\t#header-outer.transparent.dark-slide:not(.directional-nav-effect) .midnightHeader.nectar-slider header#top nav ul .slide-out-widget-area-toggle a .lines-button i:before,\n\t\t\t#header-outer.transparent.dark-slide:not(.directional-nav-effect) &gt; header#top nav ul .slide-out-widget-area-toggle[data-icon-animation=&quot;simple-transform&quot;] .lines-button:after,\n\t\t\t#header-outer.transparent.dark-slide:not(.directional-nav-effect) .midnightHeader.nectar-slider header#top nav ul .slide-out-widget-area-toggle[data-icon-animation=&quot;simple-transform&quot;] .lines-button:after  {\n\t\t\t\tbackground-color: &#039;.$dark_header_color.&#039;!important;\n\t\t\t}\n\n\t\t\t#header-outer.transparent.dark-slide &gt; header#top nav &gt; ul &gt; li &gt; a:hover, #header-outer.transparent.dark-slide &gt; header#top nav .sf-menu &gt; li.sfHover &gt; a, #header-outer.transparent.dark-slide &gt; header#top nav .sf-menu &gt; li.current_page_ancestor &gt; a, \n\t\t\t#header-outer.transparent.dark-slide &gt; header#top nav .sf-menu &gt; li.current-menu-item &gt; a, #header-outer.transparent.dark-slide &gt; header#top nav .sf-menu &gt; li.current-menu-ancestor &gt; a, #header-outer.transparent.dark-slide &gt; header#top nav .sf-menu &gt; li.current_page_item &gt; a,\n\t\t\t#header-outer.transparent.dark-slide &gt; header#top nav &gt; ul &gt; li &gt; a:hover &gt; .sf-sub-indicator &gt; i, #header-outer.transparent.dark-slide &gt; header#top nav &gt; ul &gt; li.sfHover &gt; a &gt; span &gt; i, #header-outer.transparent.dark-slide &gt; header#top nav ul #search-btn a:hover span,\n\t\t\t#header-outer.transparent.dark-slide &gt; header#top nav .sf-menu &gt; li.current-menu-item &gt; a i, #header-outer.transparent.dark-slide &gt; header#top nav .sf-menu &gt; li.current-menu-ancestor &gt; a i,\n\t\t\t#header-outer.transparent.dark-slide  &gt; header#top .cart-outer:hover .icon-salient-cart,\n\t\t\tbody.ascend[data-header-color=&quot;custom&quot;] #boxed #header-outer.transparent.dark-slide &gt; header#top .cart-outer:hover .cart-menu .cart-icon-wrap i,\n\t\t\t#header-outer.transparent.dark-slide &gt; header#top #logo,\n\t\t\t#header-outer[data-permanent-transparent=&quot;1&quot;].transparent.dark-slide .midnightHeader.nectar-slider header#top .span_9 &gt; .slide-out-widget-area-toggle i,\n\t\t\t#header-outer.transparent:not([data-lhe=&quot;animated_underline&quot;]).dark-slide header#top nav .sf-menu &gt; li.current_page_item &gt; a,\n\t\t\t#header-outer.transparent:not([data-lhe=&quot;animated_underline&quot;]).dark-slide header#top nav .sf-menu &gt; li.current-menu-ancestor &gt; a,\n\t\t\t#header-outer.transparent:not([data-lhe=&quot;animated_underline&quot;]).dark-slide header#top nav &gt; ul &gt; li &gt; a:hover, #header-outer.transparent:not([data-lhe=&quot;animated_underline&quot;]).dark-slide header#top nav .sf-menu &gt; li.sfHover &gt; a,\n\t\t\t#header-outer.transparent.dark-slide .midnightHeader.nectar-slider header#top nav &gt; ul &gt; li &gt; a:hover, #header-outer.transparent.dark-slide .midnightHeader.nectar-slider header#top nav .sf-menu &gt; li.sfHover &gt; a, #header-outer.transparent.dark-slide .midnightHeader.nectar-slider header#top nav .sf-menu &gt; li.current_page_ancestor &gt; a, \n\t\t\t#header-outer.transparent.dark-slide .midnightHeader.nectar-slider header#top nav .sf-menu &gt; li.current-menu-item &gt; a, #header-outer.transparent.dark-slide .midnightHeader.nectar-slider header#top nav .sf-menu &gt; li.current-menu-ancestor &gt; a, #header-outer.transparent.dark-slide .midnightHeader.nectar-slider header#top nav .sf-menu &gt; li.current_page_item &gt; a,\n\t\t\t#header-outer.transparent.dark-slide .midnightHeader.nectar-slider header#top nav &gt; ul &gt; li &gt; a:hover &gt; .sf-sub-indicator &gt; i, #header-outer.transparent.dark-slide header#top nav &gt; ul &gt; li.sfHover &gt; a &gt; span &gt; i, #header-outer.transparent.dark-slide .midnightHeader.nectar-slider header#top nav ul #search-btn a:hover span,\n\t\t\t#header-outer.transparent.dark-slide .midnightHeader.nectar-slider header#top nav .sf-menu &gt; li.current-menu-item &gt; a i, #header-outer.transparent.dark-slide .midnightHeader.nectar-slider header#top nav .sf-menu &gt; li.current-menu-ancestor &gt; a i,\n\t\t\t#header-outer.transparent.dark-slide  .midnightHeader.nectar-slider header#top .cart-outer:hover .icon-salient-cart,\n\t\t\tbody.ascend[data-header-color=&quot;custom&quot;] #boxed #header-outer.transparent.dark-slide &gt; header#top .cart-outer:hover .cart-menu .cart-icon-wrap i,\n\t\t\t#header-outer.transparent.dark-slide .midnightHeader.nectar-slider header#top #logo,\n\t\t\t.swiper-wrapper .swiper-slide[data-color-scheme=&quot;dark&quot;] .slider-down-arrow i.icon-default-style[class^=&quot;icon-&quot;],\n\t\t\t.slider-prev.dark-cs i, .slider-next.dark-cs i, .swiper-container .dark-cs.slider-prev .slide-count span, .swiper-container .dark-cs.slider-next .slide-count span {\n\t\t\t\tcolor: &#039;.$dark_header_color.&#039;!important;\n\t\t\t}\n\t\t\t#header-outer[data-lhe=&quot;animated_underline&quot;].transparent.dark-slide header#top nav &gt; ul &gt; li &gt; a:after,\n\t\t\t#header-outer[data-lhe=&quot;animated_underline&quot;].transparent:not(.side-widget-open) .midnightHeader.dark header#top nav &gt; ul &gt; li &gt; a:after,\n\t\t\t#header-outer[data-lhe=&quot;animated_underline&quot;].transparent:not(.side-widget-open) .midnightHeader.default header#top nav &gt; ul &gt; li &gt; a:after,\n\t\t\t#header-outer.dark-slide.transparent:not(.side-widget-open) header#top nav&gt;ul&gt;li.button_bordered&gt;a:before {\n\t\t\t\tborder-color: &#039;.$dark_header_color.&#039;!important;\n\t\t\t}\n\t\t\t.swiper-container[data-bullet_style=&quot;scale&quot;] .slider-pagination.dark-cs .swiper-pagination-switch.swiper-active-switch i,\n\t\t\t.swiper-container[data-bullet_style=&quot;scale&quot;] .slider-pagination.dark-cs .swiper-pagination-switch:hover i {\n\t\t\t\tbackground-color: &#039;.$dark_header_color.&#039;;\n\t\t\t}\n\n\t\t\t.slider-pagination.dark-cs .swiper-pagination-switch {\n\t\t\t\t border: 1px solid &#039;.$dark_header_color.&#039;;\n\t\t\t\t background-color: transparent;\n\t\t\t}\n\t\t\t.slider-pagination.dark-cs .swiper-pagination-switch:hover {\n\t\t\t\tbackground: none repeat scroll 0 0 &#039;.$dark_header_color.&#039;;\n\t\t\t}\n\n\t\t\t.slider-pagination.dark-cs .swiper-active-switch {\n\t\t\t\t background: none repeat scroll 0 0 &#039;.$dark_header_color.&#039;;\n\t\t\t}\n\t\t\t&#039;;\n\n\t\t     $dark_header_color = str_replace(&quot;#&quot;, &quot;&quot;, $dark_header_color);;\n\t\t\t $darkcolorR = hexdec( substr( $dark_header_color, 0, 2 ) );\n\t\t\t $darkcolorG = hexdec( substr( $dark_header_color, 2, 2 ) );\n\t\t\t $darkcolorB = hexdec( substr( $dark_header_color, 4, 2 ) );\n\t\t\t echo &#039;\n\t\t\t #fp-nav:not(.light-controls) ul li a span:after { background-color: #&#039;.$dark_header_color.&#039;; }\n\t\t\t #fp-nav:not(.light-controls) ul li a span { box-shadow: inset 0 0 0 8px rgba(&#039;.$darkcolorR.&#039;,&#039;.$darkcolorG.&#039;,&#039;.$darkcolorB.&#039;,0.3); -webkit-box-shadow: inset 0 0 0 8px rgba(&#039;.$darkcolorR.&#039;,&#039;.$darkcolorG.&#039;,&#039;.$darkcolorB.&#039;,0.3); }\n\t\t\t body #fp-nav ul li a.active span  { box-shadow: inset 0 0 0 2px rgba(&#039;.$darkcolorR.&#039;,&#039;.$darkcolorG.&#039;,&#039;.$darkcolorB.&#039;,0.8); -webkit-box-shadow: inset 0 0 0 2px rgba(&#039;.$darkcolorR.&#039;,&#039;.$darkcolorG.&#039;,&#039;.$darkcolorB.&#039;,0.8); }&#039;;\n\n\t\t\tif($activate_transparency){\n\t\t\t\t\n\t\t\t\t\/\/old IE versions\n\t\t\t\techo &#039;.no-rgba #header-space { display: none;  } &#039;;\n\t\t\t\t\n\t\t\t\techo &#039;@media only screen and (min-width: 1000px) {\n\t\t\t\t\t\n\t\t\t\t\t #header-space {\n\t\t\t\t\t \t display: none; \n\t\t\t\t\t } \n\t\t\t\t\t .nectar-slider-wrap.first-section, .parallax_slider_outer.first-section, .full-width-content.first-section, \n\t\t\t\t\t .parallax_slider_outer.first-section .swiper-slide .content, .nectar-slider-wrap.first-section .swiper-slide .content, #page-header-bg, .nder-page-header, #page-header-wrap,\n\t\t\t\t\t .full-width-section.first-section {\n\t\t\t\t\t \t margin-top: 0!important;\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t body #page-header-bg, body #page-header-wrap {\n\t\t\t\t\t \theight: &#039;.$header_space.&#039;px;\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t .swiper-container .slider-prev, .swiper-container .slider-next {\n\t\t\t\t\t \ttop: 52%!important;\t\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t .first-section .nectar-slider-loading .loading-icon { opacity: 0 }\n\t\t\t\t\t \n\t\t\t\t\t body #search-outer { z-index: 100000; }\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t}&#039;;\n\t\t\t} else if(!empty($options[&#039;header-bg-opacity&#039;])) {\n\t\t\t\t$header_space_bg_color = (!empty($options[&#039;overall-bg-color&#039;])) ? $options[&#039;overall-bg-color&#039;] : &#039;#ffffff&#039;;\n\t\t\t\techo &#039;#header-space { background-color: &#039;.$header_space_bg_color.&#039;}&#039;;\n\t\t\t}\n\n\t\t}\n\n\t\techo &#039;.pagination-navigation { -webkit-filter: url(&quot;&#039;.esc_url(get_permalink()).&#039;#goo&quot;); filter: url(&quot;&#039;.esc_url(get_permalink()).&#039;#goo&quot;); }&#039;;\n\n\t\tglobal $woocommerce;\n\n\t\tif($woocommerce &amp;&amp; $woocommerce-&gt;cart-&gt;cart_contents_count &gt; 0 &amp;&amp; !empty($options[&#039;enable-cart&#039;]) &amp;&amp; $options[&#039;enable-cart&#039;] == &#039;1&#039; &amp;&amp; !empty($options[&#039;header-fullwidth&#039;]) &amp;&amp; $options[&#039;header-fullwidth&#039;] == &#039;1&#039;) {\n\t\t\techo &#039;@media only screen and (min-width: 1080px) {\n\t\t\t\t#header-outer[data-full-width=&quot;true&quot;] header#top nav &gt; ul.product_added.buttons {\n\t\t\t \t padding-right: 80px!important; \n\t\t        }\n\t\t        body:not(.ascend) #header-outer[data-full-width=&quot;true&quot;][data-remove-border=&quot;true&quot;].transparent header#top nav &gt; ul.product_added .slide-out-widget-area-toggle,\n\t\t        body:not(.ascend) #header-outer[data-full-width=&quot;true&quot;][data-remove-border=&quot;true&quot;].side-widget-open header#top nav &gt; ul.product_added .slide-out-widget-area-toggle {\n\t\t          margin-right: -20px!important; \n\t\t    \t}\n\t\t    }&#039;;\n\t\t} elseif($woocommerce &amp;&amp; !empty($options[&#039;enable-cart&#039;]) &amp;&amp; $options[&#039;enable-cart&#039;] == &#039;1&#039; &amp;&amp; !empty($options[&#039;header-fullwidth&#039;]) &amp;&amp; $options[&#039;header-fullwidth&#039;] == &#039;1&#039;) {\n\t\t\techo &#039;@media only screen and (min-width: 1080px) {\n\t\t\t\t#header-outer[data-full-width=&quot;true&quot;] header#top nav &gt; ul.product_added.buttons {\n\t\t\t \t padding-right: 80px!important; \n\t\t        }\n\t\t        body:not(.ascend) #header-outer[data-full-width=&quot;true&quot;][data-remove-border=&quot;true&quot;].transparent header#top nav &gt; ul.product_added .slide-out-widget-area-toggle,\n\t\t        body:not(.ascend) #header-outer[data-full-width=&quot;true&quot;][data-remove-border=&quot;true&quot;].side-widget-open header#top nav &gt; ul.product_added .slide-out-widget-area-toggle {\n\t\t          margin-right: -20px!important; \n\t\t    \t}\n\t\t    }&#039;;\n\t\t}\n\n\t\tif($woocommerce &amp;&amp; !empty($options[&#039;product_archive_bg_color&#039;])) {\n\t\t\techo &#039;.post-type-archive-product.woocommerce .container-wrap, .tax-product_cat.woocommerce .container-wrap { background-color: &#039;.$options[&#039;product_archive_bg_color&#039;].&#039;; } &#039;;\n\t\t}\n\n\t\tif($woocommerce &amp;&amp; !empty($options[&#039;product_bg_color&#039;])) {\n\t\t \techo &#039;.woocommerce ul.products li.product.material, .woocommerce-page ul.products li.product.material { background-color: &#039;.$options[&#039;product_bg_color&#039;].&#039;; }&#039;;\n\t\t}\n\n\t\tif($woocommerce &amp;&amp; !empty($options[&#039;product_tab_position&#039;]) &amp;&amp; $options[&#039;product_tab_position&#039;] == &#039;fullwidth&#039;) echo &#039;\n\t\t .woocommerce.single-product #single-meta { position: relative!important; top: 0!important; margin: 0; left: 8px; height: auto; } \n\t\t .woocommerce.single-product #single-meta:after { display: block; content: &quot; &quot;; clear: both; height: 1px;  } \n\t\t .woocommerce-tabs { margin-top: 40px; clear: both; }\n\t\t @media only screen and (min-width: 1000px) {\n\t\t\t .woocommerce #reviews #comments, .woocommerce #reviews #review_form_wrapper {  float: left; width: 47%; }\n\t\t\t .woocommerce #reviews #comments { margin-right: 3%; width: 50%; } \n\t\t\t .ascend.woocommerce #respond { margin-top: 0px!important; }\n\t\t\t .rtl.woocommerce #reviews #comments, .woocommerce #reviews #review_form_wrapper {  float: right;}\n\t\t\t .rtl.woocommerce #reviews #comments { margin-left: 3%; margin-right: 0;}\n\t\t\t .woocommerce .woocommerce-tabs &gt; div { margin-top: 15px!important; }\n\t\t\t .woocommerce #reviews #reply-title { margin-top: 5px!important; }\n\t\t }&#039;;\n\n\t\tif($woocommerce &amp;&amp; $woocommerce-&gt;cart-&gt;cart_contents_count &gt; 0 &amp;&amp; !empty($options[&#039;enable-cart&#039;]) &amp;&amp; $options[&#039;enable-cart&#039;] == &#039;1&#039;) {\n\t\t\techo &#039;@media only screen and (min-width: 1080px) and (max-width: 1475px) {\n\t\t\t    header#top nav &gt; ul.buttons {\n\t\t\t\t  padding-right: 20px!important; \n\t\t\t    } \n\t\t\t\t#boxed header#top nav &gt; ul.product_added.buttons {\n\t\t\t\t\tpadding-right: 0px!important; \n\t\t\t\t}\n\t\t\t\t#search-outer #search #close a {\n\t\t\t\t\tright: 110px;\n\t\t\t\t}\n\t\t\t }&#039;;\n\t\t}\n\t\telseif($woocommerce &amp;&amp; !empty($options[&#039;enable-cart&#039;]) &amp;&amp; $options[&#039;enable-cart&#039;] == &#039;1&#039;) {\n\t\t\techo &#039;@media only screen and (min-width: 1080px) and (max-width: 1475px) {\n\t\t\t    header#top nav &gt; ul.product_added {\n\t\t\t\t  padding-right: 20px!important; \n\t\t\t    } \n\t\t\t\t#boxed header#top nav &gt; ul.product_added.buttons {\n\t\t\t\t\tpadding-right: 0px!important; \n\t\t\t\t}\n\t\t\t\t#search-outer #search #close a.product_added {\n\t\t\t\t\tright: 110px;\n\t\t\t\t}\n\t\t\t }&#039;;\n\t\t }\n\n\t\t \/\/boxed css\n\t\tif(!empty($options[&#039;boxed_layout&#039;]) &amp;&amp; $options[&#039;boxed_layout&#039;] == &#039;1&#039;)  {\n\t\t\t\n\t\t\t$attachment = $options[&quot;background-attachment&quot;];\n\t\t\t$position = $options[&quot;background-position&quot;];\n\t\t\t$repeat = $options[&quot;background-repeat&quot;];\n\t\t\t$background_color = $options[&quot;background-color&quot;];\n\t\t\t\n\t\t\techo &#039;body {\n\t\t\t \tbackground-image: url(&quot;&#039;.nectar_options_img($options[&quot;background_image&quot;]).&#039;&quot;);\n\t\t\t\tbackground-position: &#039;.$position.&#039;;\n\t\t\t\tbackground-repeat: &#039;.$repeat.&#039;;\n\t\t\t\tbackground-color: &#039;.$background_color.&#039;!important;\n\t\t\t\tbackground-attachment: &#039;.$attachment.&#039;;&#039;;\n\t\t\t\tif(!empty($options[&quot;background-cover&quot;]) &amp;&amp; $options[&quot;background-cover&quot;] == &#039;1&#039;) {\n\t\t\t\t\techo &#039;background-size: cover;\n\t\t\t\t\t-moz-background-size: cover;\n\t\t\t\t\t-webkit-background-size: cover;\n\t\t\t\t\t-o-background-size: cover;&#039;;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t echo &#039;}&#039;;\n\t\t}\n\n\t\t\/\/blog next post coloring\n\t\tif(is_singular(&#039;post&#039;)){\n\n\t\t\t$next_post = get_previous_post();\n\t\t\tif (!empty( $next_post )) {\n\t\t\t\t$blog_next_bg_color = get_post_meta($next_post-&gt;ID, &#039;_nectar_header_bg_color&#039;, true);\n\t\t\t\t$blog_next_font_color = get_post_meta($next_post-&gt;ID, &#039;_nectar_header_font_color&#039;, true);\n\t\t\t\tif(!empty($blog_next_font_color)){\n\t\t\t\t\techo &#039;.blog_next_prev_buttons .col h3, .blog_next_prev_buttons span {  \n\t\t\t\t\t\tcolor: &#039;.$blog_next_font_color.&#039;;\n\t\t\t\t\t}&#039;;\n\t\t\t\t}\n\t\t\t\tif(!empty($blog_next_bg_color)){\n\t\t\t\t\techo &#039;.blog_next_prev_buttons {  \n\t\t\t\t\t\tbackground-color: &#039;.$blog_next_bg_color.&#039;;\n\t\t\t\t\t}&#039;;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\techo &#039;&lt;\/style&gt;&#039;;\n\n\t\t$dynamic_css = ob_get_contents();\n\t\tob_end_clean();\n\n\t\techo nectar_quick_minify($dynamic_css);\t\n\n\t}\n}\n\nfunction generate_options_css() {\n\n\t$options = get_nectar_theme_options(); \n\n\tif(!empty($options[&#039;external-dynamic-css&#039;]) &amp;&amp; $options[&#039;external-dynamic-css&#039;] == 1){\n\n\t\t$css_dir = get_stylesheet_directory() . &#039;\/css\/&#039;; \/\/ Shorten code, save 1 call\n\t\tob_start(); \/\/ Capture all output (output buffering)\n\n\t\t\/\/include css\n\t\tnectar_colors_css_output();\n\t\tnectar_custom_css_output();\n\t\t\/\/if(!empty($options[&#039;use-custom-fonts&#039;]) &amp;&amp; $options[&#039;use-custom-fonts&#039;] == 1){\n\t\tnectar_fonts_output();\n\t\t\/\/}\n\n\t\t$css = ob_get_clean(); \/\/ Get generated CSS (output buffering)\n\t\tfile_put_contents($css_dir . &#039;dynamic-combined.css&#039;, $css, LOCK_EX); \/\/ Save it\n\t\t\n\t}\n}\n\nfunction nectar_enqueue_dynamic_css() {\n\twp_register_style(&#039;dynamic-css&#039;, get_stylesheet_directory_uri() . &#039;\/css\/dynamic-combined.css&#039;);\n\twp_enqueue_style( &#039;dynamic-css&#039;);\n}\n\n\/\/loaded in head\n$external_dynamic = (!empty($options[&#039;external-dynamic-css&#039;]) &amp;&amp; $options[&#039;external-dynamic-css&#039;] == 1) ? &#039;on&#039; : &#039;off&#039;;\nif($external_dynamic != &#039;on&#039;) {\n\n\tadd_action(&#039;wp_head&#039;, &#039;nectar_colors_css_output&#039;);\n\tadd_action(&#039;wp_head&#039;, &#039;nectar_custom_css_output&#039;);\n\tadd_action(&#039;wp_head&#039;, &#039;nectar_fonts_output&#039;); \n\n} \n\/\/written to static css file\nelse {\n\tadd_action(&#039;wp_enqueue_scripts&#039;, &#039;nectar_enqueue_dynamic_css&#039;);\n\n\t\/\/handle page specific dynamic \n\tadd_action(&#039;wp_head&#039;, &#039;nectar_page_specific_dynamic&#039;);\n}\n\n$font_fields = array(&#039;navigation_font_family&#039;,&#039;navigation_dropdown_font_family&#039;,&#039;page_heading_font_family&#039;,&#039;page_heading_subtitle_font_family&#039;,&#039;off_canvas_nav_font_family&#039;,&#039;off_canvas_nav_subtext_font_family&#039;,&#039;body_font_family&#039;,&#039;h1_font_family&#039;,&#039;h2_font_family&#039;,&#039;h3_font_family&#039;,&#039;h4_font_family&#039;,&#039;h5_font_family&#039;,&#039;h6_font_family&#039;,&#039;i_font_family&#039;,&#039;label_font_family&#039;,&#039;nectar_slider_heading_font_family&#039;,&#039;home_slider_caption_font_family&#039;,&#039;testimonial_font_family&#039;,&#039;sidebar_footer_h_font_family&#039;,&#039;team_member_h_font_family&#039;,&#039;nectar_dropcap_font_family&#039;);\n\nif( !function_exists(&#039;nectar_lovelo_font&#039;)) {\n\tfunction nectar_lovelo_font(){\n\t\techo &quot;\n\t\t&lt;!-- A font fabric font - http:\/\/fontfabric.com\/lovelo-font\/ --&gt;\n\t\t&lt;style&gt; @font-face { font-family: &#039;Lovelo&#039;; src: url(&#039;&quot;.get_template_directory_uri().&quot;\/css\/fonts\/Lovelo_Black.eot&#039;); src: url(&#039;&quot;.get_template_directory_uri().&quot;\/css\/fonts\/Lovelo_Black.eot?#iefix&#039;) format(&#039;embedded-opentype&#039;), url(&#039;&quot;.get_template_directory_uri().&quot;\/css\/fonts\/Lovelo_Black.woff&#039;) format(&#039;woff&#039;),  url(&#039;&quot;.get_template_directory_uri().&quot;\/css\/fonts\/Lovelo_Black.ttf&#039;) format(&#039;truetype&#039;), url(&#039;&quot;.get_template_directory_uri().&quot;\/css\/fonts\/Lovelo_Black.svg#loveloblack&#039;) format(&#039;svg&#039;); font-weight: normal; font-style: normal; } &lt;\/style&gt;&quot;;\n\t}\n}\n\nforeach($font_fields as $k =&gt; $v){\n\tif(isset($options[$v][&#039;font-family&#039;]) &amp;&amp; $options[$v][&#039;font-family&#039;] == &#039;Lovelo, sans-serif&#039;) { \n\t\tadd_action(&#039;wp_head&#039;, &#039;nectar_lovelo_font&#039;);\n\t\tbreak;\n\t}\n}\n \n\n#-----------------------------------------------------------------#\n# Post formats\n#-----------------------------------------------------------------#\n\nadd_theme_support( &#039;post-formats&#039;, array(&#039;quote&#039;,&#039;video&#039;,&#039;audio&#039;,&#039;gallery&#039;,&#039;link&#039;) );\n\n#-----------------------------------------------------------------#\n# Category Custom Meta\n#-----------------------------------------------------------------#\n\ninclude(&quot;nectar\/meta\/category-meta.php&quot;);\n\n#-----------------------------------------------------------------#\n# Automatic Feed Links\n#-----------------------------------------------------------------#\n\nif(function_exists(&#039;add_theme_support&#039;)) {\n    add_theme_support(&#039;automatic-feed-links&#039;);\n}\n\n#-----------------------------------------------------------------#\n# Image sizes \n#-----------------------------------------------------------------#\n\nif (!function_exists(&#039;nectar_add_image_sizes&#039;)) {\n\t\n\tfunction nectar_add_image_sizes(){\n\n\t\tadd_theme_support( &#039;post-thumbnails&#039; );\n\t\tadd_image_size( &#039;portfolio-thumb&#039;, 600, 403, true ); \n\t\tadd_image_size( &#039;portfolio-thumb_small&#039;, 400, 269, true ); \n\t\tadd_image_size( &#039;portfolio-widget&#039;, 100, 100, true ); \n\n\t\tglobal $options;\n\t\t$masonry_sizing_type = (!empty($options[&#039;portfolio_masonry_grid_sizing&#039;]) &amp;&amp; $options[&#039;portfolio_masonry_grid_sizing&#039;] == &#039;photography&#039;) ? &#039;photography&#039; : &#039;default&#039;;\n\n\t\tif($masonry_sizing_type != &#039;photography&#039;) {\n\t\t\tadd_image_size( &#039;wide&#039;, 1000, 500, true );\n\t\t\tadd_image_size( &#039;wide_small&#039;, 670, 335, true );  \n\t\t\tadd_image_size( &#039;regular&#039;, 500, 500, true ); \n\t\t\tadd_image_size( &#039;regular_small&#039;, 350, 350, true ); \n\t\t\tadd_image_size( &#039;tall&#039;, 500, 1000, true ); \n\t\t\tadd_image_size( &#039;wide_tall&#039;, 1000, 1000, true );\n\t\t} else {\n\t\t\t\/\/these two are still needed for meta overlaid masonry blog\n\t\t\tadd_image_size( &#039;regular&#039;, 500, 500, true ); \n\t\t\tadd_image_size( &#039;regular_small&#039;, 350, 350, true ); \n\t\t\tadd_image_size( &#039;wide_tall&#039;, 1000, 1000, true );\n\n\t\t\tadd_image_size( &#039;wide_photography&#039;, 900, 600, true ); \n\t\t\tadd_image_size( &#039;wide_photography_small&#039;, 675, 450, true );  \n\t\t\tadd_image_size( &#039;regular_photography&#039;, 450, 600, true ); \n\t\t\tadd_image_size( &#039;regular_photography_small&#039;, 350, 467, true ); \n\t\t\tadd_image_size( &#039;wide_tall_photography&#039;, 900, 1200, true );\n\t\t}\n\n\t\tadd_image_size( &#039;large_featured&#039;, 1700, 700, true );  \n\t\t\/\/add_image_size( &#039;disable_crop&#039;, 800, 800, true ); \n\n\t}\n}\n\nnectar_add_image_sizes();\n\n function nectar_list_thumbnail_sizes(){\n     global $_wp_additional_image_sizes;\n     \t$sizes = array();\n \t\tforeach( get_intermediate_image_sizes() as $s ){\n \t\t\t$sizes[ $s ] = array( 0, 0 );\n \t\t\tif( in_array( $s, array( &#039;thumbnail&#039;, &#039;medium&#039;, &#039;large&#039; ) ) ){\n \t\t\t\t$sizes[ $s ][0] = get_option( $s . &#039;_size_w&#039; );\n \t\t\t\t$sizes[ $s ][1] = get_option( $s . &#039;_size_h&#039; );\n \t\t\t}else{\n \t\t\t\tif( isset( $_wp_additional_image_sizes ) &amp;&amp; isset( $_wp_additional_image_sizes[ $s ] ) )\n \t\t\t\t\t$sizes[ $s ] = array( $_wp_additional_image_sizes[ $s ][&#039;width&#039;], $_wp_additional_image_sizes[ $s ][&#039;height&#039;], );\n \t\t\t}\n \t\t}\n \n \t\tforeach( $sizes as $size =&gt; $atts ){\n \t\t\techo $size . &#039; &#039; . implode( &#039;x&#039;, $atts ) . &quot;\\n&quot;;\n \t\t}\n }\n\n#-----------------------------------------------------------------#\n# Custom menu\n#-----------------------------------------------------------------#\nif ( function_exists( &#039;register_nav_menus&#039; ) ) {\n\n\t$sideWidgetArea = (!empty($options[&#039;header-slide-out-widget-area&#039;])) ? $options[&#039;header-slide-out-widget-area&#039;] : &#039;off&#039;;\n\t$usingPRCompatLayout = false;\n\n\tif( !empty($options[&#039;header_format&#039;]) &amp;&amp; $options[&#039;header_format&#039;] == &#039;menu-left-aligned&#039; || $options[&#039;header_format&#039;] == &#039;centered-menu&#039; ) {\n\t\t$usingPRCompatLayout = true;\n\t}\n\n\tif($sideWidgetArea == &#039;1&#039;) {\n\n\t\tif($usingPRCompatLayout == true) {\n\n\t\t\t$nectar_menu_arr = array(\n\t\t\t  &#039;top_nav&#039; =&gt; &#039;Top Navigation Menu&#039;,\n\t\t\t  &#039;top_nav_pull_right&#039; =&gt; &#039;Top Navigation Menu Pull Right&#039;,\n\t\t\t  &#039;secondary_nav&#039; =&gt; &#039;Secondary Navigation Menu &lt;br \/&gt; &lt;small&gt;Will only display if applicable header layout is selected.&lt;\/small&gt;&#039;,\n\t\t\t  &#039;off_canvas_nav&#039; =&gt; &#039;Off Canvas Navigation Menu&#039;\n\t\t\t);\n\n\t\t} else {\n\t\t\t$nectar_menu_arr = array(\n\t\t\t  &#039;top_nav&#039; =&gt; &#039;Top Navigation Menu&#039;,\n\t\t\t  &#039;secondary_nav&#039; =&gt; &#039;Secondary Navigation Menu &lt;br \/&gt; &lt;small&gt;Will only display if applicable header layout is selected.&lt;\/small&gt;&#039;,\n\t\t\t  &#039;off_canvas_nav&#039; =&gt; &#039;Off Canvas Navigation Menu&#039;\n\t\t\t);\n\t\t}\n\n\t} else {\n\n\t\tif($usingPRCompatLayout == true) { \n\n\t\t\t$nectar_menu_arr = array(\n\t\t\t  &#039;top_nav&#039; =&gt; &#039;Top Navigation Menu&#039;,\n\t\t\t  &#039;top_nav_pull_right&#039; =&gt; &#039;Top Navigation Menu Pull Right&#039;,\n\t\t\t  &#039;secondary_nav&#039; =&gt; &#039;Secondary Navigation Menu &lt;br \/&gt; &lt;small&gt;Will only display if applicable header layout is selected.&lt;\/small&gt;&#039;\n\t\t\t);\n\n\t\t} else {\n\t\t\t$nectar_menu_arr = array(\n\t\t\t  &#039;top_nav&#039; =&gt; &#039;Top Navigation Menu&#039;,\n\t\t\t  &#039;secondary_nav&#039; =&gt; &#039;Secondary Navigation Menu &lt;br \/&gt; &lt;small&gt;Will only display if applicable header layout is selected.&lt;\/small&gt;&#039;\n\t\t\t);\n\t\t}\n\t}\n\t\n\tregister_nav_menus($nectar_menu_arr);\n}\t\n\n\/\/dropdown arrows\nif ( !function_exists( &#039;nectar_walker_nav_menu&#039; ) ) {\n\tfunction nectar_walker_nav_menu() {\n\n\t\tclass Nectar_Arrow_Walker_Nav_Menu extends Walker_Nav_Menu {\n\t\t    function display_element($element, &amp;$children_elements, $max_depth, $depth=0, $args, &amp;$output) {\n\t\t        $id_field = $this-&gt;db_fields[&#039;id&#039;];\n\t\t        global $options;\n\t\t        $theme_skin = (!empty($options[&#039;theme-skin&#039;]) &amp;&amp; $options[&#039;theme-skin&#039;] == &#039;ascend&#039;) ? &#039;ascend&#039; : &#039;default&#039;;\n\t\t        $headerFormat = (!empty($options[&#039;header_format&#039;])) ? $options[&#039;header_format&#039;] : &#039;default&#039;;\n\n\t\t        \/\/button styling\n\t\t        $button_style = get_post_meta( $element-&gt;$id_field, &#039;menu-item-nectar-button-style&#039;, true);\n\t\t        if(!empty($button_style))\n\t\t        \t$element-&gt;classes[] = $button_style;\n\n\t\t        if (!empty($children_elements[$element-&gt;$id_field]) &amp;&amp; $element-&gt;menu_item_parent == 0 &amp;&amp; $theme_skin !=&#039;ascend&#039; &amp;&amp; $headerFormat != &#039;left-header&#039;) { \n\t\t            $element-&gt;title =  $element-&gt;title . &#039;&lt;span class=&quot;sf-sub-indicator&quot;&gt;&lt;i class=&quot;icon-angle-down&quot;&gt;&lt;\/i&gt;&lt;\/span&gt;&#039;; \n\t\t\t\t\t$element-&gt;classes[] = &#039;sf-with-ul&#039;;\n\t\t        }\n\t\t\t\t\n\t\t\t\tif (!empty($children_elements[$element-&gt;$id_field]) &amp;&amp; $element-&gt;menu_item_parent != 0 &amp;&amp; $headerFormat != &#039;left-header&#039;) { \n\t\t            $element-&gt;title =  $element-&gt;title . &#039;&lt;span class=&quot;sf-sub-indicator&quot;&gt;&lt;i class=&quot;icon-angle-right&quot;&gt;&lt;\/i&gt;&lt;\/span&gt;&#039;; \n\t\t        }\n\t\t\t    \n\t\t\t    if(empty($button_style) &amp;&amp; $headerFormat == &#039;left-header&#039;) \n\t\t\t   \t   $element-&gt;title = &#039;&lt;span&gt;&#039;. $element-&gt;title . &#039;&lt;\/span&gt;&#039;;\n\n\t\t        Walker_Nav_Menu::display_element($element, $children_elements, $max_depth, $depth, $args, $output);\n\t\t    }\n\t\t}\n\n\t}\n}\n\nnectar_walker_nav_menu();\n\nif ( !function_exists( &#039;nectar_description_walker_nav_menu&#039; ) ) {\n\tfunction nectar_description_walker_nav_menu( $item_output, $item, $depth, $args ) {\n\t\tif ( &#039;off_canvas_nav&#039; == $args-&gt;theme_location &amp;&amp; $item-&gt;description ) {\n\t\t\t$item_output = str_replace( $args-&gt;link_after . &#039;&lt;\/a&gt;&#039;, $args-&gt;link_after . &#039;&lt;\/a&gt;&lt;small class=&quot;nav_desc&quot;&gt;&#039; . $item-&gt;description . &#039;&lt;\/small&gt;&#039;, $item_output );\n\t\t}\n\n\t\treturn $item_output;\n\t}\n}\n\nadd_filter( &#039;walker_nav_menu_start_el&#039;, &#039;nectar_description_walker_nav_menu&#039;, 10, 4 );\n\n\/\/menu button style option\nrequire_once(&#039;nectar\/assets\/functions\/wp-menu-custom-items\/menu-item-custom-fields.php&#039;);\n\nif(!function_exists(&#039;nectar_nav_button_style&#039;)) {\n\n\tadd_action(&#039;wp_nav_menu_item_custom_fields&#039;, &#039;nectar_nav_button_style&#039;, 10, 4);\n\n\t$nectar_custom_menu_fields = array(\n\t\t&#039;menu-item-nectar-button-style&#039; =&gt; &#039;&#039;\n\t);\n\n\tfunction nectar_nav_button_style($output, $item, $depth, $args) {\n\n        $item_id = $item-&gt;ID;\n\t\t$name  = &quot;menu-item-nectar-button-style&quot;; \n\t\t$value = get_post_meta($item_id, $name, true);\n\n        ?&gt;\n\n        &lt;p class=&quot;description description-wide&quot;&gt;\n\t\t\t&lt;label for=&quot;&lt;?php echo $name . &quot;-&quot;. $item_id;?&gt;&quot;&gt;\n\t\t\t\t&lt;?php echo __( &#039;Menu Item Style&#039;,NECTAR_THEME_NAME); ?&gt; &lt;br \/&gt;\n\t\t\t\t&lt;select id=&quot;&lt;?php echo $name . &quot;-&quot;. $item_id; ?&gt;&quot; class=&quot;widefat edit-menu-item-target&quot; name=&quot;&lt;?php echo $name . &quot;[&quot;.$item_id.&quot;]&quot;; ?&gt;&quot;&gt;\n\t\t\t\t\t&lt;option value=&quot;&quot; &lt;?php selected( $value,  &#039;&#039;); ?&gt;&gt;&lt;?php echo __(&#039;Standard&#039;, NECTAR_THEME_NAME); ?&gt; &lt;\/option&gt;\n\t\t\t\t\t&lt;option value=&quot;button_solid_color&quot; &lt;?php selected( $value, &#039;button_solid_color&#039;); ?&gt;&gt;&lt;?php echo __(&#039;Button Accent Color&#039;, NECTAR_THEME_NAME); ?&gt; &lt;\/option&gt;\n\t\t\t\t\t&lt;option value=&quot;button_solid_color_2&quot; &lt;?php selected( $value, &#039;button_solid_color_2&#039;); ?&gt;&gt;&lt;?php echo __(&#039;Button Extra Color #1&#039;, NECTAR_THEME_NAME); ?&gt; &lt;\/option&gt;\n\t\t\t\t\t&lt;option value=&quot;button_bordered&quot; &lt;?php selected( $value, &#039;button_bordered&#039;); ?&gt;&gt;&lt;?php echo __(&#039;Button Bordered Accent Color&#039;, NECTAR_THEME_NAME); ?&gt; &lt;\/option&gt;\n\t\t\t\t\t&lt;option value=&quot;button_bordered_2&quot; &lt;?php selected( $value, &#039;button_bordered_2&#039;); ?&gt;&gt;&lt;?php echo __(&#039;Button Bordered Extra Color #1&#039;, NECTAR_THEME_NAME); ?&gt; &lt;\/option&gt;\n\t\t\t\t&lt;\/select&gt;\n\t\t\t&lt;\/label&gt;\n\t\t&lt;\/p&gt;\n           \n\t &lt;?php }\n\t\n\tadd_action( &#039;wp_update_nav_menu_item&#039;, &#039;nectar_nav_button_style_update&#039;, 10, 3 );\n\tfunction nectar_nav_button_style_update( $menu_id, $menu_item_db_id, $menu_item_args ) {\n\n\t\tglobal $nectar_custom_menu_fields;\n\t\tif ( defined( &#039;DOING_AJAX&#039; ) &amp;&amp; DOING_AJAX ) {\n\t\t\treturn;\n\t\t}\n\t\tcheck_admin_referer( &#039;update-nav_menu&#039;, &#039;update-nav-menu-nonce&#039; );\n\n\t\tforeach ( $nectar_custom_menu_fields as $key =&gt; $label ) {\n\n\t\t\t\/\/ Sanitize\n\t\t\tif ( ! empty( $_POST[ $key ][ $menu_item_db_id ] ) ) {\n\t\t\t\t\/\/ Do some checks here...\n\t\t\t\t$value = sanitize_text_field($_POST[ $key ][ $menu_item_db_id ]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$value = null;\n\t\t\t}\n\t\t\t\n\t\t\t\/\/ Update\n\t\t\tif ( ! is_null( $value ) ) {\n\t\t\t\tupdate_post_meta( $menu_item_db_id, $key, $value );\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdelete_post_meta( $menu_item_db_id, $key );\n\t\t\t}\n\t\t}\n\t}\n\n\t\n}\n\n#-----------------------------------------------------------------#\n# TGM\n#-----------------------------------------------------------------#\n\n$nectar_disable_tgm = (!empty($options[&#039;disable_tgm&#039;]) &amp;&amp; $options[&#039;disable_tgm&#039;] == &#039;1&#039;) ? true : false; \n\nif(!$nectar_disable_tgm) {\n\trequire_once(&#039;nectar\/tgm-plugin-activation\/class-tgm-plugin-activation.php&#039;);\n\trequire_once(&#039;nectar\/tgm-plugin-activation\/required_plugins.php&#039;);\n}\n\n#-----------------------------------------------------------------#\n# Nectar VC\n#-----------------------------------------------------------------#\n\n\/\/Add Nectar Functionality to VC\/*\nif (class_exists(&#039;WPBakeryVisualComposerAbstract&#039;) &amp;&amp; defined( &#039;SALIENT_VC_ACTIVE&#039;)) {\n\tfunction add_nectar_to_vc(){\n\n\t\tif(version_compare(WPB_VC_VERSION,&#039;4.9&#039;,&#039;&gt;=&#039;)) {\n\t\t\trequire_once locate_template(&#039;\/nectar\/nectar-vc-addons\/nectar-addons.php&#039;);\n\t\t} else {\n\t\t\trequire_once locate_template(&#039;\/nectar\/nectar-vc-addons\/nectar-addons-no-lean.php&#039;);\n\t\t}\n\t}\n\n\tadd_action(&#039;init&#039;,&#039;add_nectar_to_vc&#039;, 5);\n\tadd_action(&#039;admin_enqueue_scripts&#039;, &#039;nectar_vc_styles&#039;);\n\t\n\tfunction nectar_vc_styles() {\n\t\tglobal $nectar_get_template_directory_uri;\n\t\twp_enqueue_style(&#039;nectar_vc&#039;, $nectar_get_template_directory_uri .&#039;\/nectar\/nectar-vc-addons\/nectar-addons.css&#039;, array(), &#039;8.0.1&#039;, &#039;all&#039;);\n\t}\n\n\tfunction nectar_vc_library_cat_list() {\n\t\treturn array( __(&#039;All&#039;,NECTAR_THEME_NAME) =&gt; &#039;all&#039;, \n\t\t\t__(&#039;About&#039;,NECTAR_THEME_NAME) =&gt; &#039;about&#039;, \n\t\t\t__(&#039;Blog&#039;,NECTAR_THEME_NAME) =&gt; &#039;blog&#039;,  \n\t\t\t__(&#039;Call To Action&#039;,NECTAR_THEME_NAME) =&gt; &#039;cta&#039;,\n\t\t\t__(&#039;Counters&#039;,NECTAR_THEME_NAME) =&gt; &#039;counters&#039;,  \n\t\t\t__(&#039;General&#039;,NECTAR_THEME_NAME) =&gt; &#039;general&#039;,  \n\t\t\t__(&#039;Icons&#039;,NECTAR_THEME_NAME) =&gt; &#039;icons&#039;, \n\t\t\t__(&#039;Hero Section&#039;,NECTAR_THEME_NAME) =&gt; &#039;hero_section&#039;, \n\t\t\t__(&#039;Google Map&#039;,NECTAR_THEME_NAME) =&gt; &#039;map&#039;,\n\t\t\t__(&#039;Project&#039;,NECTAR_THEME_NAME) =&gt; &#039;portfolio&#039;,\n\t\t\t__(&#039;Pricing&#039;,NECTAR_THEME_NAME) =&gt; &#039;pricing&#039;,\n\t\t\t__(&#039;Services&#039;,NECTAR_THEME_NAME) =&gt; &#039;services&#039;,\n\t\t\t__(&#039;Team&#039;,NECTAR_THEME_NAME) =&gt; &#039;team&#039;,\n\t\t\t__(&#039;Testimonials&#039;,NECTAR_THEME_NAME) =&gt; &#039;testimonials&#039;);\n\t}\n\n\tif(!function_exists(&#039;add_salient_studio_to_vc&#039;)) {\n\t\tfunction add_salient_studio_to_vc() {\n\t\t\tif (is_admin()) { \n\t\t\t\trequire_once locate_template(&#039;\/nectar\/nectar-vc-addons\/salient-studio-templates.php&#039;);\n\t\t\t}\n\t\t}\n\t}\n\n\tadd_salient_studio_to_vc();\n\n} else if (class_exists(&#039;WPBakeryVisualComposerAbstract&#039;)) {\n\n\tfunction nectar_font_awesome() {\n\t\tglobal $nectar_get_template_directory_uri;\n\t \twp_enqueue_style(&#039;font-awesome&#039;, $nectar_get_template_directory_uri . &#039;\/css\/font-awesome.min.css&#039;);\n\t}\n\n\tif (!is_admin()) { \n\t\tadd_action(&#039;init&#039;,&#039;nectar_font_awesome&#039;, 99);\n\t}\n\n}\n\n#-----------------------------------------------------------------#\n# Theme Skin\n#-----------------------------------------------------------------#\n\nif(!empty($options[&#039;theme-skin&#039;]) &amp;&amp; $options[&#039;theme-skin&#039;] == &#039;ascend&#039;){\n\n\t$nectar_theme_skin = &#039;ascend&#039;;\n\n\tadd_filter(&#039;body_class&#039;,&#039;nectar_theme_skin_class&#039;);\n\n\tfunction nectar_theme_skin_class($classes) {\n\t\t\/\/ add &#039;class-name&#039; to the $classes array\n\t\t$classes[] = &#039;ascend&#039;;\n\t\t\/\/ return the $classes array\n\t\treturn $classes;\n\t}\n\n\tfunction nectar_theme_skin_css(){\n\t\twp_enqueue_style(&#039;skin-ascend&#039;); \n\t}\n\t\n\tadd_action(&#039;wp_enqueue_scripts&#039;, &#039;nectar_theme_skin_css&#039;);\n\n} else {\n\t$nectar_theme_skin = &#039;default&#039;;\n}\n\n#-----------------------------------------------------------------#\n# Ajax Search\n#-----------------------------------------------------------------#\n\n$ajax_search = (!empty($options[&#039;header-disable-ajax-search&#039;]) &amp;&amp; $options[&#039;header-disable-ajax-search&#039;] == &#039;1&#039;) ? &#039;no&#039; : &#039;yes&#039;;\n$headerSearch = (!empty($options[&#039;header-disable-search&#039;]) &amp;&amp; $options[&#039;header-disable-search&#039;] == &#039;1&#039;) ? &#039;false&#039; : &#039;true&#039;;\n\nif($ajax_search == &#039;yes&#039; &amp;&amp; $headerSearch != &#039;false&#039;){\n\trequire_once(&#039;nectar\/assets\/functions\/ajax-search\/wp-search-suggest.php&#039;);\n}\n\n#-----------------------------------------------------------------#\n# If Using Ajaxify \n#-----------------------------------------------------------------#\n\nfunction ajaxify_non_cached_scripts( $url ) {\nif ( FALSE !== strpos( $url, &#039;nectar-slider.js&#039; )) { \n\t\/\/return &quot;$url&#039; class=&#039;always&quot;;\n}\n\nif( FALSE !== strpos( $url, &#039;vc_chart.js&#039; )) {\n\treturn &quot;$url&#039; class=&#039;always&quot;;\n}\n\nif( FALSE !== strpos( $url, &#039;ProgressCircle.js&#039; )){\n\treturn &quot;$url&#039; class=&#039;always&quot;;\n}\n\n\/\/ not our file\nreturn $url;\n\n}\n\nif(!empty($options[&#039;ajax-page-loading&#039;]) &amp;&amp; $options[&#039;ajax-page-loading&#039;] == &#039;1&#039;) {\n\tadd_filter( &#039;clean_url&#039;, &#039;ajaxify_non_cached_scripts&#039;, 11, 1 );\n}\n\n#-----------------------------------------------------------------#\n# Site Title \n#-----------------------------------------------------------------#\n\nfunction theme_slug_setup() {\n   add_theme_support( &#039;title-tag&#039; );\n}\nadd_action( &#039;after_setup_theme&#039;, &#039;theme_slug_setup&#039; );\n\nif ( ! function_exists( &#039;_wp_render_title_tag&#039; ) ) {\n    function theme_slug_render_title() { ?&gt;\n\n\t\t&lt;title&gt;&lt;?php wp_title( &#039;|&#039;, true, &#039;right&#039; ); ?&gt;&lt;\/title&gt; &lt;?php\n    }\n\n    add_action( &#039;wp_head&#039;, &#039;theme_slug_render_title&#039; );\n}\n\n#-----------------------------------------------------------------#\n# Widget areas\n#-----------------------------------------------------------------#\nif(function_exists(&#039;register_sidebar&#039;)) {\n\t\n\tregister_sidebar(array(&#039;name&#039; =&gt; &#039;Blog Sidebar&#039;, &#039;id&#039; =&gt; &#039;blog-sidebar&#039;, &#039;before_widget&#039; =&gt; &#039;&lt;div id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;&#039;,&#039;after_widget&#039;  =&gt; &#039;&lt;\/div&gt;&#039;, &#039;before_title&#039;  =&gt; &#039;&lt;h4&gt;&#039;, &#039;after_title&#039;   =&gt; &#039;&lt;\/h4&gt;&#039;));\n\tregister_sidebar(array(&#039;name&#039; =&gt; &#039;Page Sidebar&#039;, &#039;id&#039; =&gt; &#039;page-sidebar&#039;,&#039;before_widget&#039; =&gt; &#039;&lt;div id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;&#039;,&#039;after_widget&#039;  =&gt; &#039;&lt;\/div&gt;&#039;, &#039;before_title&#039;  =&gt; &#039;&lt;h4&gt;&#039;, &#039;after_title&#039;   =&gt; &#039;&lt;\/h4&gt;&#039;));\n\tregister_sidebar(array(&#039;name&#039; =&gt; &#039;WooCommerce Sidebar&#039;, &#039;id&#039; =&gt; &#039;woocommerce-sidebar&#039;, &#039;before_widget&#039; =&gt; &#039;&lt;div id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;&#039;,&#039;after_widget&#039;  =&gt; &#039;&lt;\/div&gt;&#039;, &#039;before_title&#039;  =&gt; &#039;&lt;h4&gt;&#039;, &#039;after_title&#039;   =&gt; &#039;&lt;\/h4&gt;&#039;));\n\t\n\tregister_sidebar(array(&#039;name&#039; =&gt; &#039;Footer Area 1&#039;, &#039;id&#039; =&gt; &#039;footer-area-1&#039;, &#039;before_widget&#039; =&gt; &#039;&lt;div id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;&#039;,&#039;after_widget&#039;  =&gt; &#039;&lt;\/div&gt;&#039;, &#039;before_title&#039;  =&gt; &#039;&lt;h4&gt;&#039;, &#039;after_title&#039;   =&gt; &#039;&lt;\/h4&gt;&#039;));\n\t\n\tglobal $options; \n\t$footerColumns = (!empty($options[&#039;footer_columns&#039;])) ? $options[&#039;footer_columns&#039;] : &#039;4&#039;;\n\n\tif($footerColumns == &#039;2&#039; || $footerColumns == &#039;3&#039; || $footerColumns == &#039;4&#039; || $footerColumns == &#039;5&#039;){\n\t\tregister_sidebar(array(&#039;name&#039; =&gt; &#039;Footer Area 2&#039;, &#039;id&#039; =&gt; &#039;footer-area-2&#039;,&#039;before_widget&#039; =&gt; &#039;&lt;div id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;&#039;,&#039;after_widget&#039;  =&gt; &#039;&lt;\/div&gt;&#039;, &#039;before_title&#039;  =&gt; &#039;&lt;h4&gt;&#039;, &#039;after_title&#039;   =&gt; &#039;&lt;\/h4&gt;&#039;));\n\t}\n\n\tif($footerColumns == &#039;3&#039; || $footerColumns == &#039;4&#039; || $footerColumns == &#039;5&#039;){\n\t\tregister_sidebar(array(&#039;name&#039; =&gt; &#039;Footer Area 3&#039;, &#039;id&#039; =&gt; &#039;footer-area-3&#039;, &#039;before_widget&#039; =&gt; &#039;&lt;div id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;&#039;,&#039;after_widget&#039;  =&gt; &#039;&lt;\/div&gt;&#039;, &#039;before_title&#039;  =&gt; &#039;&lt;h4&gt;&#039;, &#039;after_title&#039;   =&gt; &#039;&lt;\/h4&gt;&#039;));\n\t}\n\tif($footerColumns == &#039;4&#039; || $footerColumns == &#039;5&#039;){\n\t\tregister_sidebar(array(&#039;name&#039; =&gt; &#039;Footer Area 4&#039;, &#039;id&#039; =&gt; &#039;footer-area-4&#039;, &#039;before_widget&#039; =&gt; &#039;&lt;div id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;&#039;,&#039;after_widget&#039;  =&gt; &#039;&lt;\/div&gt;&#039;, &#039;before_title&#039;  =&gt; &#039;&lt;h4&gt;&#039;, &#039;after_title&#039;   =&gt; &#039;&lt;\/h4&gt;&#039;));\n\t}\n\n\t$sideWidgetArea = (!empty($options[&#039;header-slide-out-widget-area&#039;])) ? $options[&#039;header-slide-out-widget-area&#039;] : &#039;off&#039;;\n\tif($sideWidgetArea == &#039;1&#039;) {\n\t\tregister_sidebar(array(&#039;name&#039; =&gt; &#039;Off Canvas Menu&#039;, &#039;id&#039; =&gt; &#039;slide-out-widget-area&#039;, &#039;before_widget&#039; =&gt; &#039;&lt;div id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;&#039;,&#039;after_widget&#039;  =&gt; &#039;&lt;\/div&gt;&#039;, &#039;before_title&#039;  =&gt; &#039;&lt;h4&gt;&#039;, &#039;after_title&#039;   =&gt; &#039;&lt;\/h4&gt;&#039;));\n\t}\n\n}\n\n#-----------------------------------------------------------------#\n# Custom widgets\n#-----------------------------------------------------------------#\n\n\/\/Recent Posts Extra\ninclude(&#039;includes\/custom-widgets\/recent-posts-extra-widget.php&#039;);\n\n\/\/Recent portfolio items\ninclude(&#039;includes\/custom-widgets\/recent-projects-widget.php&#039;);\n\n\/\/allow shortcodes in text widget\nadd_filter(&#039;widget_text&#039;, &#039;do_shortcode&#039;);\n\n#-----------------------------------------------------------------#\n# Excerpt related \n#-----------------------------------------------------------------#\n\n\/\/excerpt length\nif(!function_exists(&#039;excerpt_length&#039;)){\n\tfunction excerpt_length( $length ) {\n\t\t\n\t\tglobal $options;\n\t\t$excerpt_length = (!empty($options[&#039;blog_excerpt_length&#039;])) ? intval($options[&#039;blog_excerpt_length&#039;]) : 30; \n\n\t    return $excerpt_length;\n\t}\n}\n\nadd_filter( &#039;excerpt_length&#039;, &#039;excerpt_length&#039;, 999 );\n\n\/\/custom excerpt ending\nif(!function_exists(&#039;excerpt_more&#039;)){\n\tfunction excerpt_more( $more ) {\n\t\treturn &#039;...&#039;;\n\t}\n}\nadd_filter(&#039;excerpt_more&#039;, &#039;excerpt_more&#039;);\n\nfunction nectar_excerpt($limit) {\n\n\tif(has_excerpt()) {\n\t\t$the_excerpt = get_the_excerpt();\n\t\t$the_excerpt = preg_replace(&#039;\/\\[[^\\]]+\\]\/&#039;, &#039;&#039;, $the_excerpt);  # strip shortcodes, keep shortcode content\n\t    return wp_trim_words($the_excerpt, $limit);\n\t} else {\n\t\t$the_content = get_the_content();\n\t\t$the_content = preg_replace(&#039;\/\\[[^\\]]+\\]\/&#039;, &#039;&#039;, $the_content);  # strip shortcodes, keep shortcode content\n\t    return wp_trim_words($the_content, $limit);\n\t}\n}\n\n\/\/fixing filtering for shortcodes\nfunction shortcode_empty_paragraph_fix($content){   \n    $array = array (\n        &#039;&lt;p&gt;[&#039; =&gt; &#039;[&#039;, \n        &#039;]&lt;\/p&gt;&#039; =&gt; &#039;]&#039;, \n        &#039;]&lt;br \/&gt;&#039; =&gt; &#039;]&#039;\n    );\n\n    $content = strtr($content, $array);\n    return $content;\n}\n\nadd_filter(&#039;the_content&#039;, &#039;shortcode_empty_paragraph_fix&#039;);\n\n\/\/remove the page jump when clicking read more button\nfunction remove_more_jump_link($link) { \n\t$offset = strpos($link, &#039;#more-&#039;);\n\tif ($offset) {\n\t\t$end = strpos($link, &#039;&quot;&#039;,$offset);\n\t}\n\tif ($end) {\n\t\t$link = substr_replace($link, &#039;&#039;, $offset, $end-$offset);\n\t}\n\treturn $link;\n}\nadd_filter(&#039;the_content_more_link&#039;, &#039;remove_more_jump_link&#039;);\n\nif(!function_exists(&#039;nectar_auto_gallery_lightbox&#039;)){\n\tfunction nectar_auto_gallery_lightbox($content){\n\t\t\n\t\tpreg_match_all(&#039;\/&lt;a(.*?)href=(?:\\&#039;|&quot;)([^&lt;]*?).(bmp|gif|jpeg|jpg|png)(?:\\&#039;|&quot;)(.*?)&gt;\/i&#039;, $content, $links);\n\t\tif(isset($links[0])) {\n\t\t\t$rel_hash = &#039;[gallery-&#039;.wp_generate_password(4, FALSE, FALSE).&#039;]&#039;;\n\t\t\t\n\t\t\tforeach($links[0] as $id =&gt; $link) { \n\n\t\t\t\tif(preg_match(&#039;\/&lt;a.*?rel=(?:\\&#039;|&quot;)(.*?)(?:\\&#039;|&quot;).*?&gt;\/&#039;, $link, $result) === 1) {\n\t\t\t\t\t$content = str_replace($link, preg_replace(&#039;\/rel=(?:\\&#039;|&quot;)(.*?)(?:\\&#039;|&quot;)\/&#039;, &#039;rel=&quot;prettyPhoto&#039;.$rel_hash.&#039;&quot;&#039;, $link), $content);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$content = str_replace($link, &#039;&lt;a&#039;.$links[1][$id].&#039;href=&quot;&#039;.$links[2][$id].&#039;.&#039;.$links[3][$id].&#039;&quot;&#039;.$links[4][$id].&#039; rel=&quot;prettyPhoto&#039;. $rel_hash .&#039;&quot;&gt;&#039;, $content);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $content;\n\t\t\n\t}\n}\n\nif(!empty($options[&#039;default-lightbox&#039;]) &amp;&amp; $options[&#039;default-lightbox&#039;] == &#039;1&#039;){\n\tadd_filter(&#039;the_content&#039;, &#039;nectar_auto_gallery_lightbox&#039;);\n\t\n\tadd_filter(&#039;body_class&#039;,&#039;nectar_auto_gallery_lightbox_class&#039;);\n\tfunction nectar_auto_gallery_lightbox_class($classes) {\n\t\t\/\/ add &#039;class-name&#039; to the $classes array\n\t\t$classes[] = &#039;nectar-auto-lightbox&#039;;\n\t\t\/\/ return the $classes array\n\t\treturn $classes;\n\t}\n}\n\n#-----------------------------------------------------------------#\n# Add URL option into attachment details for visual composer image gallery element\n#-----------------------------------------------------------------#\n\nfunction nectar_add_attachment_field_credit( $form_fields, $post ) {\n\n    $form_fields[&#039;image-url&#039;] = array(\n        &#039;label&#039; =&gt; &#039;Image URL&#039;,\n        &#039;input&#039; =&gt; &#039;text&#039;,\n        &#039;value&#039; =&gt; get_post_meta( $post-&gt;ID, &#039;nectar_image_gal_url&#039;, true ),\n        &#039;helps&#039; =&gt; &#039;&#039;\n    );\n\n     $form_fields[&#039;shape-bg-color&#039;] = array(\n        &#039;label&#039; =&gt; &#039;BG Color&#039;,\n        &#039;input&#039; =&gt; &#039;text&#039;,\n        &#039;value&#039; =&gt; esc_attr( get_post_meta( $post-&gt;ID, &#039;nectar_particle_shape_bg_color&#039;, true ) ),\n        &#039;helps&#039; =&gt; &#039;Enter your color in hex format e.g. &quot;#1ed760&#039;\n    );\n\n    $image_gal_masonry_sizing_mapping = null;\n    $image_gal_masonry_sizing_mapping_options = array(&#039;regular&#039;=&gt;&#039;Regular&#039;, &#039;wide&#039;=&gt;&#039;Wide&#039;, &#039;tall&#039;=&gt;&#039;Tall&#039;, &#039;wide_tall&#039;=&gt;&#039;Wide &amp; Tall&#039;);\n    $meta = get_post_meta( $post-&gt;ID, &#039;nectar_image_gal_masonry_sizing&#039;, true );\n    foreach( $image_gal_masonry_sizing_mapping_options as $key =&gt; $option ) {\n\t\t$image_gal_masonry_sizing_mapping .= &#039;&lt;option value=&quot;&#039; . $key . &#039;&quot;&#039;;\n\t\tif( $meta ){\n\t\t\tif( $meta == $key ) $image_gal_masonry_sizing_mapping .= &#039; selected=&quot;selected&quot;&#039;; \n\t\t} \n\t\t$image_gal_masonry_sizing_mapping .=  &#039;&gt;&#039;. $option .&#039;&lt;\/option&gt;&#039;;\n\t} \n\n    $color_mapping = null;\n    $color_mapping_options = array(&#039;original&#039;=&gt;&#039;Original&#039;, &#039;solid&#039;=&gt;&#039;Solid Color&#039;, &#039;random&#039;=&gt;&#039;Random&#039;);\n    $meta = get_post_meta( $post-&gt;ID, &#039;nectar_particle_shape_color_mapping&#039;, true );\n    foreach( $color_mapping_options as $key =&gt; $option ) {\n\t\t$color_mapping .= &#039;&lt;option value=&quot;&#039; . $key . &#039;&quot;&#039;;\n\t\tif( $meta ){\n\t\t\tif( $meta == $key ) $color_mapping .= &#039; selected=&quot;selected&quot;&#039;; \n\t\t} \n\t\t$color_mapping .=  &#039;&gt;&#039;. $option .&#039;&lt;\/option&gt;&#039;;\n\t} \n\n\t$density = null;\n    $density_options = array(&#039;very_low&#039;=&gt;&#039;Very Low&#039;, &#039;low&#039;=&gt;&#039;Low&#039;, &#039;medium&#039;=&gt;&#039;Medium&#039;, &#039;high&#039;=&gt;&#039;High&#039;, &#039;very_high&#039;=&gt;&#039;Very High&#039;);\n    $meta = get_post_meta( $post-&gt;ID, &#039;nectar_particle_shape_density&#039;, true );\n    foreach( $density_options as $key =&gt; $option ) {\n\t\t$density .= &#039;&lt;option value=&quot;&#039; . $key . &#039;&quot;&#039;;\n\t\tif( $meta ){\n\t\t\tif( $meta == $key ) $density .= &#039; selected=&quot;selected&quot;&#039;; \n\t\t} \n\t\t$density .=  &#039;&gt;&#039;. $option .&#039;&lt;\/option&gt;&#039;;\n\t} \n\n\t$alpha = null;\n    $alpha_options = array(&#039;original&#039;=&gt;&#039;Original&#039;, &#039;random&#039;=&gt;&#039;Random&#039;);\n    $meta = get_post_meta( $post-&gt;ID, &#039;nectar_particle_shape_color_alpha&#039;, true );\n    foreach( $alpha_options as $key =&gt; $option ) {\n\t\t$alpha .= &#039;&lt;option value=&quot;&#039; . $key . &#039;&quot;&#039;;\n\t\tif( $meta ){\n\t\t\tif( $meta == $key ) $alpha .= &#039; selected=&quot;selected&quot;&#039;; \n\t\t} \n\t\t$alpha .=  &#039;&gt;&#039;. $option .&#039;&lt;\/option&gt;&#039;;\n\t} \n\n\t$form_fields[&quot;masonry-image-sizing&quot;] = array(\n     \t&#039;label&#039; =&gt; &#039;Masonry Sizing&#039;,\n     \t&#039;input&#039; =&gt; &#039;html&#039;,\n        &#039;html&#039; =&gt; &quot;&lt;select name=&#039;attachments[{$post-&gt;ID}][masonry-image-sizing]&#039; id=&#039;attachments[{$post-&gt;ID}][masonry-image-sizing]&#039;&gt;&quot;.$image_gal_masonry_sizing_mapping.&quot;&lt;\/select&gt;&quot;,\n\t\t&#039;helps&#039; =&gt; &#039;&#039;,\n\t\t&#039;value&#039; =&gt; get_post_meta( $post-&gt;ID, &#039;nectar_image_gal_masonry_sizing&#039;, true )\n\t);\n\n    $form_fields[&quot;shape-color-mapping&quot;] = array(\n     \t&#039;label&#039; =&gt; &#039;Color Mapping&#039;,\n     \t&#039;input&#039; =&gt; &#039;html&#039;,\n        &#039;html&#039; =&gt; &quot;&lt;select name=&#039;attachments[{$post-&gt;ID}][shape-color-mapping]&#039; id=&#039;attachments[{$post-&gt;ID}][shape-color-mapping]&#039;&gt;&quot;.$color_mapping.&quot;&lt;\/select&gt;&quot;,\n\t\t&#039;helps&#039; =&gt; &#039;&#039;,\n\t\t&#039;value&#039; =&gt; get_post_meta( $post-&gt;ID, &#039;nectar_particle_shape_color_mapping&#039;, true )\n\t);\n\n\t$form_fields[&quot;shape-color-alpha&quot;] = array(\n     \t&#039;label&#039; =&gt; &#039;Color Alpha&#039;,\n     \t&#039;input&#039; =&gt; &#039;html&#039;,\n        &#039;html&#039; =&gt; &quot;&lt;select name=&#039;attachments[{$post-&gt;ID}][shape-color-alpha]&#039; id=&#039;attachments[{$post-&gt;ID}][shape-color-alpha]&#039;&gt;&quot;.$alpha.&quot;&lt;\/select&gt;&quot;,\n\t\t&#039;helps&#039; =&gt; &#039;&#039;,\n\t\t&#039;value&#039; =&gt; get_post_meta( $post-&gt;ID, &#039;nectar_particle_shape_color_alpha&#039;, true )\n\t);\n\n    $form_fields[&#039;shape-particle-color&#039;] = array(\n        &#039;label&#039; =&gt; &#039;Particle Color&#039;,\n        &#039;input&#039; =&gt; &#039;text&#039;,\n        &#039;value&#039; =&gt; esc_attr( get_post_meta( $post-&gt;ID, &#039;nectar_particle_shape_color&#039;, true ) ),\n        &#039;helps&#039; =&gt; &#039;Will only be used if Color Mapping is set to &quot;Solid Color&quot;. Enter your color in hex format e.g. &quot;#1ed760&#039;\n    );\n\n\t$form_fields[&quot;shape-density&quot;] = array(\n     \t&#039;label&#039; =&gt; &#039;Particle Density&#039;,\n     \t&#039;input&#039; =&gt; &#039;html&#039;,\n        &#039;html&#039; =&gt; &quot;&lt;select name=&#039;attachments[{$post-&gt;ID}][shape-density]&#039; id=&#039;attachments[{$post-&gt;ID}][shape-density]&#039;&gt;&quot;.$density.&quot;&lt;\/select&gt;&quot;,\n\t\t&#039;helps&#039; =&gt; &#039;The lower the density, the higher the performance&#039;,\n\t\t&#039;value&#039; =&gt; get_post_meta( $post-&gt;ID, &#039;nectar_particle_shape_density&#039;, true )\n\t);\n\n\t$form_fields[&#039;shape-max-particle-size&#039;] = array(\n        &#039;label&#039; =&gt; &#039;Max Particle Size&#039;,\n        &#039;input&#039; =&gt; &#039;text&#039;,\n        &#039;value&#039; =&gt; get_post_meta( $post-&gt;ID, &#039;nectar_particle_max_particle_size&#039;, true ),\n        &#039;helps&#039; =&gt; &#039;The default is 3&#039;\n    );\n\n    return $form_fields;\n}\nadd_filter( &#039;attachment_fields_to_edit&#039;, &#039;nectar_add_attachment_field_credit&#039;, 10, 2 );\n\nfunction nectar_add_attachment_field_credit_save( $post, $attachment ) {\n    if( isset( $attachment[&#039;image-url&#039;] ) ) {\n    \t$image_url_sanitized = sanitize_text_field($attachment[&#039;image-url&#039;]);\n    \tupdate_post_meta( $post[&#039;ID&#039;], &#039;nectar_image_gal_url&#039;, $image_url_sanitized );\n\t}\n\n\tif( isset( $attachment[&#039;masonry-image-sizing&#039;] ) ) {\n\t\t$masonry_image_sizing_sanitized = sanitize_text_field($attachment[&#039;masonry-image-sizing&#039;]);\n\t    update_post_meta( $post[&#039;ID&#039;], &#039;nectar_image_gal_masonry_sizing&#039;, $masonry_image_sizing_sanitized );\n\t}\n\n\tif( isset( $attachment[&#039;shape-bg-color&#039;] ) ) {\n\t\t$shape_bg_color_sanitized = sanitize_text_field($attachment[&#039;shape-bg-color&#039;]);\n\t    update_post_meta( $post[&#039;ID&#039;], &#039;nectar_particle_shape_bg_color&#039;, $shape_bg_color_sanitized );\n\t}\n\n\tif( isset( $attachment[&#039;shape-particle-color&#039;] ) ) {\n\t\t$shape_particle_color_sanitized = sanitize_text_field($attachment[&#039;shape-particle-color&#039;]);\n\t    update_post_meta( $post[&#039;ID&#039;], &#039;nectar_particle_shape_color&#039;, $shape_particle_color_sanitized );\n\t}\n\tif( isset( $attachment[&#039;shape-color-mapping&#039;] ) ) {\n\t\t$shape_color_mapping_sanitized = sanitize_text_field($attachment[&#039;shape-color-mapping&#039;]);\n\t    update_post_meta( $post[&#039;ID&#039;], &#039;nectar_particle_shape_color_mapping&#039;,$shape_color_mapping_sanitized );\n\t}\n\tif( isset( $attachment[&#039;shape-color-alpha&#039;] ) ) {\n\t\t$shape_color_alpha_sanitized = sanitize_text_field($attachment[&#039;shape-color-alpha&#039;]);\n\t    update_post_meta( $post[&#039;ID&#039;], &#039;nectar_particle_shape_color_alpha&#039;, $shape_color_alpha_sanitized );\n\t}\n\tif( isset( $attachment[&#039;shape-density&#039;] ) ) {\n\t\t$shape_density_sanitized = sanitize_text_field($attachment[&#039;shape-density&#039;]);\n\t    update_post_meta( $post[&#039;ID&#039;], &#039;nectar_particle_shape_density&#039;, $shape_density_sanitized );\n\t}\n\tif( isset( $attachment[&#039;shape-max-particle-size&#039;] ) ) {\n\t\t$shape_max_particle_size_sanitized = sanitize_text_field($attachment[&#039;shape-max-particle-size&#039;]);\n\t    update_post_meta( $post[&#039;ID&#039;], &#039;nectar_particle_max_particle_size&#039;, $shape_max_particle_size_sanitized );\n\t}\n    return $post;\n}\nadd_filter( &#039;attachment_fields_to_save&#039;, &#039;nectar_add_attachment_field_credit_save&#039;, 10, 2 );\n\n#-----------------------------------------------------------------#\n# Custom password form\n#-----------------------------------------------------------------#\n\nadd_filter( &#039;the_password_form&#039;, &#039;custom_password_form&#039; );\nfunction custom_password_form() {\n\tglobal $post;\n\t$post = get_post( $post );\n\t$label = &#039;pwbox-&#039; . ( empty($post-&gt;ID) ? rand() : $post-&gt;ID );\n\t$output = &#039;&lt;form action=&quot;&#039; . esc_url( site_url( &#039;wp-login.php?action=postpass&#039;, &#039;login_post&#039; ) ) . &#039;&quot; class=&quot;post-password-form&quot; method=&quot;post&quot;&gt;\n\t&lt;p&gt;&#039; . __( &#039;This content is password protected. To view it please enter your password below:&#039; ) . &#039;&lt;\/p&gt;\n\t&lt;p&gt;&lt;label for=&quot;&#039; . $label . &#039;&quot;&gt;&#039; . __( &#039;Password:&#039; ) . &#039; &lt;\/label&gt;  &lt;input name=&quot;post_password&quot; id=&quot;&#039; . $label . &#039;&quot; type=&quot;password&quot; size=&quot;20&quot; \/&gt;&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;&#039; . esc_attr__( &#039;Submit&#039; ) . &#039;&quot; \/&gt;&lt;\/p&gt;&lt;\/form&gt;&#039;;\n\treturn $output;\n}\n\n#-----------------------------------------------------------------#\n# Category Rel Fix\n#-----------------------------------------------------------------#\n\nfunction remove_category_list_rel( $output ) {\n    \/\/ Remove rel attribute from the category list\n    return str_replace( &#039; rel=&quot;category tag&quot;&#039;, &#039;&#039;, $output );\n}\n \nadd_filter( &#039;wp_list_categories&#039;, &#039;remove_category_list_rel&#039; );\nadd_filter( &#039;the_category&#039;, &#039;remove_category_list_rel&#039; );\n\n#-----------------------------------------------------------------#\n# Search related \n#-----------------------------------------------------------------#\n\nif(!function_exists(&#039;change_wp_search_size&#039;)){\n\tfunction change_wp_search_size($query) {\n\t\tif ( $query-&gt;is_search ) \n\t\t\t$query-&gt;query_vars[&#039;posts_per_page&#039;] = 12; \n\n\t\treturn $query; \n\t}\n}\nif(!is_admin()) {\n\tadd_filter(&#039;pre_get_posts&#039;, &#039;change_wp_search_size&#039;);\n}\n\n#-----------------------------------------------------------------#\n# Portfolio Exclude External \/ Custom Grid Content Projects From Next\/Prev \n#-----------------------------------------------------------------#\n\nif(!is_admin()) {\n\t$excluded_projects = array();\n\t$exlcuded_projects_string = &#039;&#039;;\n\t\t\t\t\t\t\t\t\t\n\t$portfolio = array( &#039;post_type&#039; =&gt; &#039;portfolio&#039;,&#039;posts_per_page&#039; =&gt; &#039;-1&#039;);\n\t$the_query = new WP_Query($portfolio);\n\t\n\tif ( $the_query-&gt;have_posts() ) {\n\t\twhile ( $the_query-&gt;have_posts() ) {\n\t\t\t$the_query-&gt;the_post();\n\t\t\t\n\t\t\t$custom_project_link = get_post_meta($post-&gt;ID, &#039;_nectar_external_project_url&#039;, true);\n\t\t\t$custom_content_project = get_post_meta($post-&gt;ID, &#039;_nectar_portfolio_custom_grid_item&#039;, true);\n\n\t\t\tif(!empty($custom_project_link) || !empty($custom_content_project) &amp;&amp; $custom_content_project == &#039;on&#039;) $excluded_projects[] = $post-&gt;ID;\n\t\t}\n\t\n\t\t\n\t\t$exlcuded_projects_string = implode(&quot;,&quot;, $excluded_projects);\n\t\t\n\t\tif(!empty($exlcuded_projects_string)){\n\t\t\tadd_filter( &#039;get_previous_post_where&#039;, &#039;so16495117_mod_adjacent_bis&#039; );\n\t\t\tadd_filter( &#039;get_next_post_where&#039;, &#039;so16495117_mod_adjacent_bis&#039; );\n\t\t}\n\t}\n\t\n\twp_reset_postdata();\n\t\n\tfunction so16495117_mod_adjacent_bis( $where ) {\n\t    global $wpdb;\n\t\tglobal $exlcuded_projects_string;\n\t    return $where . &quot; AND p.ID NOT IN ($exlcuded_projects_string)&quot;;\n\t}\t\n}\n\n#-----------------------------------------------------------------#\n# Nectar Options Panel Images \n#-----------------------------------------------------------------#\nif(!function_exists(&#039;fjarrett_get_attachment_id_from_url&#039;)){\n\tfunction fjarrett_get_attachment_id_from_url( $url ) {\n\t \n\t\t\/\/ Split the $url into two parts with the wp-content directory as the separator.\n\t\t$parse_url = explode( parse_url( WP_CONTENT_URL, PHP_URL_PATH ), $url );\n\t\t \n\t\t\/\/ Get the host of the current site and the host of the $url, ignoring www.\n\t\t$this_host = str_ireplace( &#039;www.&#039;, &#039;&#039;, parse_url( home_url(), PHP_URL_HOST ) );\n\t\t$file_host = str_ireplace( &#039;www.&#039;, &#039;&#039;, parse_url( $url, PHP_URL_HOST ) );\n\t\t \n\t\t\/\/ Return nothing if there aren&#039;t any $url parts or if the current host and $url host do not match.\n\t\tif ( ! isset( $parse_url[1] ) || empty( $parse_url[1] ) || ( $this_host != $file_host ) )\n\t\treturn;\n\t\t \n\t\t\/\/ Now we&#039;re going to quickly search the DB for any attachment GUID with a partial path match.\n\t\t\/\/ Example: \/uploads\/2013\/05\/test-image.jpg\n\t\tglobal $wpdb;\n\t\t \n\t\t$prefix = $wpdb-&gt;prefix;\n\t\t$attachment = $wpdb-&gt;get_col( $wpdb-&gt;prepare( &quot;SELECT ID FROM &quot; . $prefix . &quot;posts WHERE guid RLIKE %s;&quot;, $parse_url[1] ) );\n\t\t \n\t\treturn (!empty($attachment)) ? $attachment[0] : null;\n\t}\n}\n\nfunction nectar_options_img($image_arr_or_str){\n\n\t\/\/dummy data import from external\n\tif(isset($image_arr_or_str[&#039;thumbnail&#039;]) &amp;&amp; strpos($image_arr_or_str[&#039;thumbnail&#039;],&#039;http:\/\/themenectar.com&#039;) !== false &amp;&amp; $_SERVER[&#039;SERVER_NAME&#039;] != &#039;themenectar.com&#039;) {\n \t\treturn $image_arr_or_str[&#039;thumbnail&#039;];\n\t}\n\tif(isset($image_arr_or_str[&#039;thumbnail&#039;]) &amp;&amp; strpos($image_arr_or_str[&#039;thumbnail&#039;],&#039;https:\/\/source.unsplash.com&#039;) !== false &amp;&amp; $_SERVER[&#039;SERVER_NAME&#039;] != &#039;unsplash.com&#039;) {\n \t\treturn $image_arr_or_str[&#039;thumbnail&#039;];\n\t}\n\n\t\/\/check if URL or ID is passed\n\tif(isset($image_arr_or_str[&#039;id&#039;])) {\n\t\t$image = wp_get_attachment_image_src($image_arr_or_str[&#039;id&#039;], &#039;full&#039;);\n\t\treturn $image[0];\n\t} \n\n\telse if (isset($image_arr_or_str[&#039;url&#039;])) {\n\t\treturn $image_arr_or_str[&#039;url&#039;];\n\t} \n\n\telse {\n\t\t\n\t\t$image_id = fjarrett_get_attachment_id_from_url( $image_arr_or_str );\n\n\t\tif(!is_null($image_id) &amp;&amp; !empty($image_id)) { \n\t\t\t$image = wp_get_attachment_image_src($image_id, &#039;full&#039;);\n\t\t\treturn $image[0];\n\t\t} else {\n\t\t\treturn $image_arr_or_str;\n\t\t}\n\t}\n}\n\n$nectar_is_ssl = is_ssl();\n\nfunction nectar_ssl_check($src) {\n\t\n\tglobal $nectar_is_ssl;\n\n\tif(strpos($src,&#039;http:\/\/&#039;) !== false  &amp;&amp; $nectar_is_ssl == true) {\n\t\t$converted_start = str_replace(&#039;http:\/\/&#039;, &#039;https:\/\/&#039;, $src ); \n\t\treturn $converted_start;\n\t}\n\t\n\telse \n\t\treturn $src;\n}\t\n\n#-----------------------------------------------------------------#\n# Current Page Url\n#-----------------------------------------------------------------#\nif(!function_exists(&#039;current_page_url&#039;)){\n\tfunction current_page_url() {\n\t\t$pageURL = &#039;http&#039;;\n\t\tif( isset($_SERVER[&quot;HTTPS&quot;]) ) {\n\t\t\tif ($_SERVER[&quot;HTTPS&quot;] == &quot;on&quot;) {$pageURL .= &quot;s&quot;;}\n\t\t}\n\t\t$pageURL .= &quot;:\/\/&quot;;\n\t\tif ($_SERVER[&quot;SERVER_PORT&quot;] != &quot;80&quot;) {\n\t\t\t$pageURL .= $_SERVER[&quot;SERVER_NAME&quot;].&quot;:&quot;.$_SERVER[&quot;SERVER_PORT&quot;].$_SERVER[&quot;REQUEST_URI&quot;];\n\t\t} else {\n\t\t\t$pageURL .= $_SERVER[&quot;SERVER_NAME&quot;].$_SERVER[&quot;REQUEST_URI&quot;];\n\t\t}\n\t\treturn $pageURL;\n\t}\n}\n#-----------------------------------------------------------------#\n# Options panel\n#-----------------------------------------------------------------#\n\n$using_nectar_redux_framework = false;\n\nif ( !class_exists( &#039;ReduxFramework&#039; ) &amp;&amp; file_exists( dirname( __FILE__ ) . &#039;\/nectar\/redux-framework\/ReduxCore\/framework.php&#039; ) ) {\n    require_once( dirname( __FILE__ ) . &#039;\/nectar\/redux-framework\/ReduxCore\/framework.php&#039; );\n    $using_nectar_redux_framework = true;\n}\nif ( !isset( $redux_demo ) &amp;&amp; file_exists( dirname( __FILE__ ) . &#039;\/nectar\/redux-framework\/options-config.php&#039; ) ) {\n    require_once( dirname( __FILE__ ) . &#039;\/nectar\/redux-framework\/options-config.php&#039; );\n}\n\n\/\/add nectar redux styling\/custom deps\nfunction nectar_redux_deps($hook_suffix) {\n\tglobal $using_nectar_redux_framework;\n\tif ( strstr($hook_suffix,&#039;Salient&#039;) || strstr($hook_suffix,&#039;salient&#039;) ) {\n\n\t\twp_enqueue_style(&#039;nectar_redux_admin_style&#039;, get_template_directory_uri() .&#039;\/nectar\/redux-framework\/ReduxCore\/assets\/css\/salient-redux-styling.css&#039;, array(), &#039;8.0.1&#039;, &#039;all&#039;);\n\t\t\n\t\tif($using_nectar_redux_framework == false) {\n\t\t\twp_enqueue_style(&#039;nectar_redux_select_2&#039;, get_template_directory_uri() .&#039;\/nectar\/redux-framework\/extensions\/vendor_support\/vendor\/select2\/select2.css&#039;, array(), time(), &#039;all&#039;);\n\t\t\twp_enqueue_script(&#039;nectar_redux_ace&#039;, get_template_directory_uri() .&#039;\/nectar\/redux-framework\/extensions\/vendor_support\/vendor\/ace_editor\/ace.js&#039;, array(), time(), &#039;all&#039;);\n\t\t}\n\n\t}\n}\nadd_action(&#039;admin_enqueue_scripts&#039;, &#039;nectar_redux_deps&#039;);\n\nfunction nectar_removeDemoModeLink() { \n    if ( class_exists(&#039;ReduxFrameworkPlugin&#039;) ) {\n        remove_filter( &#039;plugin_row_meta&#039;, array( ReduxFrameworkPlugin::get_instance(), &#039;plugin_metalinks&#039;), null, 2 );\n    }\n    if ( class_exists(&#039;ReduxFrameworkPlugin&#039;) ) {\n        remove_action(&#039;admin_notices&#039;, array( ReduxFrameworkPlugin::get_instance(), &#039;admin_notices&#039; ) );    \n    }\n}\n\nif (is_admin()) {\n\n\tadd_action(&#039;init&#039;, &#039;nectar_removeDemoModeLink&#039;);\n\n\tadd_action( &#039;admin_menu&#039;, &#039;remove_redux_menu&#039;,12 );\n\tfunction remove_redux_menu() {\n\t    remove_submenu_page(&#039;tools.php&#039;,&#039;redux-about&#039;);\n\t}\n\n\tif( !function_exists(&#039;nectar_admin_lovelo_font&#039;)) {\n\t\tfunction nectar_admin_lovelo_font(){\n\t\t\techo &quot;\n\t\t\t&lt;!-- A font fabric font - http:\/\/fontfabric.com\/lovelo-font\/ --&gt;\n\t\t\t&lt;style&gt; @font-face { font-family: &#039;Lovelo&#039;; src: url(&#039;&quot;.get_template_directory_uri().&quot;\/css\/fonts\/Lovelo_Black.eot&#039;); src: url(&#039;&quot;.get_template_directory_uri().&quot;\/css\/fonts\/Lovelo_Black.eot?#iefix&#039;) format(&#039;embedded-opentype&#039;), url(&#039;&quot;.get_template_directory_uri().&quot;\/css\/fonts\/Lovelo_Black.woff&#039;) format(&#039;woff&#039;),  url(&#039;&quot;.get_template_directory_uri().&quot;\/css\/fonts\/Lovelo_Black.ttf&#039;) format(&#039;truetype&#039;), url(&#039;&quot;.get_template_directory_uri().&quot;\/css\/fonts\/Lovelo_Black.svg#loveloblack&#039;) format(&#039;svg&#039;); font-weight: normal; font-style: normal; } &lt;\/style&gt;&quot;;\n\t\t}\n\t}\n\tadd_action(&#039;admin_head&#039;, &#039;nectar_admin_lovelo_font&#039;);\t\n\n}\n\n\t\n\n\t\n\n\/\/helper function to grab theme options - to not break legacy users that are upgrading\nfunction get_nectar_theme_options() {\n\n\t$legacy_options = get_option(&#039;salient&#039;);\n\t$current_options = get_option(&#039;salient_redux&#039;);\n\n\t\/\/use new options\n\tif(!empty($current_options)) {\n\t\treturn $current_options;\n\t} else if(!empty($legacy_options)) {\n\t\treturn $legacy_options;\n\t} else {\n\t\treturn $current_options;\n\t}\n}\n\nif (!function_exists(&#039;nectar_logo_output&#039;)) {\n\tfunction nectar_logo_output($activate_transparency = false, $off_canvas_style = &#039;slide-out-from-right&#039;) {\n\t\t\n\t\tglobal $options;\n\n\t\tif(!empty($options[&#039;use-logo&#039;])) {\n\t\t\t\n\t\t\t$default_logo_class = ( !empty($options[&#039;retina-logo&#039;][&#039;id&#039;]) || !empty($options[&#039;retina-logo&#039;][&#039;url&#039;]) ) ? &#039;default-logo&#039; : null;\n\t\t\t$dark_default_class = ( empty($options[&#039;header-starting-logo-dark&#039;][&#039;id&#039;]) &amp;&amp; empty($options[&#039;header-starting-logo-dark&#039;][&#039;url&#039;]) ) ? &#039; dark-version&#039;: null; \n\n\t\t\t$std_retina_srcset = null;\n\t\t\tif( !empty($options[&#039;retina-logo&#039;][&#039;id&#039;]) || !empty($options[&#039;retina-logo&#039;][&#039;url&#039;]) ) {\n\t\t\t\t$std_retina_srcset = &#039;srcset=&quot;&#039;.nectar_options_img($options[&#039;logo&#039;]).&#039; 1x, &#039;. nectar_options_img($options[&#039;retina-logo&#039;]) .&#039; 2x&quot;&#039;;\n\t\t\t}\n\n\t\t\t echo &#039;&lt;img class=&quot;stnd &#039;.$default_logo_class. $dark_default_class.&#039;&quot; alt=&quot;&#039;. get_bloginfo(&#039;name&#039;) .&#039;&quot; src=&quot;&#039; . nectar_options_img($options[&#039;logo&#039;]) . &#039;&quot; &#039;.$std_retina_srcset.&#039; \/&gt;&#039;;\n\t\t\t \n\t\t \t \n\t\t\t \/\/starting logo \n\t\t\t if($activate_transparency == &#039;true&#039; || $off_canvas_style == &#039;fullscreen-alt&#039;){\n\n\t\t\t \t$starting_retina_srcset = null;\n\t\t\t\tif( !empty($options[&#039;header-starting-retina-logo&#039;][&#039;id&#039;]) || !empty($options[&#039;header-starting-retina-logo&#039;][&#039;url&#039;]) ) {\n\t\t\t\t\t$starting_retina_srcset = &#039;srcset=&quot;&#039;.nectar_options_img($options[&#039;header-starting-logo&#039;]).&#039; 1x, &#039;. nectar_options_img($options[&#039;header-starting-retina-logo&#039;]) .&#039; 2x&quot;&#039;;\n\t\t\t\t}\n\n\t\t\t \tif( !empty($options[&#039;header-starting-logo&#039;][&#039;id&#039;]) || !empty($options[&#039;header-starting-logo&#039;][&#039;url&#039;]) ) echo &#039;&lt;img class=&quot;starting-logo &#039;.$default_logo_class.&#039;&quot;  alt=&quot;&#039;. get_bloginfo(&#039;name&#039;) .&#039;&quot; src=&quot;&#039; . nectar_options_img($options[&#039;header-starting-logo&#039;]) . &#039;&quot; &#039;.$starting_retina_srcset.&#039; \/&gt;&#039;;\n\t\t\t\t\n\n\t\t\t \t$starting_dark_retina_srcset = null;\n\t\t\t\tif( !empty($options[&#039;header-starting-retina-logo-dark&#039;][&#039;id&#039;]) || !empty($options[&#039;header-starting-retina-logo-dark&#039;][&#039;url&#039;]) ) {\n\t\t\t\t\t$starting_dark_retina_srcset = &#039;srcset=&quot;&#039;.nectar_options_img($options[&#039;header-starting-logo-dark&#039;]).&#039; 1x, &#039;. nectar_options_img($options[&#039;header-starting-retina-logo-dark&#039;]) .&#039; 2x&quot;&#039;;\n\t\t\t\t}\n\n\t\t\t\tif( !empty($options[&#039;header-starting-logo-dark&#039;][&#039;id&#039;]) || !empty($options[&#039;header-starting-logo-dark&#039;][&#039;url&#039;]) ) echo &#039;&lt;img class=&quot;starting-logo dark-version &#039;.$default_logo_class.&#039;&quot;  alt=&quot;&#039;. get_bloginfo(&#039;name&#039;) .&#039;&quot; src=&quot;&#039; . nectar_options_img($options[&#039;header-starting-logo-dark&#039;]) . &#039;&quot; &#039;.$starting_dark_retina_srcset.&#039; \/&gt;&#039;;\n\t\t\t\t \n\t\t\t }\n\t\t\t \n\t\t } else { echo get_bloginfo(&#039;name&#039;); }\n\t}\n}\n\nfunction nectar_get_full_page_options() {\n\n\tglobal $post;\n\t\n\t$page_full_screen_rows = (isset($post-&gt;ID)) ? get_post_meta($post-&gt;ID, &#039;_nectar_full_screen_rows&#039;, true) : &#039;&#039;;\n\t$page_full_screen_rows_animation = (isset($post-&gt;ID)) ? get_post_meta($post-&gt;ID, &#039;_nectar_full_screen_rows_animation&#039;, true) : &#039;&#039;;\n\t$page_full_screen_rows_animation_speed = (isset($post-&gt;ID)) ? get_post_meta($post-&gt;ID, &#039;_nectar_full_screen_rows_animation_speed&#039;, true) : &#039;&#039;;\n\t$page_full_screen_rows_anchors = (isset($post-&gt;ID)) ? get_post_meta($post-&gt;ID, &#039;_nectar_full_screen_rows_anchors&#039;, true) : &#039;&#039;;\n\t$page_full_screen_rows_dot_navigation = (isset($post-&gt;ID)) ? get_post_meta($post-&gt;ID, &#039;_nectar_full_screen_rows_dot_navigation&#039;, true) : &#039;&#039;;\n\t$page_full_screen_rows_footer = (isset($post-&gt;ID)) ? get_post_meta($post-&gt;ID, &#039;_nectar_full_screen_rows_footer&#039;, true) : &#039;&#039;;\n\t$page_full_screen_rows_content_overflow = (isset($post-&gt;ID)) ? get_post_meta($post-&gt;ID, &#039;_nectar_full_screen_rows_content_overflow&#039;, true) : &#039;&#039;;\n\t$page_full_screen_rows_bg_img_animation = (isset($post-&gt;ID)) ? get_post_meta($post-&gt;ID, &#039;_nectar_full_screen_rows_row_bg_animation&#039;, true) : &#039;&#039;; \n\t$page_full_screen_rows_mobile_disable = (isset($post-&gt;ID)) ? get_post_meta($post-&gt;ID, &#039;_nectar_full_screen_rows_mobile_disable&#039;, true) : &#039;&#039;; \n\n\t$nectar_full_page_options = array(\n\t\t&#039;page_full_screen_rows&#039; =&gt; $page_full_screen_rows,\n\t\t&#039;page_full_screen_rows_animation&#039; =&gt; $page_full_screen_rows_animation,\n\t\t&#039;page_full_screen_rows_animation_speed&#039; =&gt; $page_full_screen_rows_animation_speed,\n\t\t&#039;page_full_screen_rows_anchors&#039; =&gt; $page_full_screen_rows_anchors,\n\t\t&#039;page_full_screen_rows_dot_navigation&#039; =&gt; $page_full_screen_rows_dot_navigation,\n\t\t&#039;page_full_screen_rows_footer&#039; =&gt; $page_full_screen_rows_footer,\n\t\t&#039;page_full_screen_rows_content_overflow&#039; =&gt; $page_full_screen_rows_content_overflow,\n\t\t&#039;page_full_screen_rows_bg_img_animation&#039; =&gt; $page_full_screen_rows_bg_img_animation,\n\t\t&#039;page_full_screen_rows_mobile_disable&#039; =&gt; $page_full_screen_rows_mobile_disable\n\t);\n\n\treturn $nectar_full_page_options;\n}\n\nfunction nectar_header_social_icons($location) {\n\tglobal $options;\n\n\t$social_networks = array(\n\t\t&#039;twitter&#039; =&gt; &#039;fa fa-twitter&#039;,\n\t\t&#039;facebook&#039; =&gt; &#039;fa fa-facebook&#039;,\n\t\t&#039;vimeo&#039; =&gt; &#039;fa fa-vimeo&#039;,\n\t\t&#039;pinterest&#039; =&gt; &#039;fa fa-pinterest&#039;,\n\t\t&#039;linkedin&#039; =&gt; &#039;fa fa-linkedin&#039;,\n\t\t&#039;youtube&#039; =&gt; &#039;fa fa-youtube-play&#039;,\n\t\t&#039;tumblr&#039; =&gt; &#039;fa fa-tumblr&#039;,\n\t\t&#039;dribbble&#039; =&gt; &#039;fa fa-dribbble&#039;,\n\t\t&#039;rss&#039; =&gt; &#039;fa fa-rss&#039;,\n\t\t&#039;github&#039; =&gt; &#039;fa fa-github-alt&#039;,\n\t\t&#039;google-plus&#039; =&gt; &#039;fa fa-google-plus&#039;,\n\t\t&#039;instagram&#039; =&gt; &#039;fa fa-instagram&#039;,\n\t\t&#039;stackexchange&#039; =&gt; &#039;fa fa-stackexchange&#039;,\n\t\t&#039;soundcloud&#039; =&gt; &#039;fa fa-soundcloud&#039;,\n\t\t&#039;flickr&#039; =&gt; &#039;fa fa-flickr&#039;,\n\t\t&#039;spotify&#039; =&gt; &#039;icon-salient-spotify&#039;,\n\t\t&#039;vk&#039; =&gt; &#039;fa fa-vk&#039;,\n\t\t&#039;vine&#039; =&gt; &#039;fa fa-vine&#039;,\n\t\t&#039;behance&#039; =&gt; &#039;fa fa-behance&#039;\n\t);\n\t$social_output_html = &#039;&#039;;\n\n\tif($location == &#039;main-nav&#039;) {\n\t\t$social_link_before = &#039;&#039;;\n\t\t$social_link_after = &#039;&#039;;\n\t} else {\n\t\t$social_link_before = &#039;&lt;li&gt;&#039;;\n\t\t$social_link_after = &#039;&lt;\/li&gt;&#039;;\n\t}\n\n\tif($location == &#039;secondary-nav&#039;)\n\t\t$social_output_html .= &#039;&lt;ul id=&quot;social&quot;&gt;&#039;;\n\n\t\tforeach($social_networks as $network_name =&gt; $icon_class) {\n\t\t\t\n\t\t\tif($network_name == &#039;rss&#039;) {\n\t\t\t\tif(!empty($options[&#039;use-&#039;.$network_name.&#039;-icon-header&#039;]) &amp;&amp; $options[&#039;use-&#039;.$network_name.&#039;-icon-header&#039;] == 1) {\n\t\t\t\t\t$nectar_rss_url_link = (!empty($options[&#039;rss-url&#039;])) ? $options[&#039;rss-url&#039;] : get_bloginfo(&#039;rss_url&#039;);\n\t\t\t\t\t$social_output_html .= $social_link_before.&#039;&lt;a target=&quot;_blank&quot; href=&quot;&#039;.$nectar_rss_url_link.&#039;&quot;&gt;&lt;i class=&quot;&#039;.$icon_class.&#039;&quot;&gt;&lt;\/i&gt; &lt;\/a&gt;&#039;.$social_link_after;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(!empty($options[&#039;use-&#039;.$network_name.&#039;-icon-header&#039;]) &amp;&amp; $options[&#039;use-&#039;.$network_name.&#039;-icon-header&#039;] == 1) \n\t\t\t\t\t$social_output_html .= $social_link_before.&#039;&lt;a target=&quot;_blank&quot; href=&quot;&#039;.$options[$network_name.&quot;-url&quot;].&#039;&quot;&gt;&lt;i class=&quot;&#039;.$icon_class.&#039;&quot;&gt;&lt;\/i&gt; &lt;\/a&gt;&#039;.$social_link_after;\n\t\t\t}\n\t\t}\n\n\tif($location == &#039;secondary-nav&#039;)\t\n\t\t$social_output_html .= &#039;&lt;\/ul&gt;&#039;;\n\n\techo $social_output_html;\n}\n\n#-----------------------------------------------------------------#\n# Nectar love\n#-----------------------------------------------------------------#\n\nrequire_once ( &#039;nectar\/love\/nectar-love.php&#039; );\n\nfunction GetGooglePlusShares($url) {\n\tif(function_exists(&#039;curl_exec&#039;) &amp;&amp; !empty($url)) {\n\t\t$curl = curl_init();\n\t\tcurl_setopt($curl, CURLOPT_URL, &quot;https:\/\/clients6.google.com\/rpc&quot;);\n\t\tcurl_setopt($curl, CURLOPT_POST, 1);\n\t\tcurl_setopt($curl, CURLOPT_POSTFIELDS, &#039;[{&quot;method&quot;:&quot;pos.plusones.get&quot;,&quot;id&quot;:&quot;p&quot;,&quot;params&quot;:{&quot;nolog&quot;:true,&quot;id&quot;:&quot;&#039; . $url . &#039;&quot;,&quot;source&quot;:&quot;widget&quot;,&quot;userId&quot;:&quot;@viewer&quot;,&quot;groupId&quot;:&quot;@self&quot;},&quot;jsonrpc&quot;:&quot;2.0&quot;,&quot;key&quot;:&quot;p&quot;,&quot;apiVersion&quot;:&quot;v1&quot;}]&#039;);\n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($curl, CURLOPT_HTTPHEADER, array(&#039;Content-type: application\/json&#039;));\n\t\t$curl_results = curl_exec($curl);\n\t\tcurl_close ($curl);\n\t\t$json = json_decode($curl_results, true);\n\t\treturn intval( $json[0][&#039;result&#039;][&#039;metadata&#039;][&#039;globalCounts&#039;][&#039;count&#039;] );\n\t} else {\n\t\treturn 0;\n\t}\n}\n\n#-----------------------------------------------------------------#\n# Page meta\n#-----------------------------------------------------------------# \n\ninclude(&quot;nectar\/meta\/page-meta.php&quot;);\n\n$nectar_disable_home_slider = (!empty($options[&#039;disable_home_slider_pt&#039;]) &amp;&amp; $options[&#039;disable_home_slider_pt&#039;] == &#039;1&#039;) ? true : false; \n$nectar_disable_nectar_slider = (!empty($options[&#039;disable_nectar_slider_pt&#039;]) &amp;&amp; $options[&#039;disable_nectar_slider_pt&#039;] == &#039;1&#039;) ? true : false; \n\n#-----------------------------------------------------------------#\n# Create admin slider section\n#-----------------------------------------------------------------# \nfunction slider_register() {  \n    \n\t$labels = array(\n\t \t&#039;name&#039; =&gt; __( &#039;Slides&#039;, &#039;taxonomy general name&#039;, NECTAR_THEME_NAME),\n\t\t&#039;singular_name&#039; =&gt; __( &#039;Slide&#039;, NECTAR_THEME_NAME),\n\t\t&#039;search_items&#039; =&gt;  __( &#039;Search Slides&#039;, NECTAR_THEME_NAME),\n\t\t&#039;all_items&#039; =&gt; __( &#039;All Slides&#039;, NECTAR_THEME_NAME),\n\t\t&#039;parent_item&#039; =&gt; __( &#039;Parent Slide&#039;, NECTAR_THEME_NAME),\n\t\t&#039;edit_item&#039; =&gt; __( &#039;Edit Slide&#039;, NECTAR_THEME_NAME),\n\t\t&#039;update_item&#039; =&gt; __( &#039;Update Slide&#039;, NECTAR_THEME_NAME),\n\t\t&#039;add_new_item&#039; =&gt; __( &#039;Add New Slide&#039;, NECTAR_THEME_NAME),\n\t    &#039;menu_name&#039; =&gt; __( &#039;Home Slider&#039;, NECTAR_THEME_NAME)\n\t );\n\t \n\t $homeslider_menu_icon = (floatval(get_bloginfo(&#039;version&#039;)) &gt;= &quot;3.8&quot;) ? &#039;dashicons-admin-home&#039; : NECTAR_FRAMEWORK_DIRECTORY . &#039;assets\/img\/icons\/home-slider.png&#039;;\n\t \n\t $args = array(\n\t\t\t&#039;labels&#039; =&gt; $labels,\n\t\t\t&#039;singular_label&#039; =&gt; __(&#039;Home Slider&#039;, NECTAR_THEME_NAME),\n\t\t\t&#039;public&#039; =&gt; true,\n\t\t\t&#039;show_ui&#039; =&gt; true,\n\t\t\t&#039;hierarchical&#039; =&gt; false,\n\t\t\t&#039;menu_position&#039; =&gt; 10,\n\t\t\t&#039;menu_icon&#039; =&gt; $homeslider_menu_icon,\n\t\t\t&#039;exclude_from_search&#039; =&gt; true,\n\t\t\t&#039;supports&#039; =&gt; false\n       );  \n   \n    register_post_type( &#039;home_slider&#039; , $args );  \n}  \n\nif($nectar_disable_home_slider != true) {\n\tadd_action(&#039;init&#039;, &#039;slider_register&#039;);\n}\n\n#-----------------------------------------------------------------#\n# Custom slider columns\n#-----------------------------------------------------------------# \n\nif($nectar_disable_home_slider != true) { \n\tadd_filter(&#039;manage_edit-home_slider_columns&#039;, &#039;edit_columns_home_slider&#039;);  \n}\n\nfunction edit_columns_home_slider($columns){  \n\t$column_thumbnail = array( &#039;thumbnail&#039; =&gt; &#039;Thumbnail&#039; );\n\t$column_caption = array( &#039;caption&#039; =&gt; &#039;Caption&#039; );\n\t$columns = array_slice( $columns, 0, 1, true ) + $column_thumbnail + array_slice( $columns, 1, NULL, true );\n\t$columns = array_slice( $columns, 0, 2, true ) + $column_caption + array_slice( $columns, 2, NULL, true );\n\treturn $columns;\n}  \n  \n \nif($nectar_disable_home_slider != true) { \n\tadd_action(&#039;manage_home_slider_posts_custom_column&#039;,  &#039;home_slider_custom_columns&#039;, 10, 2);   \n}\n\nfunction home_slider_custom_columns($portfolio_columns, $post_id){  \n\n\tswitch ($portfolio_columns) {\n\t    case &#039;thumbnail&#039;:\n\t        $thumbnail = get_post_meta($post_id, &#039;_nectar_slider_image&#039;, true);\n\t        \n\t        if( !empty($thumbnail) ) {\n\t            echo &#039;&lt;a href=&quot;&#039;.get_admin_url() . &#039;post.php?post=&#039; . $post_id.&#039;&amp;action=edit&quot;&gt;&lt;img class=&quot;slider-thumb&quot; src=&quot;&#039; . $thumbnail . &#039;&quot; \/&gt;&lt;\/a&gt;&#039;;\n\t        } else {\n\t            echo &#039;&lt;a href=&quot;&#039;.get_admin_url() . &#039;post.php?post=&#039; . $post_id.&#039;&amp;action=edit&quot;&gt;&lt;img class=&quot;slider-thumb&quot; src=&quot;&#039; . NECTAR_FRAMEWORK_DIRECTORY . &#039;assets\/img\/slider-default-thumb.jpg&quot; \/&gt;&lt;\/a&gt;&#039; .\n\t                 &#039;&lt;strong&gt;&lt;a class=&quot;row-title&quot; href=&quot;&#039;.get_admin_url() . &#039;post.php?post=&#039; . $post_id.&#039;&amp;action=edit&quot;&gt;No image added yet&lt;\/a&gt;&lt;\/strong&gt;&#039;;\n\t        }\n\t    break; \n\t\t\n\t\tcase &#039;caption&#039;:\n\t\t\t$caption = get_post_meta($post_id, &#039;_nectar_slider_caption&#039;, true);\n\t        echo $caption;\n\t    break;  \n\t\t\n\t\t   \n\t\tdefault:\n\t\t\tbreak;\n\t}  \n}  \n\nif($nectar_disable_home_slider != true) {\n\tadd_action( &#039;admin_menu&#039;, &#039;nectar_home_slider_ordering&#039; );\n}\n\nfunction nectar_home_slider_ordering() {\n\tadd_submenu_page(\n\t\t&#039;edit.php?post_type=home_slider&#039;,\n\t\t&#039;Order Slides&#039;,\n\t\t&#039;Order&#039;, \n\t\t&#039;edit_pages&#039;, &#039;slide-order&#039;,\n\t\t&#039;nectar_home_slider_order_page&#039;\n\t);\n}\n\nfunction nectar_home_slider_order_page(){ ?&gt;\n\t\n\t&lt;div class=&quot;wrap&quot;&gt;\n\t\t&lt;h2&gt;&lt;?php echo __(&#039;Sort Slides&#039;, NECTAR_THEME_NAME); ?&gt;&lt;\/h2&gt;\n\t\t&lt;p&gt;&lt;?php echo __(&#039;Simply drag the slide up or down and they will be saved in that order.&#039;, NECTAR_THEME_NAME); ?&gt;&lt;\/p&gt;\n\t&lt;?php $slides = new WP_Query( array( &#039;post_type&#039; =&gt; &#039;home_slider&#039;, &#039;posts_per_page&#039; =&gt; -1, &#039;order&#039; =&gt; &#039;ASC&#039;, &#039;orderby&#039; =&gt; &#039;menu_order&#039; ) ); ?&gt;\n\t&lt;?php if( $slides-&gt;have_posts() ) : ?&gt;\n\t\t\n\t\t&lt;?php wp_nonce_field( basename(__FILE__), &#039;nectar_meta_box_nonce&#039; ); ?&gt;\n\t\t\n\t\t&lt;table class=&quot;wp-list-table widefat fixed posts&quot; id=&quot;sortable-table&quot;&gt;\n\t\t\t&lt;thead&gt;\n\t\t\t\t&lt;tr&gt;\n\t\t\t\t\t&lt;th class=&quot;column-order&quot;&gt;&lt;?php echo __(&#039;Order&#039;, NECTAR_THEME_NAME); ?&gt;&lt;\/th&gt;\n\t\t\t\t\t&lt;th class=&quot;manage-column column-thumbnail&quot;&gt;&lt;?php echo __(&#039;Image&#039;, NECTAR_THEME_NAME); ?&gt;&lt;\/th&gt;\n\t\t\t\t\t&lt;th class=&quot;manage-column column-caption&quot;&gt;&lt;?php echo __(&#039;Caption&#039;, NECTAR_THEME_NAME); ?&gt;&lt;\/th&gt;\n\t\t\t\t&lt;\/tr&gt;\n\t\t\t&lt;\/thead&gt;\n\t\t\t&lt;tbody data-post-type=&quot;home_slider&quot;&gt;\n\t\t\t&lt;?php while( $slides-&gt;have_posts() ) : $slides-&gt;the_post(); ?&gt;\n\t\t\t\t&lt;tr id=&quot;post-&lt;?php the_ID(); ?&gt;&quot;&gt;\n\t\t\t\t\t&lt;td class=&quot;column-order&quot;&gt;&lt;img src=&quot;&lt;?php echo NECTAR_FRAMEWORK_DIRECTORY . &#039;assets\/img\/sortable.png&#039;; ?&gt;&quot; title=&quot;&quot; alt=&quot;Move Icon&quot; width=&quot;25&quot; height=&quot;25&quot; class=&quot;&quot; \/&gt;&lt;\/td&gt;\n\t\t\t\t\t&lt;td class=&quot;thumbnail column-thumbnail&quot;&gt;\n\t\t\t\t\t\t&lt;?php \n\t\t\t\t\t\tglobal $post;\n\t\t\t\t\t\t$thumbnail = get_post_meta($post-&gt;ID, &#039;_nectar_slider_image&#039;, true);\n\t        \n\t\t\t\t        if( !empty($thumbnail) ) {\n\t\t\t\t           echo &#039;&lt;img class=&quot;slider-thumb&quot; src=&quot;&#039; . $thumbnail . &#039;&quot; \/&gt;&#039; ;\n\t\t\t\t        } \n\t\t\t\t        else {\n\t\t\t\t            echo &#039;&lt;img class=&quot;slider-thumb&quot; src=&quot;&#039; . NECTAR_FRAMEWORK_DIRECTORY . &#039;assets\/img\/slider-default-thumb.jpg&quot; \/&gt;&#039; .\n\t\t\t\t                 &#039;&lt;strong&gt;No image added yet&lt;\/strong&gt;&#039;;\n\t\t\t\t        } ?&gt;\n\t\t\t\t\t\t\n\t\t\t\t\t&lt;\/td&gt;\n\t\t\t\t\t&lt;td class=&quot;caption column-caption&quot;&gt;\n\t\t\t\t\t\t&lt;?php \n\t\t\t\t\t\t$caption = get_post_meta($post-&gt;ID, &#039;_nectar_slider_caption&#039;, true);\n\t        \t\t\techo $caption; ?&gt;\n\t\t\t\t\t&lt;\/td&gt;\n\t\t\t\t&lt;\/tr&gt;\n\t\t\t&lt;?php endwhile; ?&gt;\n\t\t\t&lt;\/tbody&gt;\n\t\t\t&lt;tfoot&gt;\n\t\t\t\t&lt;tr&gt;\n\t\t\t\t\t&lt;th class=&quot;column-order&quot;&gt;&lt;?php echo __(&#039;Order&#039;, NECTAR_THEME_NAME); ?&gt;&lt;\/th&gt;\n\t\t\t\t\t&lt;th class=&quot;manage-column column-thumbnail&quot;&gt;&lt;?php echo __(&#039;Image&#039;, NECTAR_THEME_NAME); ?&gt;&lt;\/th&gt;\n\t\t\t\t\t&lt;th class=&quot;manage-column column-caption&quot;&gt;&lt;?php echo __(&#039;Caption&#039;, NECTAR_THEME_NAME); ?&gt;&lt;\/th&gt;\n\t\t\t\t&lt;\/tr&gt;\n\t\t\t&lt;\/tfoot&gt;\n\n\t\t&lt;\/table&gt;\n\n\t&lt;?php else: ?&gt;\n\n\t\t&lt;p&gt;No slides found, why not &lt;a href=&quot;post-new.php?post_type=home_slider&quot;&gt;create one?&lt;\/a&gt;&lt;\/p&gt;\n\n\t&lt;?php endif; ?&gt;\n\t&lt;?php wp_reset_postdata(); ?&gt;\n\n\t&lt;\/div&gt;&lt;!-- .wrap --&gt;\n\t\n&lt;?php }\n\nif($nectar_disable_home_slider != true) {\n\tadd_action( &#039;admin_enqueue_scripts&#039;, &#039;home_slider_enqueue_scripts&#039; );\n}\n\nfunction home_slider_enqueue_scripts() {\n\tglobal $typenow;\n    if( &#039;home_slider&#039; == $typenow ) {\n\t\twp_enqueue_script( &#039;jquery-ui-sortable&#039; );\n\t\twp_enqueue_script( &#039;nectar-reorder&#039;, NECTAR_FRAMEWORK_DIRECTORY . &#039;assets\/js\/nectar-reorder.js&#039; );\n\t}\n}\n\nadd_action( &#039;wp_ajax_nectar_update_slide_order&#039;, &#039;nectar_update_slide_order&#039; );\n\n\/\/slide order ajax callback \nfunction nectar_update_slide_order() {\n\t\n\t    global $wpdb;\n\t \t\n\n\t    $post_type     = sanitize_text_field($_POST[&#039;postType&#039;]);\n\t    $order        = $_POST[&#039;order&#039;];\n\t\t\n\t\tif (  !isset($_POST[&#039;nectar_meta_box_nonce&#039;]) || !wp_verify_nonce( $_POST[&#039;nectar_meta_box_nonce&#039;], basename( __FILE__ ) ) )\n\t\t\treturn;\n\t\t\n\t    foreach( $order as $menu_order =&gt; $post_id ) {\n\t        $post_id         = intval( str_ireplace( &#039;post-&#039;, &#039;&#039;, $post_id ) );\n\t        $menu_order     = intval($menu_order);\n\t\t\t\n\t        wp_update_post( array( &#039;ID&#039; =&gt; stripslashes(htmlspecialchars($post_id)), &#039;menu_order&#039; =&gt; stripslashes(htmlspecialchars($menu_order)) ) );\n    \t}\n \n\t    die( &#039;1&#039; );\n}\n\n\/\/order the default home slider page correctly \nfunction set_home_slider_admin_order($wp_query) {  \n   \n  \n    $post_type = $wp_query-&gt;query[&#039;post_type&#039;];  \n  \n    if ( $post_type == &#039;home_slider&#039;) {  \n   \n      $wp_query-&gt;set(&#039;orderby&#039;, &#039;menu_order&#039;);  \n      $wp_query-&gt;set(&#039;order&#039;, &#039;ASC&#039;);  \n    }  \n    \n}  \n\nif (is_admin() &amp;&amp; $nectar_disable_home_slider != true) { \n\tadd_filter(&#039;pre_get_posts&#039;, &#039;set_home_slider_admin_order&#039;); \n}\n\n#-----------------------------------------------------------------#\n# Home slider meta\n#-----------------------------------------------------------------# \n\nif($nectar_disable_home_slider != true) {\n\tinclude(&quot;nectar\/meta\/home-slider-meta.php&quot;);\n}\n\n \n\n#-----------------------------------------------------------------#\n# Create nectar slider section\n#-----------------------------------------------------------------# \nfunction nectar_slider_register() {  \n    \n\t$labels = array(\n\t \t&#039;name&#039; =&gt; __( &#039;Slides&#039;, &#039;taxonomy general name&#039;, NECTAR_THEME_NAME),\n\t\t&#039;singular_name&#039; =&gt; __( &#039;Slide&#039;, NECTAR_THEME_NAME),\n\t\t&#039;search_items&#039; =&gt;  __( &#039;Search Slides&#039;, NECTAR_THEME_NAME),\n\t\t&#039;all_items&#039; =&gt; __( &#039;All Slides&#039;, NECTAR_THEME_NAME),\n\t\t&#039;parent_item&#039; =&gt; __( &#039;Parent Slide&#039;, NECTAR_THEME_NAME),\n\t\t&#039;edit_item&#039; =&gt; __( &#039;Edit Slide&#039;, NECTAR_THEME_NAME),\n\t\t&#039;update_item&#039; =&gt; __( &#039;Update Slide&#039;, NECTAR_THEME_NAME),\n\t\t&#039;add_new_item&#039; =&gt; __( &#039;Add New Slide&#039;, NECTAR_THEME_NAME),\n\t    &#039;menu_name&#039; =&gt; __( &#039;Nectar Slider&#039;, NECTAR_THEME_NAME)\n\t );\n\t \n\t $nectarslider_menu_icon = (floatval(get_bloginfo(&#039;version&#039;)) &gt;= &quot;3.8&quot;) ? &#039;dashicons-star-empty&#039; : NECTAR_FRAMEWORK_DIRECTORY . &#039;assets\/img\/icons\/nectar-slider.png&#039;;\n\t \n\t $args = array(\n\t\t\t&#039;labels&#039; =&gt; $labels,\n\t\t\t&#039;singular_label&#039; =&gt; __(&#039;Nectar Slider&#039;, NECTAR_THEME_NAME),\n\t\t\t&#039;public&#039; =&gt; false,\n\t\t\t&#039;show_ui&#039; =&gt; true,\n\t\t\t&#039;hierarchical&#039; =&gt; false,\n\t\t\t&#039;menu_position&#039; =&gt; 10,\n\t\t\t&#039;menu_icon&#039; =&gt; $nectarslider_menu_icon,\n\t\t\t&#039;exclude_from_search&#039; =&gt; true,\n\t\t\t&#039;supports&#039; =&gt; false\n       );  \n   \n    register_post_type( &#039;nectar_slider&#039; , $args );  \n}  \n \n\n$slider_locations_labels = array(\n\t&#039;name&#039; =&gt; __( &#039;Slider Locations&#039;, NECTAR_THEME_NAME),\n\t&#039;singular_name&#039; =&gt; __( &#039;Slider Location&#039;, NECTAR_THEME_NAME),\n\t&#039;search_items&#039; =&gt;  __( &#039;Search Slider Locations&#039;, NECTAR_THEME_NAME),\n\t&#039;all_items&#039; =&gt; __( &#039;All Slider Locations&#039;, NECTAR_THEME_NAME),\n\t&#039;edit_item&#039; =&gt; __( &#039;Edit Slider Location&#039;, NECTAR_THEME_NAME),\n\t&#039;update_item&#039; =&gt; __( &#039;Update Slider Location&#039;, NECTAR_THEME_NAME),\n\t&#039;add_new_item&#039; =&gt; __( &#039;Add New Slider Location&#039;, NECTAR_THEME_NAME),\n\t&#039;new_item_name&#039; =&gt; __( &#039;New Slider Location&#039;, NECTAR_THEME_NAME),\n    &#039;menu_name&#039; =&gt; __( &#039;Slider Locations&#039;, NECTAR_THEME_NAME)\n); \t\n \nregister_taxonomy(&#039;slider-locations&#039;,\n\tarray(&#039;nectar_slider&#039;),\n\tarray(&#039;hierarchical&#039; =&gt; true,\n    &#039;labels&#039; =&gt; $slider_locations_labels,\n    &#039;show_ui&#039; =&gt; true,\n    &#039;public&#039; =&gt; false,\n    &#039;query_var&#039; =&gt; true,\n    &#039;rewrite&#039; =&gt; array( &#039;slug&#039; =&gt; &#039;slider-locations&#039; )\n));\n\nif($nectar_disable_nectar_slider != true) {\n\tadd_action(&#039;init&#039;, &#039;nectar_slider_register&#039;); \n}\n\n#-----------------------------------------------------------------#\n# Custom slider columns\n#-----------------------------------------------------------------# \n\nif($nectar_disable_nectar_slider != true) {\n\tadd_filter(&#039;manage_edit-nectar_slider_columns&#039;, &#039;edit_columns_nectar_slider&#039;);  \n}\n\nfunction edit_columns_nectar_slider($columns){  \n\t$column_thumbnail = array( &#039;thumbnail&#039; =&gt; &#039;Thumbnail&#039; );\n\t$column_caption = array( &#039;caption&#039; =&gt; &#039;Caption&#039; );\n\t$columns = array_slice( $columns, 0, 1, true ) + $column_thumbnail + array_slice( $columns, 1, NULL, true );\n\t$columns = array_slice( $columns, 0, 2, true ) + $column_caption + array_slice( $columns, 2, NULL, true );\n\treturn $columns;\n}  \n  \n\nif($nectar_disable_nectar_slider != true) {  \n\tadd_action(&#039;manage_nectar_slider_posts_custom_column&#039;,  &#039;nectar_slider_custom_columns&#039;, 10, 2);  \n}\n\nfunction nectar_slider_custom_columns($portfolio_columns, $post_id){  \n\n\tswitch ($portfolio_columns) { \n\t    case &#039;thumbnail&#039;:\n\t\t\t\n\t\t\t$background_type = get_post_meta($post_id, &#039;_nectar_slider_bg_type&#039;, true);\n\t\t\tif($background_type == &#039;image_bg&#039;) {\n\t\t\t\t\n\t\t\t\t$thumbnail = get_post_meta($post_id, &#039;_nectar_slider_image&#039;, true);\n\t        \n\t\t        if( !empty($thumbnail) ) {\n\t\t            echo &#039;&lt;a href=&quot;&#039;.get_admin_url() . &#039;post.php?post=&#039; . $post_id.&#039;&amp;action=edit&quot;&gt;&lt;img class=&quot;slider-thumb&quot; src=&quot;&#039; . $thumbnail . &#039;&quot; \/&gt;&lt;\/a&gt;&#039;;\n\t\t        } else {\n\t\t            echo &#039;&lt;a href=&quot;&#039;.get_admin_url() . &#039;post.php?post=&#039; . $post_id.&#039;&amp;action=edit&quot;&gt;&lt;img class=&quot;slider-thumb&quot; src=&quot;&#039; . NECTAR_FRAMEWORK_DIRECTORY . &#039;assets\/img\/slider-default-thumb.jpg&quot; \/&gt;&lt;\/a&gt;&#039; .\n\t\t                 &#039;&lt;strong&gt;&lt;a class=&quot;row-title&quot; href=&quot;&#039;.get_admin_url() . &#039;post.php?post=&#039; . $post_id.&#039;&amp;action=edit&quot;&gt;No image added yet&lt;\/a&gt;&lt;\/strong&gt;&#039;;\n\t\t        }\n\t\t\t} \n\n\t\t\telse {\n\t\t\t\t $thumbnail = get_post_meta($post_id, &#039;_nectar_slider_preview_image&#039;, true);\n\t        \n\t\t        if( !empty($thumbnail) ) {\n\t\t            echo &#039;&lt;a href=&quot;&#039;.get_admin_url() . &#039;post.php?post=&#039; . $post_id.&#039;&amp;action=edit&quot;&gt;&lt;img class=&quot;slider-thumb&quot; src=&quot;&#039; . $thumbnail . &#039;&quot; \/&gt;&lt;\/a&gt;&#039;;\n\t\t        } else {\n\t\t            echo &#039;&lt;a href=&quot;&#039;.get_admin_url() . &#039;post.php?post=&#039; . $post_id.&#039;&amp;action=edit&quot;&gt;&lt;img class=&quot;slider-thumb&quot; src=&quot;&#039; . NECTAR_FRAMEWORK_DIRECTORY . &#039;assets\/img\/slider-default-video-thumb.jpg&quot; \/&gt;&lt;\/a&gt;&#039; .\n\t\t                 &#039;&lt;strong&gt;&lt;a class=&quot;row-title&quot; href=&quot;&#039;.get_admin_url() . &#039;post.php?post=&#039; . $post_id.&#039;&amp;action=edit&quot;&gt;No video preview image added yet&lt;\/a&gt;&lt;\/strong&gt;&#039;;\n\t\t        }\n\t\t\t}\t\n\t\t\t\n\t        \n\t    break; \n\t\t\n\t\tcase &#039;caption&#039;:\n\t\t\t$caption = get_post_meta($post_id, &#039;_nectar_slider_caption&#039;, true);\n\t\t\t$heading = get_post_meta($post_id, &#039;_nectar_slider_heading&#039;, true);\n\t        echo &#039;&lt;h2&gt;&#039;.$heading.&#039;&lt;\/h2&gt;&lt;p&gt;&#039;.$caption.&#039;&lt;\/p&gt;&#039;;\n\t    break;  \n\t\t\n\t\t   \n\t\tdefault:\n\t\t\tbreak; \n\t}  \n}  \n\nif($nectar_disable_nectar_slider != true) {\n\tadd_action( &#039;admin_menu&#039;, &#039;nectar_slider_ordering&#039; );\n}\n\nfunction nectar_slider_ordering() {\n\tadd_submenu_page(\n\t\t&#039;edit.php?post_type=nectar_slider&#039;,\n\t\t&#039;Order Slides&#039;,\n\t\t&#039;Slide Ordering&#039;,\n\t\t&#039;edit_pages&#039;, &#039;nectar-slide-order&#039;,\n\t\t&#039;nectar_slider_order_page&#039;\n\t);\n}\n\nfunction nectar_slider_order_page(){ ?&gt;\n\t\n\t&lt;div class=&quot;wrap&quot; data-base-url=&quot;&lt;?php echo admin_url(&#039;edit.php?post_type=nectar_slider&amp;page=nectar-slide-order&#039;); ?&gt;&quot;&gt;\n\t\t&lt;h2&gt;&lt;?php echo __(&#039;Sort Slides&#039;, NECTAR_THEME_NAME); ?&gt;&lt;\/h2&gt;\n\t\t&lt;p&gt;&lt;?php echo __(&#039;Choose your slider location below and simply drag your slides up or down - they will automatically be saved in that order.&#039;, NECTAR_THEME_NAME); ?&gt;&lt;\/p&gt;\n\t\t\n\t&lt;?php \n\t(isset($_GET[&#039;slider-location&#039;])) ? $location = $_GET[&#039;slider-location&#039;] : $location = false ;\n\t$slides = new WP_Query( array( &#039;post_type&#039; =&gt; &#039;nectar_slider&#039;, &#039;slider-locations&#039; =&gt; $location, &#039;posts_per_page&#039; =&gt; -1, &#039;order&#039; =&gt; &#039;ASC&#039;, &#039;orderby&#039; =&gt; &#039;menu_order&#039; ) ); ?&gt;\n\t&lt;?php if( $slides-&gt;have_posts() ) : ?&gt;\n\t\t\n\t\t&lt;?php wp_nonce_field( basename(__FILE__), &#039;nectar_meta_box_nonce&#039; );\n\t\techo &#039;&lt;div class=&quot;slider-locations&quot;&gt;&#039;; \n\t\tglobal $typenow;\n\t    $args=array( &#039;public&#039; =&gt; false, &#039;_builtin&#039; =&gt; false ); \n\t    $post_types = get_post_types($args);\n\t    if ( in_array($typenow, $post_types) ) {\n\t    $filters = get_object_taxonomies($typenow);\n\t        foreach ($filters as $tax_slug) {\n\t            $tax_obj = get_taxonomy($tax_slug);\n\t            wp_dropdown_categories(array(\n\t                &#039;show_option_all&#039; =&gt; &#039;Slider Locations&#039;,\n\t                &#039;taxonomy&#039; =&gt; $tax_slug,\n\t                &#039;name&#039; =&gt; $tax_obj-&gt;name,\n\t                \/\/&#039;orderby&#039; =&gt; &#039;term_order&#039;,\n\t                &#039;selected&#039; =&gt; isset($location) ? $location : false,\n\t                &#039;hierarchical&#039; =&gt; $tax_obj-&gt;hierarchical,\n\t                &#039;show_count&#039; =&gt; false,\n\t                &#039;hide_empty&#039; =&gt; true\n\t            ));\n\t        } \n\t    }\n\t\techo &#039;&lt;\/div&gt;&#039;;\n\t\tif(isset($location) &amp;&amp; $location != false) { \n\t    ?&gt;\n\t\t\n\t\t&lt;table class=&quot;wp-list-table widefat fixed posts&quot; id=&quot;sortable-table&quot;&gt;\n\t\t\t&lt;thead&gt;\n\t\t\t\t&lt;tr&gt;\n\t\t\t\t\t&lt;th class=&quot;column-order&quot;&gt;&lt;?php echo __(&#039;Order&#039;, NECTAR_THEME_NAME); ?&gt;&lt;\/th&gt;\n\t\t\t\t\t&lt;th class=&quot;manage-column column-thumbnail&quot;&gt;&lt;?php echo __(&#039;Image&#039;, NECTAR_THEME_NAME); ?&gt;&lt;\/th&gt;\n\t\t\t\t\t&lt;th class=&quot;manage-column column-caption&quot;&gt;&lt;?php echo __(&#039;Caption&#039;, NECTAR_THEME_NAME); ?&gt;&lt;\/th&gt;\n\t\t\t\t&lt;\/tr&gt;\n\t\t\t&lt;\/thead&gt;\n\t\t\t&lt;tbody data-post-type=&quot;nectar_slider&quot;&gt;\n\t\t\t&lt;?php while( $slides-&gt;have_posts() ) : $slides-&gt;the_post(); ?&gt;\n\t\t\t\t&lt;tr id=&quot;post-&lt;?php the_ID(); ?&gt;&quot;&gt;\n\t\t\t\t\t&lt;td class=&quot;column-order&quot;&gt;&lt;img src=&quot;&lt;?php echo NECTAR_FRAMEWORK_DIRECTORY . &#039;assets\/img\/sortable.png&#039;; ?&gt;&quot; title=&quot;&quot; alt=&quot;Move Icon&quot; width=&quot;25&quot; height=&quot;25&quot; class=&quot;&quot; \/&gt;&lt;\/td&gt;\n\t\t\t\t\t&lt;td class=&quot;thumbnail column-thumbnail&quot;&gt;\n\t\t\t\t\t\t&lt;?php \n\t\t\t\t\t\tglobal $post;\n\t\t\t\t\t\t$post_id = $post-&gt;ID;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$background_type = get_post_meta($post_id, &#039;_nectar_slider_bg_type&#039;, true);\n\t\t\t\t\t\tif($background_type == &#039;image_bg&#039;) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$thumbnail = get_post_meta($post_id, &#039;_nectar_slider_image&#039;, true);\n\t\t\t\t        \n\t\t\t\t\t        if( !empty($thumbnail) ) {\n\t\t\t\t\t            echo &#039;&lt;a href=&quot;&#039;.get_admin_url() . &#039;post.php?post=&#039; . $post_id.&#039;&amp;action=edit&quot;&gt;&lt;img class=&quot;slider-thumb&quot; src=&quot;&#039; . $thumbnail . &#039;&quot; \/&gt;&lt;\/a&gt;&#039;;\n\t\t\t\t\t        } else {\n\t\t\t\t\t            echo &#039;&lt;a href=&quot;&#039;.get_admin_url() . &#039;post.php?post=&#039; . $post_id.&#039;&amp;action=edit&quot;&gt;&lt;img class=&quot;slider-thumb&quot; src=&quot;&#039; . NECTAR_FRAMEWORK_DIRECTORY . &#039;assets\/img\/slider-default-thumb.jpg&quot; \/&gt;&lt;\/a&gt;&#039; .\n\t\t\t\t\t                 &#039;&lt;strong&gt;&lt;a class=&quot;row-title&quot; href=&quot;&#039;.get_admin_url() . &#039;post.php?post=&#039; . $post_id.&#039;&amp;action=edit&quot;&gt;No image added yet&lt;\/a&gt;&lt;\/strong&gt;&#039;;\n\t\t\t\t\t        }\n\t\t\t\t\t\t} \n\t\t\t\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t $thumbnail = get_post_meta($post_id, &#039;_nectar_slider_preview_image&#039;, true);\n\t\t\t\t        \n\t\t\t\t\t        if( !empty($thumbnail) ) {\n\t\t\t\t\t            echo &#039;&lt;a href=&quot;&#039;.get_admin_url() . &#039;post.php?post=&#039; . $post_id.&#039;&amp;action=edit&quot;&gt;&lt;img class=&quot;slider-thumb&quot; src=&quot;&#039; . $thumbnail . &#039;&quot; \/&gt;&lt;\/a&gt;&#039;;\n\t\t\t\t\t        } else {\n\t\t\t\t\t            echo &#039;&lt;a href=&quot;&#039;.get_admin_url() . &#039;post.php?post=&#039; . $post_id.&#039;&amp;action=edit&quot;&gt;&lt;img class=&quot;slider-thumb&quot; src=&quot;&#039; . NECTAR_FRAMEWORK_DIRECTORY . &#039;assets\/img\/slider-default-video-thumb.jpg&quot; \/&gt;&lt;\/a&gt;&#039; .\n\t\t\t\t\t                 &#039;&lt;strong&gt;&lt;a class=&quot;row-title&quot; href=&quot;&#039;.get_admin_url() . &#039;post.php?post=&#039; . $post_id.&#039;&amp;action=edit&quot;&gt;No video preview image added yet&lt;\/a&gt;&lt;\/strong&gt;&#039;;\n\t\t\t\t\t        }\n\t\t\t\t\t\t}\t ?&gt;\n\t\t\t\t\t\t\n\t\t\t\t\t&lt;\/td&gt;\n\t\t\t\t\t&lt;td class=&quot;caption column-caption&quot;&gt;\n\t\t\t\t\t\t&lt;?php \n\t\t\t\t\t\t$caption = get_post_meta($post-&gt;ID, &#039;_nectar_slider_caption&#039;, true);\n\t        \t\t\techo $caption; ?&gt;\n\t\t\t\t\t&lt;\/td&gt;\n\t\t\t\t&lt;\/tr&gt;\n\t\t\t&lt;?php endwhile; ?&gt;\n\t\t\t&lt;\/tbody&gt;\n\t\t\t&lt;tfoot&gt;\n\t\t\t\t&lt;tr&gt;\n\t\t\t\t\t&lt;th class=&quot;column-order&quot;&gt;&lt;?php echo __(&#039;Order&#039;, NECTAR_THEME_NAME); ?&gt;&lt;\/th&gt;\n\t\t\t\t\t&lt;th class=&quot;manage-column column-thumbnail&quot;&gt;&lt;?php echo __(&#039;Image&#039;, NECTAR_THEME_NAME); ?&gt;&lt;\/th&gt;\n\t\t\t\t\t&lt;th class=&quot;manage-column column-caption&quot;&gt;&lt;?php echo __(&#039;Caption&#039;, NECTAR_THEME_NAME); ?&gt;&lt;\/th&gt;\n\t\t\t\t&lt;\/tr&gt;\n\t\t\t&lt;\/tfoot&gt;\n\n\t\t&lt;\/table&gt;\n\t&lt;?php } ?&gt;\n\t\n\t&lt;?php else: ?&gt;\n\n\t\t&lt;p&gt;No slides found, why not &lt;a href=&quot;post-new.php?post_type=nectar_slider&quot;&gt;create one?&lt;\/a&gt;&lt;\/p&gt;\n\n\t&lt;?php endif; ?&gt;\n\t&lt;?php wp_reset_postdata(); ?&gt;\n\n\t&lt;\/div&gt;&lt;!-- .wrap --&gt;\n\t\n&lt;?php }\n\nif($nectar_disable_nectar_slider != true) {\n\tadd_action( &#039;admin_enqueue_scripts&#039;, &#039;nectar_slider_enqueue_scripts&#039; );\n}\n\nfunction nectar_slider_enqueue_scripts() {\n\tglobal $typenow;\n\tglobal $nectar_get_template_directory_uri;\n    if( &#039;nectar_slider&#039; == $typenow) {\n\t\twp_enqueue_script( &#039;jquery-ui-sortable&#039; );\n\t\twp_enqueue_script( &#039;nectar-reorder&#039;, NECTAR_FRAMEWORK_DIRECTORY . &#039;assets\/js\/nectar-reorder.js&#039; );\n\t}\t\n\t\n\twp_register_script(&#039;chosen&#039;, $nectar_get_template_directory_uri . &#039;\/nectar\/tinymce\/shortcode_generator\/js\/chosen\/chosen.jquery.min.js&#039;, array(&#039;jquery&#039;), &#039;8.0.1&#039;, true);\n\twp_register_style( &#039;chosen&#039;, $nectar_get_template_directory_uri .&#039;\/nectar\/tinymce\/shortcode_generator\/css\/chosen\/chosen.css&#039;, array(), &#039;8.0.1&#039;, &#039;all&#039;);\n\n\twp_enqueue_style(&#039;chosen&#039;);\n\twp_enqueue_script(&#039;chosen&#039;);\n\t\n}\n\nif($nectar_disable_nectar_slider != true) {\n\tadd_action( &#039;wp_ajax_nectar_update_slide_order&#039;, &#039;nectar_slider_update_order&#039; );\n}\n\n\/\/slide order ajax callback \nfunction nectar_slider_update_order() {\n\t\n\t    global $wpdb;\n\t \n\t    $post_type     = sanitize_text_field($_POST[&#039;postType&#039;]);\n\t    $order        = $_POST[&#039;order&#039;];\n\t\t\n\t\tif (  !isset($_POST[&#039;nectar_meta_box_nonce&#039;]) || !wp_verify_nonce( $_POST[&#039;nectar_meta_box_nonce&#039;], basename( __FILE__ ) ) )\n\t\t\treturn;\n\t\t\n\t    foreach( $order as $menu_order =&gt; $post_id ) {\n\t        $post_id         = intval( str_ireplace( &#039;post-&#039;, &#039;&#039;, $post_id ) );\n\t        $menu_order     = intval($menu_order);\n\t\t\t\n\t        wp_update_post( array( &#039;ID&#039; =&gt; stripslashes(htmlspecialchars($post_id)), &#039;menu_order&#039; =&gt; stripslashes(htmlspecialchars($menu_order)) ) );\n    \t}\n \n\t    die( &#039;1&#039; );\n}\n\n\/\/order the default nectar slider page correctly \nfunction set_nectar_slider_admin_order($wp_query) {  \n\n    $post_type = $wp_query-&gt;query[&#039;post_type&#039;];  \n  \n    if ( $post_type == &#039;nectar_slider&#039;) {  \n   \n      $wp_query-&gt;set(&#039;orderby&#039;, &#039;menu_order&#039;);  \n      $wp_query-&gt;set(&#039;order&#039;, &#039;ASC&#039;);  \n    }  \n  \n}  \n\nif (is_admin() &amp;&amp; $nectar_disable_nectar_slider != true ) {  \n\tadd_filter(&#039;pre_get_posts&#039;, &#039;set_nectar_slider_admin_order&#039;); \n}\n\nfunction my_restrict_manage_posts() {\n    global $typenow;\n    $args = array( &#039;public&#039; =&gt; false, &#039;_builtin&#039; =&gt; false ); \n    $post_types = get_post_types($args);\n    if ( in_array($typenow, $post_types) ) {\n    \t\t\n    \t$filters = get_object_taxonomies($typenow);\n\t\tif($typenow != &#039;product&#039;){\n\t        foreach ($filters as $tax_slug) {\n\t            $tax_obj = get_taxonomy($tax_slug);\n\t            wp_dropdown_categories(array(\n\t                &#039;show_option_all&#039; =&gt; __(&#039;Show All &#039;.$tax_obj-&gt;label ),\n\t                &#039;taxonomy&#039; =&gt; $tax_slug,\n\t                &#039;name&#039; =&gt; $tax_obj-&gt;name,\n\t                \/\/&#039;orderby&#039; =&gt; &#039;term_order&#039;,\n\t                &#039;selected&#039; =&gt; isset($_GET[$tax_obj-&gt;query_var]) ? $_GET[$tax_obj-&gt;query_var] : false,\n\t                &#039;hierarchical&#039; =&gt; $tax_obj-&gt;hierarchical,\n\t                &#039;show_count&#039; =&gt; false,\n\t                &#039;hide_empty&#039; =&gt; true\n\t            ));\n\t        }\n\t\t}\n\n    }\n}\nfunction my_convert_restrict($query) {\n    global $pagenow;\n    global $typenow;\n    if ($pagenow==&#039;edit.php&#039;) {\n        $filters = get_object_taxonomies($typenow);\n        foreach ($filters as $tax_slug) {\n            $var = &amp;$query-&gt;query_vars[$tax_slug];\n            if ( isset($var) ) {\n                $term = get_term_by(&#039;id&#039;,$var,$tax_slug);\n\t\t\t\tif($term) $var = $term-&gt;slug; ;\n            }\n        }\n    }\n}\n\nif($nectar_disable_nectar_slider != true) {\n\tadd_action(&#039;restrict_manage_posts&#039;, &#039;my_restrict_manage_posts&#039; );\n\tadd_filter(&#039;parse_query&#039;,&#039;my_convert_restrict&#039;);\n}\n\n \n\n#-----------------------------------------------------------------#\n# Nectar slider meta\n#-----------------------------------------------------------------# \nif($nectar_disable_nectar_slider != true) {\n\tinclude(&quot;nectar\/meta\/nectar-slider-meta.php&quot;);\n}\n\n#-----------------------------------------------------------------#\n# Nectar slider display\n#-----------------------------------------------------------------# \n\n$real_fs = 0;\n\nif (!function_exists(&#039;nectar_slider_display&#039;)) {\n\t\n\tfunction nectar_slider_display($config_arr){\n\t\t global $nectar_disable_nectar_slider;\n\t\t \n\t\t if($nectar_disable_nectar_slider == true) {\n\t\t \techo __(&#039;Nectar Slider Post Type Disabled - please reanble in the Salient options panel &gt; General Settings &gt; Toggle Theme Features tab.&#039;, NECTAR_THEME_NAME);\n\t\t \treturn false;\n\t\t }\n\n\t\t global $post;\n\t\t global $options;\n\t\t global $real_fs;\n\t\t \n\t\t $midnight_parallax = null;\n\t     $midnight_regular = null;\n\n\t     \/\/disable parallax for full page\n\t     $page_full_screen_rows = (isset($post-&gt;ID)) ? get_post_meta($post-&gt;ID, &#039;_nectar_full_screen_rows&#039;, true) : &#039;&#039;;\n\t     if($page_full_screen_rows == &quot;on&quot;)\n\t     \t$config_arr[&#039;parallax&#039;] = &#039;false&#039;;\n\n\t     $animate_in_effect = (!empty($options[&#039;header-animate-in-effect&#039;])) ? $options[&#039;header-animate-in-effect&#039;] : &#039;none&#039;;\n\n\t\t \/\/adding parallax wrapper if selected\n\t\t if($config_arr[&#039;parallax&#039;] == &#039;true&#039;) {\n\t\n\t\t\t if( stripos( $post-&gt;post_content, &#039;[nectar_slider&#039;) !== FALSE  &amp;&amp; stripos( $post-&gt;post_content, &#039;[nectar_slider&#039;) === 0  &amp;&amp;  $real_fs == 0) { $first_section = &#039;first-section&#039;;  $real_fs = 1; } else { $first_section = &#039;&#039;; }\n\t   \t\t \n\t   \t\t $midnight_parallax = &#039;data-midnight=&quot;nectar-slider&quot;&#039;;\n\t\t\t $midnight_regular = null;\n\n\t\t\t $slider = &#039;&lt;div style=&quot;height: &#039;.$config_arr[&#039;slider_height&#039;].&#039;px&quot; &#039;.$midnight_parallax.&#039; class=&quot;parallax_slider_outer &#039;.$first_section.&#039;&quot;&gt;&#039;; \n\t\t \n\t\t } else { $slider = &#039;&#039;; }\n\t\t \n\t\t $boxed = (!empty($options[&#039;boxed_layout&#039;]) &amp;&amp; $options[&#039;boxed_layout&#039;] == &#039;1&#039;) ? &#039;1&#039; : &#039;0&#039;;\n\t\tif($config_arr[&#039;full_width&#039;] == &#039;true&#039; &amp;&amp; $boxed != &#039;1&#039;) {  $fullwidth = &#039;true&#039;; }\n\t\telse if($config_arr[&#039;full_width&#039;] == &#039;true&#039; &amp;&amp; $boxed == &#039;1&#039;) { $fullwidth = &#039;boxed-full-width&#039;; }\n\t\telse { $fullwidth = &#039;false&#039;; }\n\t\t\n\t\tif($config_arr[&#039;parallax&#039;] != &#039;true&#039;) {\n\t\t \t if( stripos( $post-&gt;post_content, &#039;[nectar_slider&#039;) !== FALSE  &amp;&amp; stripos( $post-&gt;post_content, &#039;[nectar_slider&#039;) === 0 &amp;&amp; $real_fs == 0) { $first_section =  &#039;first-section&#039;; $real_fs = 1; $midnight_parallax = null; $midnight_regular = &#039;data-midnight=&quot;nectar-slider&quot;&#039;; } else { $first_section = &#039;&#039;; }  \n\t\t } else {\n\t\t \t $midnight_parallax = null;\n\t    \t $midnight_regular = null;\n\t\t \t $first_section = &#039;&#039;; \n\t\t }\n\t\t\t\n\t\t\t$text_overrides = null;\n\t\t\tif(!empty($config_arr[&#039;tablet_header_font_size&#039;])) {\n\t\t\t\t$text_overrides .= &#039; data-tho=&quot;&#039;.$config_arr[&#039;tablet_header_font_size&#039;].&#039;&quot;&#039;;\n\t\t\t}\n\t\t\tif(!empty($config_arr[&#039;tablet_caption_font_size&#039;])) {\n\t\t\t\t$text_overrides .= &#039; data-tco=&quot;&#039;.$config_arr[&#039;tablet_caption_font_size&#039;].&#039;&quot;&#039;;\n\t\t\t}\n\t\t\tif(!empty($config_arr[&#039;phone_header_font_size&#039;])) {\n\t\t\t\t$text_overrides .= &#039; data-pho=&quot;&#039;.$config_arr[&#039;phone_header_font_size&#039;].&#039;&quot;&#039;;\n\t\t\t}\n\t\t\tif(!empty($config_arr[&#039;phone_caption_font_size&#039;])) {\n\t\t\t\t$text_overrides .= &#039; data-pco=&quot;&#039;.$config_arr[&#039;phone_caption_font_size&#039;].&#039;&quot;&#039;;\n\t\t\t}\n\n\t\t\t$slider .= &#039;&lt;div style=&quot;height: &#039;.$config_arr[&#039;slider_height&#039;].&#039;px&quot; &#039;.$midnight_regular.&#039; data-transition=&quot;&#039;.$config_arr[&#039;slider_transition&#039;].&#039;&quot; data-overall_style=&quot;&#039;.$config_arr[&#039;overall_style&#039;].&#039;&quot; data-flexible-height=&quot;&#039;.$config_arr[&#039;flexible_slider_height&#039;].&#039;&quot; data-animate-in-effect=&quot;&#039;.$animate_in_effect.&#039;&quot; data-fullscreen=&quot;&#039;.$config_arr[&#039;fullscreen&#039;].&#039;&quot; data-button-sizing=&quot;&#039;.$config_arr[&#039;button_sizing&#039;].&#039;&quot; data-button-styling=&quot;&#039;.$config_arr[&#039;slider_button_styling&#039;].&#039;&quot; data-autorotate=&quot;&#039;.$config_arr[&#039;autorotate&#039;].&#039;&quot; data-parallax=&quot;&#039;.$config_arr[&#039;parallax&#039;].&#039;&quot; data-full-width=&quot;&#039;.$fullwidth.&#039;&quot; class=&quot;nectar-slider-wrap &#039;.$first_section.&#039;&quot; id=&quot;ns-id-&#039;.uniqid().&#039;&quot;&gt;\n\t\t\t&lt;div style=&quot;height: &#039;.$config_arr[&#039;slider_height&#039;].&#039;px&quot; class=&quot;swiper-container&quot; &#039;.$text_overrides.&#039; data-loop=&quot;&#039;.$config_arr[&#039;loop&#039;].&#039;&quot; data-height=&quot;&#039;. $config_arr[&quot;slider_height&quot;] .&#039;&quot; data-min-height=&quot;&#039;.$config_arr[&#039;min_slider_height&#039;].&#039;&quot; data-arrows=&quot;&#039; . $config_arr[&quot;arrow_navigation&quot;].&#039;&quot; data-bullets=&quot;&#039;.$config_arr[&quot;bullet_navigation&quot;].&#039;&quot; data-bullet_style=&quot;&#039;.$config_arr[&quot;bullet_navigation_style&quot;].&#039;&quot; data-desktop-swipe=&quot;&#039;. $config_arr[&quot;desktop_swipe&quot;].&#039;&quot; data-settings=&quot;&quot;&gt;\n\t\t\t\t    &lt;div class=&quot;swiper-wrapper&quot;&gt;&#039;;\n\t\t\t\t     \n\t\t\t\t      $slide_count = 0;\n\t\t\t\t\t  \n\t\t\t\t\t  \/\/get slider location by slug instead of raw name\n\t\t\t\t\t  $slider_terms = get_term_by(&#039;name&#039;,$config_arr[&#039;location&#039;],&#039;slider-locations&#039;);\n\t\t\t\n\t\t\t\t      \/\/loop through and get all the slides in selected location\n\t\t\t\t      $slides = new WP_Query( array( &#039;post_type&#039; =&gt; &#039;nectar_slider&#039;, &#039;tax_query&#039; =&gt; array( array( &#039;taxonomy&#039; =&gt; &#039;slider-locations&#039;, &#039;field&#039; =&gt; &#039;slug&#039;, &#039;terms&#039; =&gt; $slider_terms-&gt;slug ) ), &#039;posts_per_page&#039; =&gt; -1, &#039;order&#039; =&gt; &#039;ASC&#039;, &#039;orderby&#039; =&gt; &#039;menu_order&#039; ) ); \n\t\t\t\t\t \n\t\t\t\t\t  if( $slides-&gt;have_posts() ) :  while( $slides-&gt;have_posts() ) : $slides-&gt;the_post(); \n\t\t\t\t\t  \n\t\t\t\t\t\t  global $post;\n\t\t\t\t\t  \t  \n\t\t\t\t\t\t  $background_type = get_post_meta($post-&gt;ID, &#039;_nectar_slider_bg_type&#039;, true);\n\t\t\t\t\t\t  $background_alignment = get_post_meta($post-&gt;ID, &#039;_nectar_slider_slide_bg_alignment&#039;, true); \n\t\t\t\t\t\t  \n\t\t\t\t\t\t  $slide_title = get_post_meta($post-&gt;ID, &#039;_nectar_slider_heading&#039;, true);\n\t\t\t\t\t\t  \n\t\t\t\t\t      $slide_description = get_post_meta($post-&gt;ID, &#039;_nectar_slider_caption&#039;, true);\n\t\t\t\t\t\t  $slide_description_wrapped = &#039;&lt;span&gt;&#039;.$slide_description.&#039;&lt;\/span&gt;&#039;;\n\t\t\t\t\t\t  $slide_description_bg = get_post_meta($post-&gt;ID, &#039;_nectar_slider_caption_background&#039;, true);\n\t\t\t\t\t\t  $caption_bg = ( $slide_description_bg == &#039;on&#039;) ? &#039;class=&quot;transparent-bg&quot;&#039; : &#039;&#039;;\n\t\t\t\t\t\t  \n\t\t\t\t\t\t  $down_arrow = get_post_meta($post-&gt;ID, &#039;_nectar_slider_down_arrow&#039;, true);\n\t\t\t\t\t\t   \n\t\t\t\t\t\t  $poster = get_post_meta($post-&gt;ID, &#039;_nectar_slider_preview_image&#039;, true);\n\t\t\t\t\t\t  $poster_markup = (!empty($poster)) ? &#039;poster=&quot;&#039;.$poster.&#039;&quot;&#039; : null ;\n\t\t\t\t\t\t  \n\t\t\t\t\t\t  $x_pos = get_post_meta($post-&gt;ID, &#039;_nectar_slide_xpos_alignment&#039;, true); \n\t\t\t\t\t  \t  $y_pos = get_post_meta($post-&gt;ID, &#039;_nectar_slide_ypos_alignment&#039;, true);\n\t\t\t\t\t\t  \n\t\t\t\t\t\t  $link_type = get_post_meta($post-&gt;ID, &#039;_nectar_slider_link_type&#039;, true);  \n\t\t\t\t\t\t  \n\t\t\t\t\t\t  $full_slide_link = get_post_meta($post-&gt;ID, &#039;_nectar_slider_entire_link&#039;, true);\n\t\t\t\t\t\t  \n\t\t\t\t\t\t  $button_1_text = get_post_meta($post-&gt;ID, &#039;_nectar_slider_button&#039;, true); \n\t\t\t\t\t\t  $button_1_link = get_post_meta($post-&gt;ID, &#039;_nectar_slider_button_url&#039;, true); \n\t\t\t\t\t\t  $button_1_style = get_post_meta($post-&gt;ID, &#039;_nectar_slider_button_style&#039;, true); \n\t\t\t\t\t\t  $button_1_color = get_post_meta($post-&gt;ID, &#039;_nectar_slider_button_color&#039;, true); \n\t\t\t\t\t  \t  \n\t\t\t\t\t\t  $button_2_text = get_post_meta($post-&gt;ID, &#039;_nectar_slider_button_2&#039;, true); \n\t\t\t\t\t\t  $button_2_link = get_post_meta($post-&gt;ID, &#039;_nectar_slider_button_url_2&#039;, true); \n\t\t\t\t\t\t  $button_2_style = get_post_meta($post-&gt;ID, &#039;_nectar_slider_button_style_2&#039;, true); \n\t\t\t\t\t\t  $button_2_color = get_post_meta($post-&gt;ID, &#039;_nectar_slider_button_color_2&#039;, true); \n\t\t\t\t\t\t  \n\t\t\t\t\t  \t  $video_mp4 = get_post_meta($post-&gt;ID, &#039;_nectar_media_upload_mp4&#039;, true);\n\t\t\t\t\t\t  $video_webm = get_post_meta($post-&gt;ID, &#039;_nectar_media_upload_webm&#039;, true);\n\t\t\t\t\t\t  $video_ogv = get_post_meta($post-&gt;ID, &#039;_nectar_media_upload_ogv&#039;, true); \n\t\t\t\t\t\t  $video_texture = get_post_meta($post-&gt;ID, &#039;_nectar_slider_video_texture&#039;, true);  \n\t\t\t\t\t\t  \n\t\t\t\t\t\t  $slide_image = get_post_meta($post-&gt;ID, &#039;_nectar_slider_image&#039;, true); \n\t\t\t\t\t\t  $img_bg = null; \n\t\t\t\t\t\t  \n\t\t\t\t\t\t  $slide_color = get_post_meta($post-&gt;ID, &#039;_nectar_slider_slide_font_color&#039;, true); \n\t\t\t\t\t\t  \n\t\t\t\t\t\t  $custom_class = get_post_meta($post-&gt;ID, &#039;_nectar_slider_slide_custom_class&#039;, true); \n\t\t\t\t\t\t  $custom_css_class = (!empty($custom_class)) ? &#039; &#039;.$custom_class : null;\n\t\n\t\t\t\t\t\t  if($background_type == &#039;image_bg&#039;) { $bg_img_markup = &#039;style=&quot;background-image: url(&#039;. nectar_ssl_check($slide_image).&#039;);&quot;&#039;; } else { $bg_img_markup = null;}\t\n\t\t\t\t\t\t  \n\t\t\t\t\t\t  (!empty($x_pos)) ? $x_pos_markup = $x_pos : $x_pos_markup = &#039;center&#039;;\n\t\t\t\t\t\t  (!empty($y_pos)) ? $y_pos_markup = $y_pos : $y_pos_markup = &#039;middle&#039;;\n\t\t\t\t\t\t  \n\t\t\t\t\t\t                         \t\t                                             \n\t\t\t\t\t      $slider .= &#039;&lt;div class=&quot;swiper-slide&#039;.$custom_css_class.&#039;&quot; data-bg-alignment=&quot;&#039;.$background_alignment.&#039;&quot; data-color-scheme=&quot;&#039;. $slide_color .&#039;&quot; data-x-pos=&quot;&#039;.$x_pos_markup.&#039;&quot; data-y-pos=&quot;&#039;.$y_pos_markup.&#039;&quot;&gt; \n\t\t\t\t\t\t\t\t&#039;;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($background_type == &#039;image_bg&#039;) $slider .=&#039;&lt;div class=&quot;image-bg&quot; &#039;.$bg_img_markup.&#039;&gt; &amp;nbsp; &lt;\/div&gt;&#039;;\n\n\t\t\t\t\t\t\t\t if(!empty($slide_title) || !empty($slide_description) || !empty($button_1_text) || !empty($button_2_text)) {\n\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t\t $slider .= &#039;&lt;div class=&quot;container&quot;&gt;\n\t\t\t\t\t\t\t\t\t&lt;div class=&quot;content&quot;&gt;&#039;;\n\t\t\n\t\t\t\t\t\t\t\t\t\t if(!empty($slide_title)) { $slider .=  &#039;&lt;h2&gt;&#039;.$slide_title.&#039;&lt;\/h2&gt;&#039;; } \n\t\t\t\t\t\t\t\t\t\t if(!empty($slide_description)) { $slider .=  &#039;&lt;p &#039;. $caption_bg.&#039; &gt;&#039;. $slide_description_wrapped.&#039;&lt;\/p&gt;&#039;; } \n\t\t\t\t\t\t\t\t\t\t\n\t\n\t\t\t\t\t\t\t\t\t\t   if($link_type == &#039;button_links&#039; &amp;&amp; !empty($button_1_text) || $link_type == &#039;button_links&#039; &amp;&amp; !empty($button_2_text)) { \n\t\t\t\t\t\t\t\t\t\t\t$slider .= &#039;&lt;div class=&quot;buttons&quot;&gt;&#039;;\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t if(!empty($button_1_text)) {\n\t\t\t\t\t\t\t\t\t\t\t\t \t\t\n\t\t\t\t\t\t\t\t\t\t\t\t \t$button_1_link = !empty($button_1_link) ? $button_1_link : &#039;#&#039;;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/check button link to see if it&#039;s a video or googlemap\n\t\t\t\t\t\t\t\t\t\t\t\t\t$link_extra = null;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(strpos($button_1_link, &#039;youtube.com\/watch&#039;) !== false) $link_extra = &#039;pp &#039;; \n\t\t\t\t\t\t\t\t\t\t\t\t\tif(strpos($button_1_link, &#039;vimeo.com\/&#039;) !== false) $link_extra = &#039;pp &#039;; \n\t\t\t\t\t\t\t\t\t\t\t\t\tif(strpos($button_1_link, &#039;maps.google.com\/maps&#039;) !== false) $link_extra = &#039;map-popup &#039;; \n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/wrapper for tilt button\n\t\t\t\t\t\t\t\t\t\t\t\t\t$button_wrap_begin = ($button_1_style == &#039;solid_color_2&#039;) ? &quot;&lt;div class=&#039;button-wrap&#039;&gt;&quot;: null; \n\t\t\t\t\t\t\t\t\t\t\t\t\t$button_wrap_end = ($button_1_style == &#039;solid_color_2&#039;) ? &quot;&lt;\/div&gt;&quot;: null; \n\n\t\t\t\t\t\t\t\t\t\t\t\t \t$slider .= \n\t\t\t\t\t\t\t\t\t\t\t\t \t&#039;&lt;div class=&quot;button &#039;.$button_1_style.&#039;&quot;&gt;\n\t\t\t\t\t\t\t\t\t\t\t\t \t\t&#039;.$button_wrap_begin .&#039; &lt;a class=&quot;&#039;.$link_extra .$button_1_color .&#039;&quot; href=&quot;&#039;.$button_1_link.&#039;&quot;&gt;&#039;.$button_1_text.&#039;&lt;\/a&gt;&#039;. $button_wrap_end.&#039;\n\t\t\t\t\t\t\t\t\t\t\t\t \t &lt;\/div&gt;&#039;;\n\t\t\t\t\t\t\t\t\t\t\t\t } \n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t if(!empty($button_2_text)) {\n\t\t\t\t\t\t\t\t\t\t\t\t \t\t\n\t\t\t\t\t\t\t\t\t\t\t\t \t$button_2_link = !empty($button_2_link) ? $button_2_link : &#039;#&#039;;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/check button link to see if it&#039;s a video or googlemap\n\t\t\t\t\t\t\t\t\t\t\t\t\t$link_extra = null;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(strpos($button_2_link, &#039;youtube.com\/watch&#039;) !== false) $link_extra = &#039;pp &#039;; \n\t\t\t\t\t\t\t\t\t\t\t\t\tif(strpos($button_2_link, &#039;vimeo.com\/&#039;) !== false) $link_extra = &#039;pp &#039;; \n\t\t\t\t\t\t\t\t\t\t\t\t\tif(strpos($button_2_link, &#039;maps.google.com\/maps&#039;) !== false) $link_extra = &#039;map-popup &#039;; \n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t \t$slider .= \n\t\t\t\t\t\t\t\t\t\t\t\t \t&#039;&lt;div class=&quot;button &#039;.$button_2_style.&#039;&quot;&gt;\n\t\t\t\t\t\t\t\t\t\t\t\t \t\t &lt;a class=&quot;&#039;.$link_extra . $button_2_color .&#039;&quot; href=&quot;&#039;.$button_2_link.&#039;&quot;&gt;&#039;.$button_2_text.&#039;&lt;\/a&gt;\n\t\t\t\t\t\t\t\t\t\t\t\t \t &lt;\/div&gt;&#039;;\n\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t$slider .= &#039;&lt;\/div&gt;&#039;;\n\t\t\t\t\t\t\t\t\t\t } \n\t\n\t\t\t\t\t\t\t\t\t$slider .= &#039;&lt;\/div&gt;\n\t\t\t\t\t\t\t\t&lt;\/div&gt;&lt;!--\/container--&gt;&#039;;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(!empty($down_arrow) &amp;&amp; $down_arrow == &#039;on&#039;) { \n\n\t\t\t\t\t\t\t\t\t $header_down_arrow_style = (!empty($options[&#039;header-down-arrow-style&#039;])) ? $options[&#039;header-down-arrow-style&#039;] : &#039;default&#039;; \n\t\t\t \t \t\t\t\t\t $theme_button_styling = (!empty($options[&#039;button-styling&#039;])) ? $options[&#039;button-styling&#039;] : &#039;default&#039;; \n\n\t\t\t\t\t\t\t\t \t if($header_down_arrow_style == &#039;scroll-animation&#039; || $theme_button_styling == &#039;slightly_rounded&#039; || $theme_button_styling == &#039;slightly_rounded_shadow&#039;) {\n\t\t\t\t\t\t\t\t \t \t$slider .=  &#039;&lt;a href=&quot;#&quot; class=&quot;slider-down-arrow no-border&quot;&gt;&lt;svg class=&quot;nectar-scroll-icon&quot; viewBox=&quot;0 0 30 45&quot; enable-background=&quot;new 0 0 30 45&quot;&gt;\n\t\t\t\t\t                \t\t\t&lt;path class=&quot;nectar-scroll-icon-path&quot; fill=&quot;none&quot; stroke=&quot;#ffffff&quot; stroke-width=&quot;2&quot; stroke-miterlimit=&quot;10&quot; d=&quot;M15,1.118c12.352,0,13.967,12.88,13.967,12.88v18.76  c0,0-1.514,11.204-13.967,11.204S0.931,32.966,0.931,32.966V14.05C0.931,14.05,2.648,1.118,15,1.118z&quot;&gt;&lt;\/path&gt;\n\t\t\t\t\t            \t\t\t  &lt;\/svg&gt;&lt;\/a&gt;&#039;;\n\t\t\t\t\t\t\t\t \t } else {\n\n\t\t\t\t\t\t\t\t\t\t$slider .=  &#039;&lt;a href=&quot;#&quot; class=&quot;slider-down-arrow&quot;&gt;&lt;i class=&quot;icon-salient-down-arrow icon-default-style&quot;&gt; &lt;span class=&quot;ie-fix&quot;&gt;&lt;\/span&gt; &lt;\/i&gt;&lt;\/a&gt;&#039;;\n\t\t\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\t\t}  \n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t$active_texture = ($video_texture == &#039;on&#039;) ? &#039;active_texture&#039; : &#039;&#039;;\n\t\t\t\t\t\t\t\t$slider .=  &#039;&lt;div class=&quot;video-texture &#039;.$active_texture.&#039;&quot;&gt; &lt;span class=&quot;ie-fix&quot;&gt;&lt;\/span&gt; &lt;\/div&gt;&#039;;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t if($background_type == &#039;video_bg&#039;) {\n\t\t\t\t\t\t\t\t \t \n\t\t\t\t\t\t\t\t\t$slider .= &#039;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t&lt;div class=&quot;mobile-video-image&quot; style=&quot;background-image: url(&#039;.$poster.&#039;)&quot;&gt; &lt;span class=&quot;ie-fix&quot;&gt;&lt;\/span&gt;  &lt;\/div&gt;\n\t\t\t\t\t\t\t\t\t&lt;div class=&quot;video-wrap&quot;&gt;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t&lt;video class=&quot;slider-video&quot; width=&quot;1800&quot; height=&quot;700&quot; preload=&quot;auto&quot; loop&gt;&#039;;\n\t\n\t\t\t\t\t\t\t\t\t\t    if(!empty($video_webm)) { $slider .= &#039;&lt;source type=&quot;video\/webm&quot; src=&quot;&#039;.$video_webm.&#039;&quot;&gt;&#039;; }\n\t\t\t\t\t\t\t\t\t\t    if(!empty($video_mp4)) { $slider .= &#039;&lt;source type=&quot;video\/mp4&quot; src=&quot;&#039;.$video_mp4.&#039;&quot;&gt;&#039;; }\n\t\t\t\t\t\t\t\t\t\t    if(!empty($video_ogv)) { $slider .= &#039;&lt;source type=&quot;video\/ogg&quot; src=&quot;&#039;. $video_ogv.&#039;&quot;&gt;&#039;; }\n\t\t\t\t\t\t\t\t\t\t  \n\t\t\t\t\t\t\t\t\t$slider .=&#039;&lt;\/video&gt;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t&lt;\/div&gt;&#039;;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($link_type == &#039;full_slide_link&#039; &amp;&amp; !empty($full_slide_link)) {\n\t\t\t\t\t\t\t\t\t$slider .= &#039;&lt;a href=&quot;&#039;. $full_slide_link.&#039;&quot; class=&quot;entire-slide-link&quot;&gt; &lt;span class=&quot;ie-fix&quot;&gt;&lt;\/span&gt; &lt;\/a&gt;&#039;;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t     $slider .= &#039;&lt;\/div&gt;&lt;!--\/swiper-slide--&gt;&#039;;\n\t\t\t\t\t\t\n\t\t\t\t\t\t $slide_count ++; \n\t\t\t\t\t\t \n\t\t\t\t    endwhile; endif;\n\t\t\t\t\t\n\t\t\t\t\twp_reset_postdata();\n\t\t\t\t    \n\t\t\t\t   $slider .= &#039;&lt;\/div&gt;&#039;;\n\t\n\t\t\t\t     if($config_arr[&#039;arrow_navigation&#039;] == &#039;true&#039; &amp;&amp; $slide_count &gt; 1 &amp;&amp; $config_arr[&#039;slider_button_styling&#039;] != &#039;btn_with_preview&#039; &amp;&amp; $config_arr[&#039;overall_style&#039;] != &#039;directional&#039;) {\n\n\t\t\t\t\t     $slider .= &#039;&lt;a href=&quot;&quot; class=&quot;slider-prev&quot;&gt;&lt;i class=&quot;icon-salient-left-arrow&quot;&gt;&lt;\/i&gt; &lt;div class=&quot;slide-count&quot;&gt; &lt;span class=&quot;slide-current&quot;&gt;1&lt;\/span&gt; &lt;i class=&quot;icon-salient-right-line&quot;&gt;&lt;\/i&gt; &lt;span class=&quot;slide-total&quot;&gt;&lt;\/span&gt; &lt;\/div&gt; &lt;\/a&gt;\n\t\t\t\t     \t\t&lt;a href=&quot;&quot; class=&quot;slider-next&quot;&gt;&lt;i class=&quot;icon-salient-right-arrow&quot;&gt;&lt;\/i&gt; &lt;div class=&quot;slide-count&quot;&gt; &lt;span class=&quot;slide-current&quot;&gt;1&lt;\/span&gt; &lt;i class=&quot;icon-salient-right-line&quot;&gt;&lt;\/i&gt; &lt;span class=&quot;slide-total&quot;&gt;&lt;\/span&gt; &lt;\/div&gt; &lt;\/a&gt;&#039;;\n\t\t\t\t      } \n\n\t\t\t\t\t else if($config_arr[&#039;arrow_navigation&#039;] == &#039;true&#039; &amp;&amp; $slide_count &gt; 1 &amp;&amp; $config_arr[&#039;slider_button_styling&#039;] == &#039;btn_with_preview&#039; || $config_arr[&#039;overall_style&#039;] == &#039;directional&#039;) {\n\t\t\t\t\t     $slider .= &#039;&lt;a href=&quot;&quot; class=&quot;slider-prev&quot;&gt;&lt;i class=&quot;icon-angle-left&quot;&gt;&lt;\/i&gt; &lt;\/a&gt;\n\t\t\t\t     \t\t&lt;a href=&quot;&quot; class=&quot;slider-next&quot;&gt;&lt;i class=&quot;icon-angle-right&quot;&gt;&lt;\/i&gt; &lt;\/a&gt;&#039;;\n\t\t\t\t      } \n\n\t\t\t\t\t if($config_arr[&#039;bullet_navigation&#039;] == &#039;true&#039; &amp;&amp; $slide_count &gt; 1){ \n\t\t\t\t     \t$slider .= &#039;&lt;div class=&quot;slider-pagination&quot;&gt;&lt;\/div&gt;&#039;;\n\t\t\t\t     }\n\t\t\t\t    \n\t\t\t\t$loading_animation = (!empty($options[&#039;loading-image-animation&#039;]) &amp;&amp; !empty($options[&#039;loading-image&#039;])) ? $options[&#039;loading-image-animation&#039;] : null; \n\t\t\t\t$default_loader = (empty($options[&#039;loading-image&#039;]) &amp;&amp; !empty($options[&#039;theme-skin&#039;]) &amp;&amp; $options[&#039;theme-skin&#039;] == &#039;ascend&#039;) ? &#039;&lt;span class=&quot;default-loading-icon spin&quot;&gt;&lt;\/span&gt;&#039; : null;\n\t\t\t\t$default_loader_class = (empty($options[&#039;loading-image&#039;]) &amp;&amp; !empty($options[&#039;theme-skin&#039;]) &amp;&amp; $options[&#039;theme-skin&#039;] == &#039;ascend&#039;) ? &#039;default-loader&#039; : null;\n\t\t\t\t$slider .= &#039;&lt;div class=&quot;nectar-slider-loading &#039;.$default_loader_class.&#039;&quot;&gt; &lt;span class=&quot;loading-icon &#039;.$loading_animation.&#039;&quot;&gt; &#039;.$default_loader.&#039;  &lt;\/span&gt; &lt;\/div&gt; &lt;\/div&gt; \n\t\t\t\t\n\t\t\t&lt;\/div&gt;&#039;;\n\t\t\n\t\tif($config_arr[&#039;parallax&#039;] == &#039;true&#039;) { $slider .= &#039;&lt;\/div&gt;&#039;; }\n\t\t\n\t\treturn $slider;\n\t\n\t}\n\n}\n\n#-----------------------------------------------------------------#\n# Create admin portfolio section\n#-----------------------------------------------------------------# \nfunction portfolio_register() {  \n    \t \n\t $portfolio_labels = array(\n\t \t&#039;name&#039; =&gt; __( &#039;Portfolio&#039;, &#039;taxonomy general name&#039;, NECTAR_THEME_NAME),\n\t\t&#039;singular_name&#039; =&gt; __( &#039;Portfolio Item&#039;, NECTAR_THEME_NAME),\n\t\t&#039;search_items&#039; =&gt;  __( &#039;Search Portfolio Items&#039;, NECTAR_THEME_NAME),\n\t\t&#039;all_items&#039; =&gt; __( &#039;Portfolio&#039;, NECTAR_THEME_NAME),\n\t\t&#039;parent_item&#039; =&gt; __( &#039;Parent Portfolio Item&#039;, NECTAR_THEME_NAME),\n\t\t&#039;edit_item&#039; =&gt; __( &#039;Edit Portfolio Item&#039;, NECTAR_THEME_NAME),\n\t\t&#039;update_item&#039; =&gt; __( &#039;Update Portfolio Item&#039;, NECTAR_THEME_NAME),\n\t\t&#039;add_new_item&#039; =&gt; __( &#039;Add New Portfolio Item&#039;, NECTAR_THEME_NAME)\n\t );\n\t \n\t global $options;\n     $custom_slug = null;\t\t\n\t \n\t if(!empty($options[&#039;portfolio_rewrite_slug&#039;])) $custom_slug = $options[&#039;portfolio_rewrite_slug&#039;];\n\t\n\t $portolfio_menu_icon = (floatval(get_bloginfo(&#039;version&#039;)) &gt;= &quot;3.8&quot;) ? &#039;dashicons-art&#039; : NECTAR_FRAMEWORK_DIRECTORY . &#039;assets\/img\/icons\/portfolio.png&#039;;\n\t\n\t $args = array(\n\t\t\t&#039;labels&#039; =&gt; $portfolio_labels,\n\t\t\t&#039;rewrite&#039; =&gt; array(&#039;slug&#039; =&gt; $custom_slug,&#039;with_front&#039; =&gt; false),\n\t\t\t&#039;singular_label&#039; =&gt; __(&#039;Project&#039;, NECTAR_THEME_NAME),\n\t\t\t&#039;public&#039; =&gt; true,\n\t\t\t&#039;publicly_queryable&#039; =&gt; true,\n\t\t\t&#039;show_ui&#039; =&gt; true,\n\t\t\t&#039;hierarchical&#039; =&gt; false,\n\t\t\t&#039;menu_position&#039; =&gt; 9,\n\t\t\t&#039;menu_icon&#039; =&gt; $portolfio_menu_icon,\n\t\t\t&#039;supports&#039; =&gt; array(&#039;title&#039;, &#039;editor&#039;, &#039;thumbnail&#039;, &#039;comments&#039;, &#039;revisions&#039;)  \n       );  \n  \n    register_post_type( &#039;portfolio&#039; , $args );  \n}  \nadd_action(&#039;init&#039;, &#039;portfolio_register&#039;);\n\n#-----------------------------------------------------------------#\n# Add taxonomys attached to portfolio \n#-----------------------------------------------------------------# \n\nif (!function_exists(&#039;nectar_add_portfolio_taxonomies&#039;)) {\n\t\n\tfunction nectar_add_portfolio_taxonomies(){\n\n\t\t$category_labels = array(\n\t\t\t&#039;name&#039; =&gt; __( &#039;Project Categories&#039;, NECTAR_THEME_NAME),\n\t\t\t&#039;singular_name&#039; =&gt; __( &#039;Project Category&#039;, NECTAR_THEME_NAME),\n\t\t\t&#039;search_items&#039; =&gt;  __( &#039;Search Project Categories&#039;, NECTAR_THEME_NAME),\n\t\t\t&#039;all_items&#039; =&gt; __( &#039;All Project Categories&#039;, NECTAR_THEME_NAME),\n\t\t\t&#039;parent_item&#039; =&gt; __( &#039;Parent Project Category&#039;, NECTAR_THEME_NAME),\n\t\t\t&#039;edit_item&#039; =&gt; __( &#039;Edit Project Category&#039;, NECTAR_THEME_NAME),\n\t\t\t&#039;update_item&#039; =&gt; __( &#039;Update Project Category&#039;, NECTAR_THEME_NAME),\n\t\t\t&#039;add_new_item&#039; =&gt; __( &#039;Add New Project Category&#039;, NECTAR_THEME_NAME),\n\t\t    &#039;menu_name&#039; =&gt; __( &#039;Project Categories&#039;, NECTAR_THEME_NAME)\n\t\t); \t\n\n\t\tregister_taxonomy(&quot;project-type&quot;, \n\t\t\t\tarray(&quot;portfolio&quot;), \n\t\t\t\tarray(&quot;hierarchical&quot; =&gt; true, \n\t\t\t\t\t\t&#039;labels&#039; =&gt; $category_labels,\n\t\t\t\t\t\t&#039;show_ui&#039; =&gt; true,\n\t\t    \t\t\t&#039;query_var&#039; =&gt; true,\n\t\t\t\t\t\t&#039;rewrite&#039; =&gt; array( &#039;slug&#039; =&gt; &#039;project-type&#039; )\n\t\t));\n\n\t\t$attributes_labels = array(\n\t\t\t&#039;name&#039; =&gt; __( &#039;Project Attributes&#039;, NECTAR_THEME_NAME),\n\t\t\t&#039;singular_name&#039; =&gt; __( &#039;Project Attribute&#039;, NECTAR_THEME_NAME),\n\t\t\t&#039;search_items&#039; =&gt;  __( &#039;Search Project Attributes&#039;, NECTAR_THEME_NAME),\n\t\t\t&#039;all_items&#039; =&gt; __( &#039;All Project Attributes&#039;, NECTAR_THEME_NAME),\n\t\t\t&#039;parent_item&#039; =&gt; __( &#039;Parent Project Attribute&#039;, NECTAR_THEME_NAME),\n\t\t\t&#039;edit_item&#039; =&gt; __( &#039;Edit Project Attribute&#039;, NECTAR_THEME_NAME),\n\t\t\t&#039;update_item&#039; =&gt; __( &#039;Update Project Attribute&#039;, NECTAR_THEME_NAME),\n\t\t\t&#039;add_new_item&#039; =&gt; __( &#039;Add New Project Attribute&#039;, NECTAR_THEME_NAME),\n\t\t\t&#039;new_item_name&#039; =&gt; __( &#039;New Project Attribute&#039;, NECTAR_THEME_NAME),\n\t\t    &#039;menu_name&#039; =&gt; __( &#039;Project Attributes&#039;, NECTAR_THEME_NAME)\n\t\t); \t\n\n\t\tregister_taxonomy(&#039;project-attributes&#039;,\n\t\t\tarray(&#039;portfolio&#039;),\n\t\t\tarray(&#039;hierarchical&#039; =&gt; true,\n\t\t    &#039;labels&#039; =&gt; $attributes_labels,\n\t\t    &#039;show_ui&#039; =&gt; true,\n\t\t    &#039;query_var&#039; =&gt; true,\n\t\t    &#039;rewrite&#039; =&gt; array( &#039;slug&#039; =&gt; &#039;project-attributes&#039; )\n\t\t));\n\n\t}\n\n}\n\nnectar_add_portfolio_taxonomies();\n\n\/\/utility function for nectar shortcode generator conditional\nfunction is_edit_page($new_edit = null){\n    global $pagenow;\n    \/\/make sure we are on the backend\n    if (!is_admin()) return false;\n\n    if($new_edit == &quot;edit&quot;)\n        return in_array( $pagenow, array( &#039;post.php&#039;,  ) );\n    elseif($new_edit == &quot;new&quot;) \/\/check for new post page\n        return in_array( $pagenow, array( &#039;post-new.php&#039; ) );\n    else \/\/check for either new or edit\n        return in_array( $pagenow, array( &#039;post.php&#039;, &#039;post-new.php&#039; ) );\n}\n\n\/\/utility function for WPML duplicate content\nif(defined(&#039;ICL_LANGUAGE_CODE&#039;)) {\n\tadd_filter( &#039;icl_ls_languages&#039;, &#039;wmpl_duplicate_content_fix&#039; );\n\tfunction wmpl_duplicate_content_fix( $languages ) {\n\t\twp_reset_query();\n\t\treturn $languages;\n\t}\n}\n\n#-----------------------------------------------------------------#\n# Portfolio single page controls\n#-----------------------------------------------------------------#\nfunction project_single_controls() {\n\n\t\tglobal $options;\n\t\tglobal $post;\n\n\t\t$back_to_all_override = get_post_meta($post-&gt;ID, &#039;nectar-metabox-portfolio-parent-override&#039;, true);\n\t\tif(empty($back_to_all_override)) $back_to_all_override = &#039;default&#039;;\n\t\t\n\t\t\/\/attempt to find parent portfolio page - if unsuccessful default to main portfolio page\n\t\t$terms = get_the_terms($post-&gt;id,&quot;project-type&quot;);\n\t\t$project_cat = null;\n\t\t$portfolio_link = null; \n\t\t$single_nav_pos = (!empty($options[&#039;portfolio_single_nav&#039;])) ? $options[&#039;portfolio_single_nav&#039;] : &#039;in_header&#039;;\n\n\t    if(empty($terms)) $terms = array(&#039;1&#039; =&gt; (object) array(&#039;name&#039; =&gt; &#039;nothing&#039;, &#039;slug&#039; =&gt; &#039;none&#039;));\n\t\t\n     \t foreach ( $terms as $term ) {\n      \t \t$project_cat = strtolower($term-&gt;name);\n     \t }\n\t\t \n\t\t $page = get_page_by_title_search($project_cat);\n\t\t if(empty($page)) $page = array( &#039;0&#039; =&gt; (object) array(&#039;ID&#039; =&gt; &#039;nothing&#039;));\n\t\t \n\t\t $page_link = verify_portfolio_page($page[0]-&gt;ID);\n\t\t\n\t\t \/\/if a page has been found for the category\n\t\t if(!empty($page_link) &amp;&amp; $back_to_all_override == &#039;default&#039; &amp;&amp; $single_nav_pos != &#039;after_project_2&#039;) {\n\t\t \t$portfolio_link = $page_link; \n\n\t\t ?&gt;\n\t\t\t \n\t\t\t &lt;div id=&quot;portfolio-nav&quot;&gt;\n\t\t\t \t&lt;?php if($single_nav_pos != &#039;after_project_2&#039;) { ?&gt;\n\t\t\t\t \t&lt;ul&gt;\n\t\t\t\t \t\t&lt;li id=&quot;all-items&quot;&gt;&lt;a href=&quot;&lt;?php echo $portfolio_link; ?&gt;&quot;&gt;&lt;i class=&quot;icon-salient-back-to-all&quot;&gt;&lt;\/i&gt;&lt;\/a&gt;&lt;\/li&gt;               \n\t\t\t\t \t&lt;\/ul&gt;\n\t\t\t \t&lt;?php } ?&gt;\n\t\t\t\t&lt;ul class=&quot;controls&quot;&gt;                                 \n\t\t\t\t\t&lt;?php if($single_nav_pos == &#039;after_project&#039;) { ?&gt;\n\n\t\t\t\t\t\t&lt;li id=&quot;prev-link&quot;&gt;&lt;?php be_next_post_link(&#039;%link&#039;,&#039;&lt;i class=&quot;icon-angle-left&quot;&gt;&lt;\/i&gt; &lt;span&gt;&#039; . __(&quot;Previous Project&quot;, NECTAR_THEMEN_NAME) .&#039;&lt;\/span&gt;&#039; ,TRUE, null,&#039;project-type&#039;); ?&gt;&lt;\/li&gt;\n\t\t\t\t\t\t&lt;li id=&quot;next-link&quot;&gt;&lt;?php be_previous_post_link(&#039;%link&#039;, &#039;&lt;span&gt;&#039;. __(&#039;Next Project&#039;, NECTAR_THEMEN_NAME) . &#039;&lt;\/span&gt;&lt;i class=&quot;icon-angle-right&quot;&gt;&lt;\/i&gt;&#039;,TRUE, null, &#039;project-type&#039;); ?&gt;&lt;\/li&gt; \n\t\t\t\t\n\t\t\t\t\t&lt;?php } else { ?&gt;\n\n\t\t\t\t\t\t&lt;li id=&quot;prev-link&quot;&gt;&lt;?php be_next_post_link(&#039;%link&#039;,&#039;&lt;i class=&quot;icon-salient-left-arrow-thin&quot;&gt;&lt;\/i&gt;&#039;,TRUE, null,&#039;project-type&#039;); ?&gt;&lt;\/li&gt;\n\t\t\t\t\t\t&lt;li id=&quot;next-link&quot;&gt;&lt;?php be_previous_post_link(&#039;%link&#039;,&#039;&lt;i class=&quot;icon-salient-right-arrow-thin&quot;&gt;&lt;\/i&gt;&#039;,TRUE, null, &#039;project-type&#039;); ?&gt;&lt;\/li&gt; \n\n\t\t\t\t\t&lt;?php } ?&gt;\n\t\t\t\t\t\n\t\t\t\t&lt;\/ul&gt;\n\t\t\t&lt;\/div&gt;\n\t\t\t \n\t&lt;?php  } \n\t\t \n\t\t \/\/if no category page exists\n\t\t else {\n\n\t\t \t$portfolio_link = get_portfolio_page_link(get_the_ID()); \n\t\t\tif(!empty($options[&#039;main-portfolio-link&#039;])) $portfolio_link = $options[&#039;main-portfolio-link&#039;]; \n\t\t\t\n\t\t\tif($back_to_all_override != &#039;default&#039;) $portfolio_link = get_page_link($back_to_all_override); \n\n\t\t\t\t\n\t\t\t?&gt;\n\t\t\t&lt;div id=&quot;portfolio-nav&quot;&gt;\n\t\t\t\t&lt;?php if($single_nav_pos != &#039;after_project_2&#039;) { ?&gt;\n\t\t\t\t\t&lt;ul&gt;\n\t\t\t\t\t\t&lt;li id=&quot;all-items&quot;&gt;&lt;a href=&quot;&lt;?php echo $portfolio_link; ?&gt;&quot; title=&quot;&lt;?php echo __(&#039;Back to all projects&#039;, NECTAR_THEME_NAME); ?&gt;&quot;&gt;&lt;i class=&quot;icon-salient-back-to-all&quot;&gt;&lt;\/i&gt;&lt;\/a&gt;&lt;\/li&gt;  \n\t\t\t\t\t&lt;\/ul&gt;\n\t\t\t\t&lt;?php } ?&gt;\n\n\t\t\t\t&lt;ul class=&quot;controls&quot;&gt;    \n\t\t\t\t\t&lt;?php \n\t\t\t\t\tif(!empty($options[&#039;portfolio_same_category_single_nav&#039;]) &amp;&amp; $options[&#039;portfolio_same_category_single_nav&#039;] == &#039;1&#039;) { \n\n\t\t\t\t\t\t\/\/ get_posts in same custom taxonomy\n\t\t\t\t\t\t$terms = get_the_terms($post-&gt;id,&quot;project-type&quot;);\n\t\t\t\t\t\t$project_cat = null;\n\t\t\t\t\t\t\n\t\t\t\t\t    if(empty($terms)) $terms = array(&#039;1&#039; =&gt; (object) array(&#039;name&#039; =&gt; &#039;nothing&#039;, &#039;slug&#039; =&gt; &#039;none&#039;));\n\t\t\t\t\t\t\n\t\t\t\t     \tforeach ( $terms as $term ) {\n\t\t\t\t      \t \t$project_cat = strtolower($term-&gt;slug);\n\t\t\t\t     \t}\n\n\t\t\t\t\t\t$postlist_args = array(\n\t\t\t\t\t\t   &#039;posts_per_page&#039;  =&gt; -1,\n\t\t\t\t\t\t   &#039;orderby&#039;         =&gt; &#039;menu_order title&#039;,\n\t\t\t\t\t\t   &#039;order&#039;           =&gt; &#039;ASC&#039;,\n\t\t\t\t\t\t   &#039;post_type&#039;       =&gt; &#039;portfolio&#039;,\n\t\t\t\t\t\t   &#039;project-type&#039; =&gt; $project_cat\n\t\t\t\t\t\t); \n\t\t\t\t\t\t$postlist = get_posts( $postlist_args );\n\n\t\t\t\t\t\t\/\/ get ids of posts retrieved from get_posts\n\t\t\t\t\t\t$ids = array();\n\t\t\t\t\t\tforeach ($postlist as $thepost) {\n\t\t\t\t\t\t   $ids[] = $thepost-&gt;ID;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\/\/ get and echo previous and next post in the same taxonomy        \n\t\t\t\t\t\t$thisindex = array_search($post-&gt;ID, $ids);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$previd = (isset($ids[$thisindex-1])) ? $ids[$thisindex-1] : null;\n\t\t\t\t\t\t$nextid = (isset($ids[$thisindex+1])) ? $ids[$thisindex+1] : null;\n\t\t\t\t\t\tif ( !empty($previd) ) {\n\t\t\t\t\t\t  if($single_nav_pos == &#039;after_project&#039;) \n\t\t\t\t\t\t  \t echo &#039;&lt;li id=&quot;prev-link&quot; class=&quot;from-sing&quot;&gt;&lt;a href=&quot;&#039; . get_permalink($previd). &#039;&quot;&gt;&lt;i class=&quot;icon-angle-left&quot;&gt;&lt;\/i&gt;&lt;span&gt;&#039;. __(&#039;Previous Project&#039;, NECTAR_THEME_NAME) .&#039;&lt;\/span&gt;&lt;\/a&gt;&lt;\/li&gt;&#039;;\n\t\t\t\t\t\t \n\t\t\t\t\t\t  else if($single_nav_pos == &#039;after_project_2&#039;) {\n\n\t\t\t\t\t\t  \t$hidden_class = (empty($previd)) ? &#039;hidden&#039; : null ;\n\t\t\t\t\t\t\t$only_class = (empty($nextid)) ? &#039; only&#039;: null;\n\t\t\t\t\t\t\techo &#039;&lt;li class=&quot;previous-project &#039;.$hidden_class.$only_class.&#039;&quot;&gt;&#039;;\n\n\t\t\t\t\t\t\tif(!empty($previd)) {\n\t\t\t\t\t\t\t\t$previous_post_id = $previd;\n\t\t\t\t\t\t\t  \t$bg = get_post_meta($previous_post_id, &#039;_nectar_header_bg&#039;, true);\n\n\t\t\t\t\t\t\t\tif(!empty($bg)){\n\t\t\t\t\t\t\t\t\t\/\/page header\n\t\t\t\t\t\t\t\t\techo &#039;&lt;div class=&quot;proj-bg-img&quot; style=&quot;background-image: url(&#039;.$bg.&#039;);&quot;&gt;&lt;\/div&gt;&#039;;\n\t\t\t\t\t\t\t\t} elseif(has_post_thumbnail($previous_post_id)) {\n\t\t\t\t\t\t\t\t\t\/\/featured image\n\t\t\t\t\t\t\t\t\t$post_thumbnail_id = get_post_thumbnail_id($previous_post_id);\n\t\t\t\t\t\t\t\t\t$post_thumbnail_url = wp_get_attachment_url( $post_thumbnail_id );\n\t\t\t\t\t\t\t\t\techo &#039;&lt;div class=&quot;proj-bg-img&quot; style=&quot;background-image: url(&#039;.$post_thumbnail_url.&#039;);&quot;&gt;&lt;\/div&gt;&#039;;\n\t\t\t\t\t\t\t\t} \t\n\n\t\t\t\t\t\t\t\t\techo &#039;&lt;a href=&quot;&#039;.get_permalink($previous_post_id).&#039;&quot;&gt;&lt;\/a&gt;&lt;h3&gt;&lt;span&gt;&#039;.__(&#039;Previous Project&#039;,NECTAR_THEME_NAME).&#039;&lt;\/span&gt;&lt;span class=&quot;text&quot;&gt;&#039;.get_the_title($previous_post_id).&#039;\n\t\t\t\t\t&lt;svg class=&quot;next-arrow&quot; xmlns=&quot;http:\/\/www.w3.org\/2000\/svg&quot; xmlns:xlink=&quot;http:\/\/www.w3.org\/1999\/xlink&quot; viewBox=&quot;0 0 39 12&quot;&gt;&lt;line class=&quot;top&quot; x1=&quot;23&quot; y1=&quot;-0.5&quot; x2=&quot;29.5&quot; y2=&quot;6.5&quot; stroke=&quot;#ffffff;&quot;&gt;&lt;\/line&gt;&lt;line class=&quot;bottom&quot; x1=&quot;23&quot; y1=&quot;12.5&quot; x2=&quot;29.5&quot; y2=&quot;5.5&quot; stroke=&quot;#ffffff;&quot;&gt;&lt;\/line&gt;&lt;\/svg&gt;&lt;span class=&quot;line&quot;&gt;&lt;\/span&gt;&lt;\/span&gt;&lt;\/h3&gt;&#039;;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\techo &#039;&lt;\/li&gt;&#039;;\n\n\t\t\t\t\t\t  }\n\n\t\t\t\t\t\t  else\n\t\t\t\t\t\t    echo &#039;&lt;li id=&quot;prev-link&quot; class=&quot;from-sing&quot;&gt;&lt;a href=&quot;&#039; . get_permalink($previd). &#039;&quot;&gt;&lt;i class=&quot;icon-salient-left-arrow-thin&quot;&gt;&lt;\/i&gt;&lt;\/a&gt;&lt;\/li&gt;&#039;;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( !empty($nextid) ) {\n\n\t\t\t\t\t\t\t if($single_nav_pos == &#039;after_project&#039;) \n\t\t\t\t\t\t  \t    echo &#039;&lt;li id=&quot;next-link&quot; class=&quot;from-sing&quot;&gt;&lt;a href=&quot;&#039; . get_permalink($nextid). &#039;&quot;&gt;&lt;span&gt;&#039;. __(&#039;Next Project&#039;, NECTAR_THEME_NAME) .&#039;&lt;\/span&gt;&lt;i class=&quot;icon-angle-right&quot;&gt;&lt;\/i&gt;&lt;\/a&gt;&lt;\/li&gt;&#039;;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\telse if($single_nav_pos == &#039;after_project_2&#039;) {\n\n\t\t\t\t\t\t\t\t$hidden_class = (empty($nextid)) ? &#039;hidden&#039; : null ;\n\t\t\t\t\t\t\t\t$only_class = (empty($previd)) ? &#039; only&#039;: null;\n\n\t\t\t\t\t\t\t\techo &#039;&lt;li class=&quot;next-project &#039;.$hidden_class.$only_class.&#039;&quot;&gt;&#039;;\n\n\t\t\t\t\t\t\t\t\tif(!empty($nextid)) {\n\t\t\t\t\t\t\t\t\t\t$next_post_id = $nextid;\n\t\t\t\t\t\t\t\t\t\t$bg = get_post_meta($next_post_id, &#039;_nectar_header_bg&#039;, true);\n\n\t\t\t\t\t\t\t\t\t\tif(!empty($bg)){\n\t\t\t\t\t\t\t\t\t\t\t\/\/page header\n\t\t\t\t\t\t\t\t\t\t\techo &#039;&lt;div class=&quot;proj-bg-img&quot; style=&quot;background-image: url(&#039;.$bg.&#039;);&quot;&gt;&lt;\/div&gt;&#039;;\n\t\t\t\t\t\t\t\t\t\t} elseif(has_post_thumbnail($next_post_id)) {\n\t\t\t\t\t\t\t\t\t\t\t\/\/featured image\n\t\t\t\t\t\t\t\t\t\t\t$post_thumbnail_id = get_post_thumbnail_id($next_post_id);\n\t\t\t\t\t\t\t\t\t\t\t$post_thumbnail_url = wp_get_attachment_url( $post_thumbnail_id );\n\t\t\t\t\t\t\t\t\t\t\techo &#039;&lt;div class=&quot;proj-bg-img&quot; style=&quot;background-image: url(&#039;.$post_thumbnail_url.&#039;);&quot;&gt;&lt;\/div&gt;&#039;;\n\t\t\t\t\t\t\t\t\t\t} \t\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\techo &#039;&lt;a href=&quot;&#039;.get_permalink($next_post_id).&#039;&quot;&gt;&lt;\/a&gt;&lt;h3&gt;&lt;span&gt;&#039;.__(&#039;Next Project&#039;,NECTAR_THEME_NAME).&#039;&lt;\/span&gt;&lt;span class=&quot;text&quot;&gt;&#039;.get_the_title($next_post_id).&#039;\n\t\t\t\t\t\t&lt;svg class=&quot;next-arrow&quot; xmlns=&quot;http:\/\/www.w3.org\/2000\/svg&quot; xmlns:xlink=&quot;http:\/\/www.w3.org\/1999\/xlink&quot; viewBox=&quot;0 0 39 12&quot;&gt;&lt;line class=&quot;top&quot; x1=&quot;23&quot; y1=&quot;-0.5&quot; x2=&quot;29.5&quot; y2=&quot;6.5&quot; stroke=&quot;#ffffff;&quot;&gt;&lt;\/line&gt;&lt;line class=&quot;bottom&quot; x1=&quot;23&quot; y1=&quot;12.5&quot; x2=&quot;29.5&quot; y2=&quot;5.5&quot; stroke=&quot;#ffffff;&quot;&gt;&lt;\/line&gt;&lt;\/svg&gt;&lt;span class=&quot;line&quot;&gt;&lt;\/span&gt;&lt;\/span&gt;&lt;\/h3&gt;&#039;;\n\n\t\t\t\t\t\t\t\techo &#039;&lt;\/li&gt;&#039;;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t    echo &#039;&lt;li id=&quot;next-link&quot; class=&quot;from-sing&quot;&gt;&lt;a href=&quot;&#039; . get_permalink($nextid). &#039;&quot;&gt;&lt;i class=&quot;icon-salient-right-arrow-thin&quot;&gt;&lt;\/i&gt;&lt;\/a&gt;&lt;\/li&gt;&#039;;\n\t\t\t\t\t\t} \n\n\t\t\t\t\t\t\n\t\t\t\t\t} else { ?&gt;\n\t\t\t\t\t\t&lt;?php if($single_nav_pos == &#039;after_project&#039;) { ?&gt;\n\t\t\t\t\t\t\t&lt;li id=&quot;prev-link&quot;&gt;&lt;?php next_post_link(&#039;%link&#039;,&#039;&lt;i class=&quot;icon-angle-left&quot;&gt;&lt;\/i&gt;&lt;span&gt;&#039;.__(&#039;Previous Project&#039;, NECTAR_THEME_NAME).&#039;&lt;\/span&gt;&#039;); ?&gt;&lt;\/li&gt;\n\t\t\t\t\t\t\t&lt;li id=&quot;next-link&quot;&gt;&lt;?php previous_post_link(&#039;%link&#039;, &#039;&lt;span&gt;&#039;. __(&#039;Next Project&#039;, NECTAR_THEME_NAME).&#039;&lt;\/span&gt;&lt;i class=&quot;icon-angle-right&quot;&gt;&lt;\/i&gt;&#039;); ?&gt;&lt;\/li&gt; \n\t\t\t\t\t\t&lt;?php } \n\n\t\t\t\t\t\telse if($single_nav_pos == &#039;after_project_2&#039;) {\n\n\t\t\t\t\t\t\t$previous_post = get_next_post();\n\t\t\t\t\t\t\t$next_post = get_previous_post();\n\n\t\t\t\t\t\t\t$hidden_class = (empty($previous_post)) ? &#039;hidden&#039; : null ;\n\t\t\t\t\t\t\t$only_class = (empty($next_post)) ? &#039; only&#039;: null;\n\t\t\t\t\t\t\techo &#039;&lt;li class=&quot;previous-project &#039;.$hidden_class.$only_class.&#039;&quot;&gt;&#039;;\n\n\t\t\t\t\t\t\tif(!empty($previous_post)) {\n\t\t\t\t\t\t\t\t$previous_post_id = $previous_post-&gt;ID;\n\t\t\t\t\t\t\t  \t$bg = get_post_meta($previous_post_id, &#039;_nectar_header_bg&#039;, true);\n\n\t\t\t\t\t\t\t\tif(!empty($bg)){\n\t\t\t\t\t\t\t\t\t\/\/page header\n\t\t\t\t\t\t\t\t\techo &#039;&lt;div class=&quot;proj-bg-img&quot; style=&quot;background-image: url(&#039;.$bg.&#039;);&quot;&gt;&lt;\/div&gt;&#039;;\n\t\t\t\t\t\t\t\t} elseif(has_post_thumbnail($previous_post_id)) {\n\t\t\t\t\t\t\t\t\t\/\/featured image\n\t\t\t\t\t\t\t\t\t$post_thumbnail_id = get_post_thumbnail_id($previous_post_id);\n\t\t\t\t\t\t\t\t\t$post_thumbnail_url = wp_get_attachment_url( $post_thumbnail_id );\n\t\t\t\t\t\t\t\t\techo &#039;&lt;div class=&quot;proj-bg-img&quot; style=&quot;background-image: url(&#039;.$post_thumbnail_url.&#039;);&quot;&gt;&lt;\/div&gt;&#039;;\n\t\t\t\t\t\t\t\t} \t\n\n\t\t\t\t\t\t\t\t\techo &#039;&lt;a href=&quot;&#039;.get_permalink($previous_post_id).&#039;&quot;&gt;&lt;\/a&gt;&lt;h3&gt;&lt;span&gt;&#039;.__(&#039;Previous Project&#039;,NECTAR_THEME_NAME).&#039;&lt;\/span&gt;&lt;span class=&quot;text&quot;&gt;&#039;.$previous_post-&gt;post_title.&#039;\n\t\t\t\t\t&lt;svg class=&quot;next-arrow&quot; xmlns=&quot;http:\/\/www.w3.org\/2000\/svg&quot; xmlns:xlink=&quot;http:\/\/www.w3.org\/1999\/xlink&quot; viewBox=&quot;0 0 39 12&quot;&gt;&lt;line class=&quot;top&quot; x1=&quot;23&quot; y1=&quot;-0.5&quot; x2=&quot;29.5&quot; y2=&quot;6.5&quot; stroke=&quot;#ffffff;&quot;&gt;&lt;\/line&gt;&lt;line class=&quot;bottom&quot; x1=&quot;23&quot; y1=&quot;12.5&quot; x2=&quot;29.5&quot; y2=&quot;5.5&quot; stroke=&quot;#ffffff;&quot;&gt;&lt;\/line&gt;&lt;\/svg&gt;&lt;span class=&quot;line&quot;&gt;&lt;\/span&gt;&lt;\/span&gt;&lt;\/h3&gt;&#039;;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\techo &#039;&lt;\/li&gt;&#039;;\n\n\t\t\t\t\t\t\t$hidden_class = (empty($next_post)) ? &#039;hidden&#039; : null ;\n\t\t\t\t\t\t\t$only_class = (empty($previous_post)) ? &#039; only&#039;: null;\n\n\t\t\t\t\t\t\techo &#039;&lt;li class=&quot;next-project &#039;.$hidden_class.$only_class.&#039;&quot;&gt;&#039;;\n\n\t\t\t\t\t\t\t\tif(!empty($next_post)) {\n\t\t\t\t\t\t\t\t\t$next_post_id = $next_post-&gt;ID;\n\t\t\t\t\t\t\t\t\t$bg = get_post_meta($next_post_id, &#039;_nectar_header_bg&#039;, true);\n\n\t\t\t\t\t\t\t\t\tif(!empty($bg)){\n\t\t\t\t\t\t\t\t\t\t\/\/page header\n\t\t\t\t\t\t\t\t\t\techo &#039;&lt;div class=&quot;proj-bg-img&quot; style=&quot;background-image: url(&#039;.$bg.&#039;);&quot;&gt;&lt;\/div&gt;&#039;;\n\t\t\t\t\t\t\t\t\t} elseif(has_post_thumbnail($next_post_id)) {\n\t\t\t\t\t\t\t\t\t\t\/\/featured image\n\t\t\t\t\t\t\t\t\t\t$post_thumbnail_id = get_post_thumbnail_id($next_post_id);\n\t\t\t\t\t\t\t\t\t\t$post_thumbnail_url = wp_get_attachment_url( $post_thumbnail_id );\n\t\t\t\t\t\t\t\t\t\techo &#039;&lt;div class=&quot;proj-bg-img&quot; style=&quot;background-image: url(&#039;.$post_thumbnail_url.&#039;);&quot;&gt;&lt;\/div&gt;&#039;;\n\t\t\t\t\t\t\t\t\t} \t\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\techo &#039;&lt;a href=&quot;&#039;.get_permalink($next_post_id).&#039;&quot;&gt;&lt;\/a&gt;&lt;h3&gt;&lt;span&gt;&#039;.__(&#039;Next Project&#039;,NECTAR_THEME_NAME).&#039;&lt;\/span&gt;&lt;span class=&quot;text&quot;&gt;&#039;.$next_post-&gt;post_title.&#039;\n\t\t\t\t\t&lt;svg class=&quot;next-arrow&quot; xmlns=&quot;http:\/\/www.w3.org\/2000\/svg&quot; xmlns:xlink=&quot;http:\/\/www.w3.org\/1999\/xlink&quot; viewBox=&quot;0 0 39 12&quot;&gt;&lt;line class=&quot;top&quot; x1=&quot;23&quot; y1=&quot;-0.5&quot; x2=&quot;29.5&quot; y2=&quot;6.5&quot; stroke=&quot;#ffffff;&quot;&gt;&lt;\/line&gt;&lt;line class=&quot;bottom&quot; x1=&quot;23&quot; y1=&quot;12.5&quot; x2=&quot;29.5&quot; y2=&quot;5.5&quot; stroke=&quot;#ffffff;&quot;&gt;&lt;\/line&gt;&lt;\/svg&gt;&lt;span class=&quot;line&quot;&gt;&lt;\/span&gt;&lt;\/span&gt;&lt;\/h3&gt;&#039;;\n\n\t\t\t\t\t\t\techo &#039;&lt;\/li&gt;&#039;;\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t  }\n\n\t\t\t\t\t\telse { ?&gt; \n\t\t\t\t\t\t\t&lt;li id=&quot;prev-link&quot;&gt;&lt;?php next_post_link(&#039;%link&#039;,&#039;&lt;i class=&quot;icon-salient-left-arrow-thin&quot;&gt;&lt;\/i&gt;&#039;); ?&gt;&lt;?php if($single_nav_pos == &#039;after_project&#039;) echo __(&#039;Previous Project&#039;, NECTAR_THEME_NAME); ?&gt;&lt;\/li&gt;\n\t\t\t\t\t\t\t&lt;li id=&quot;next-link&quot;&gt;&lt;?php if($single_nav_pos == &#039;after_project&#039;) echo __(&#039;Next Project&#039;, NECTAR_THEME_NAME); ?&gt;&lt;?php previous_post_link(&#039;%link&#039;,&#039;&lt;i class=&quot;icon-salient-right-arrow-thin&quot;&gt;&lt;\/i&gt;&#039;); ?&gt;&lt;\/li&gt; \n\t\t\t\t\t\t&lt;?php } ?&gt;\n\n\t\t\t\t\t&lt;?php } ?&gt;                                   \n\t\t\t\t&lt;\/ul&gt;\n\t\t\t&lt;\/div&gt;\n\t &lt;?php } \n}\n\n#-----------------------------------------------------------------#\n# Shortcodes - have to load after taxonomy\/post type declarations\n#-----------------------------------------------------------------#\n\nfunction nectar_shortcode_init() {\n \t\n\t\n\t\/\/load nectar shortcode button\n\trequire_once ( &#039;nectar\/tinymce\/tinymce-class.php&#039; );\t\t\n\t\n}\n\nif(is_admin()){\n\tif(is_edit_page()) {\n\n\t\tadd_action(&#039;init&#039;, &#039;nectar_shortcode_init&#039;);\n\t\n\t}\n}\n\n\/\/Add button to page\nadd_action(&#039;media_buttons&#039;,&#039;nectar_buttons&#039;,100);\n\nfunction nectar_buttons() {\n     echo &quot;&lt;a data-effect=&#039;mfp-zoom-in&#039; class=&#039;button nectar-shortcode-generator&#039; href=&#039;#nectar-sc-generator&#039;&gt;&lt;img src=&#039;&quot;.get_template_directory_uri().&quot;\/nectar\/assets\/img\/icons\/n.png&#039; \/&gt; &quot;. __(&#039;Nectar Shortcodes&#039;, NECTAR_THEME_NAME).&quot;&lt;\/a&gt;&quot;;\n}\n\n\/\/Shortcode Processing\nif (!function_exists(&#039;nectar_shortcode_processing&#039;)) {\n\tfunction nectar_shortcode_processing(){\n\t\trequire_once ( &#039;nectar\/tinymce\/shortcode-processing.php&#039; );\n\t}\n}\n\nadd_action(&#039;init&#039;, &#039;nectar_shortcode_processing&#039;);\n\n#-----------------------------------------------------------------#\n# Portfolio Meta\n#-----------------------------------------------------------------# \n\ninclude(&quot;nectar\/meta\/portfolio-meta.php&quot;);\n\n#-----------------------------------------------------------------#\n# New category walker for portfolio filter\n#-----------------------------------------------------------------# \n\nclass Walker_Portfolio_Filter extends Walker_Category {\n\t\n   function start_el(&amp;$output, $category, $depth = 0, $args = array(), $current_object_id = 0) {\n\n      extract($args);\n      $cat_slug = esc_attr( $category-&gt;slug );\n      $cat_slug = apply_filters( &#039;list_cats&#039;, $cat_slug, $category );\n\t  \n      $link = &#039;&lt;li&gt;&lt;a href=&quot;#&quot; data-filter=&quot;.&#039;.strtolower(preg_replace(&#039;\/\\s+\/&#039;, &#039;-&#039;, $cat_slug)).&#039;&quot;&gt;&#039;;\n\t  \n\t  $cat_name = esc_attr( $category-&gt;name );\n      $cat_name = apply_filters( &#039;list_cats&#039;, $cat_name, $category );\n\t  \t\n      $link .= $cat_name;\n\t  \n      if(!empty($category-&gt;description)) {\n         $link .= &#039; &lt;span&gt;&#039;.$category-&gt;description.&#039;&lt;\/span&gt;&#039;;\n      }\n\t  \n      $link .= &#039;&lt;\/a&gt;&#039;;\n     \n      $output .= $link;\n       \n   }\n}\n\n#-----------------------------------------------------------------#\n# Function to get the page link back to all portfolio items\n#-----------------------------------------------------------------#\n\nfunction get_portfolio_page_link($post_id) {\n    global $wpdb;\n\t\n\t$post_id = sanitize_text_field($post_id);\n\n    $results = $wpdb-&gt;get_results(&quot;SELECT post_id FROM $wpdb-&gt;postmeta\n    WHERE meta_key=&#039;_wp_page_template&#039; AND meta_value=&#039;template-portfolio.php&#039;&quot;);\n    \n\t\/\/safety net\n    $page_id = null;\n\t \n    foreach ($results as $result) \n    {\n        $page_id = $result-&gt;post_id;\n    }\n\t\n    return get_page_link($page_id);\n} \n\n#-----------------------------------------------------------------#\n# Function to get verify that the page has the portfolio layout assigned \n#-----------------------------------------------------------------#\n\nfunction verify_portfolio_page($post_id) {\n    global $wpdb;\n\n    $post_id = sanitize_text_field($post_id);\n\t\n    $result = $wpdb-&gt;get_results(&quot;SELECT post_id FROM $wpdb-&gt;postmeta\n    WHERE meta_key=&#039;_wp_page_template&#039; AND meta_value=&#039;template-portfolio.php&#039; AND post_id=&#039;$post_id&#039; LIMIT 1&quot;);\n\t\n\tif(!empty($result)) {\n\t\treturn get_page_link($result[0]-&gt;post_id);\n\t} else {\n\t\treturn null;\n\t}\n} \n\n#-----------------------------------------------------------------#\n# Function to find page that contains string\n#-----------------------------------------------------------------#\n\nfunction get_page_by_title_search($string){\n    global $wpdb;\n\n    $string = sanitize_text_field($string);\n    $title = esc_sql($string); \n    if(!$title) return;\n    $page = $wpdb-&gt;get_results(&quot;\n        SELECT * \n        FROM $wpdb-&gt;posts\n        WHERE post_title LIKE &#039;%$title%&#039;\n        AND post_type = &#039;page&#039; \n        AND post_status = &#039;publish&#039;\n        LIMIT 1\n    &quot;);\n    return $page;\n}\n\n#-----------------------------------------------------------------#\n# Post meta\n#-----------------------------------------------------------------#\n\nfunction enqueue_media(){\n\t\n\t\/\/enqueue the correct media scripts for the media library \n\n\tif ( floatval(get_bloginfo(&#039;version&#039;)) &lt; &quot;3.5&quot; ) {\n\t    wp_enqueue_script(\n\t        &#039;redux-opts-field-upload-js&#039;, \n\t        ReduxFramework::$_url . &#039;inc\/fields\/upload\/field_upload_3_4.js&#039;, \n\t        array(&#039;jquery&#039;, &#039;thickbox&#039;, &#039;media-upload&#039;),\n\t        &#039;8.0.1&#039;,\n\t        true\n\t    );\n\t    wp_enqueue_style(&#039;thickbox&#039;);\/\/ thanks to https:\/\/github.com\/rzepak\n\t} else {\n\t   \n\t}\n\t\n}\n\n\/\/post meta styling\nfunction  nectar_metabox_styles() {\n\twp_enqueue_style(&#039;nectar_meta_css&#039;, NECTAR_FRAMEWORK_DIRECTORY .&#039;assets\/css\/nectar_meta.css&#039;,&#039;&#039;, &#039;6.5&#039;);\n}\n\n\/\/post meta scripts\nfunction nectar_metabox_scripts() {\n\twp_register_script(&#039;nectar-upload&#039;, NECTAR_FRAMEWORK_DIRECTORY .&#039;assets\/js\/nectar-meta.js&#039;, array(&#039;jquery&#039;), &#039;3.0.5&#039;);\n\twp_enqueue_script(&#039;nectar-upload&#039;);\n\twp_localize_script(&#039;redux-opts-field-upload-js&#039;, &#039;redux_upload&#039;, array(&#039;url&#039; =&gt; get_template_directory_uri() .&#039;\/nectar\/redux-framework\/ReduxCore\/inc\/fields\/upload\/blank.png&#039;));\n\t\n\tif(floatval(get_bloginfo(&#039;version&#039;)) &gt;= &#039;3.5&#039;) {\n\t    wp_enqueue_style(&#039;wp-color-picker&#039;);\n\t     wp_enqueue_script(\n\t        &#039;redux-opts-field-upload-js&#039;, \n\t        get_template_directory_uri() .&#039;\/nectar\/redux-framework\/ReduxCore\/inc\/fields\/upload\/field_upload.js&#039;, \n\t        array(&#039;jquery&#039;),\n\t        &#039;8.0.1&#039;,\n\t        true\n\t    ); \n\t    wp_enqueue_script(\n\t        &#039;redux-opts-field-color-js&#039;,\n\t        NECTAR_FRAMEWORK_DIRECTORY . &#039;options\/fields\/color\/field_color.js&#039;,\n\t        array(&#039;wp-color-picker&#039;),\n\t        &#039;8.0.1&#039;,\n\t        true\n\t    );\n\t     wp_enqueue_media();\n\t} else {\n\n\t    wp_enqueue_script(\n\t        &#039;redux-opts-field-color-js&#039;, \n\t        NECTAR_FRAMEWORK_DIRECTORY . &#039;options\/fields\/color\/field_color_farb.js&#039;, \n\t        array(&#039;jquery&#039;, &#039;farbtastic&#039;),\n\t        time(),\n\t        true\n\t    );\n\t   \n\t}\n\t\n}\n\nadd_action(&#039;admin_enqueue_scripts&#039;, &#039;nectar_metabox_scripts&#039;);\nadd_action(&#039;admin_print_styles&#039;, &#039;nectar_metabox_styles&#039;);\nadd_action(&#039;admin_print_styles&#039;, &#039;enqueue_media&#039;);\n\n\/\/post meta core functions\ninclude(&quot;nectar\/meta\/meta-config.php&quot;);\ninclude(&quot;nectar\/meta\/post-meta.php&quot;);\n\nfunction nectar_blog_social_sharing() {\n\n\t global $options;\n\t global $post;\n\n\t ob_start(); \n\n\t $fullscreen_header = (!empty($options[&#039;blog_header_type&#039;]) &amp;&amp; $options[&#039;blog_header_type&#039;] == &#039;fullscreen&#039; &amp;&amp; is_singular(&#039;post&#039;)) ? true : false;\n\t $fullscreen_class = ($fullscreen_header == true) ? &#039;hide-share-count&#039;: null;\n     $blog_header_type = (!empty($options[&#039;blog_header_type&#039;])) ? $options[&#039;blog_header_type&#039;] : &#039;default&#039;;\n\n\t if( !empty($options[&#039;blog_social&#039;]) &amp;&amp; $options[&#039;blog_social&#039;] == 1 || $fullscreen_header == true) { \n\t\t\t\t\t\t\t\t\t\t   \n\t\t   echo &#039;&lt;div class=&quot;nectar-social &#039;.$fullscreen_class.&#039;&quot;&gt;&#039;;\n\n\t\t  \t if($fullscreen_header == false) {\n\t\t  \t \t\n\t\t  \t \techo &#039;&lt;span class=&quot;n-shortcode&quot;&gt;&#039;.nectar_love(&#039;return&#039;).&#039;&lt;\/span&gt;&#039;;\n\n\t\t\t\t\/\/facebook\n\t\t\t\tif(!empty($options[&#039;blog-facebook-sharing&#039;]) &amp;&amp; $options[&#039;blog-facebook-sharing&#039;] == 1) { \n\t\t\t\t\techo &quot;&lt;a class=&#039;facebook-share nectar-sharing&#039; href=&#039;#&#039; title=&#039;&quot;.__(&#039;Share this&#039;, NECTAR_THEME_NAME).&quot;&#039;&gt;  &lt;i class=&#039;fa fa-facebook&#039;&gt;&lt;\/i&gt; &lt;span class=&#039;social-text&#039;&gt;&quot;.__(&#039;Share&#039;,NECTAR_THEME_NAME).&quot;&lt;\/span&gt; &lt;span class=&#039;count&#039;&gt;&lt;\/span&gt;&lt;\/a&gt;&quot;;\n\t\t\t\t}\n\t\t\t\t\/\/twitter\n\t\t\t\tif(!empty($options[&#039;blog-twitter-sharing&#039;]) &amp;&amp; $options[&#039;blog-twitter-sharing&#039;] == 1) {\n\t\t\t\t\techo &quot;&lt;a class=&#039;twitter-share nectar-sharing&#039; href=&#039;#&#039; title=&#039;&quot;.__(&#039;Tweet this&#039;, NECTAR_THEME_NAME).&quot;&#039;&gt; &lt;i class=&#039;fa fa-twitter&#039;&gt;&lt;\/i&gt; &lt;span class=&#039;social-text&#039;&gt;&quot;.__(&#039;Tweet&#039;,NECTAR_THEME_NAME).&quot;&lt;\/span&gt; &lt;span class=&#039;count&#039;&gt;&lt;\/span&gt;&lt;\/a&gt;&quot;;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\/\/google plus\n\t\t\t\tif(!empty($options[&#039;blog-google-plus-sharing&#039;]) &amp;&amp; $options[&#039;blog-google-plus-sharing&#039;] == 1) {\n\t\t\t\t\techo &quot;&lt;a class=&#039;google-plus-share nectar-sharing-alt&#039; href=&#039;#&#039; title=&#039;&quot;.__(&#039;Share this&#039;, NECTAR_THEME_NAME).&quot;&#039;&gt; &lt;i class=&#039;fa fa-google-plus&#039;&gt;&lt;\/i&gt; &lt;span class=&#039;social-text&#039;&gt;&quot;.__(&#039;Share&#039;,NECTAR_THEME_NAME).&quot;&lt;\/span&gt; &lt;span class=&#039;count&#039;&gt;0&lt;\/span&gt;&lt;\/a&gt;&quot;;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\/\/linkedIn\n\t\t\t\tif(!empty($options[&#039;blog-linkedin-sharing&#039;]) &amp;&amp; $options[&#039;blog-linkedin-sharing&#039;] == 1) {\n\t\t\t\t\techo &quot;&lt;a class=&#039;linkedin-share nectar-sharing&#039; href=&#039;#&#039; title=&#039;&quot;.__(&#039;Share this&#039;, NECTAR_THEME_NAME).&quot;&#039;&gt; &lt;i class=&#039;fa fa-linkedin&#039;&gt;&lt;\/i&gt; &lt;span class=&#039;social-text&#039;&gt;&quot;.__(&#039;Share&#039;,NECTAR_THEME_NAME).&quot;&lt;\/span&gt; &lt;span class=&#039;count&#039;&gt; &lt;\/span&gt;&lt;\/a&gt;&quot;;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\/\/pinterest\n\t\t\t\tif(!empty($options[&#039;blog-pinterest-sharing&#039;]) &amp;&amp; $options[&#039;blog-pinterest-sharing&#039;] == 1) {\n\t\t\t\t\techo &quot;&lt;a class=&#039;pinterest-share nectar-sharing&#039; href=&#039;#&#039; title=&#039;&quot;.__(&#039;Pin this&#039;, NECTAR_THEME_NAME).&quot;&#039;&gt; &lt;i class=&#039;fa fa-pinterest&#039;&gt;&lt;\/i&gt; &lt;span class=&#039;social-text&#039;&gt;&quot;.__(&#039;Pin&#039;,NECTAR_THEME_NAME).&quot;&lt;\/span&gt; &lt;span class=&#039;count&#039;&gt;&lt;\/span&gt;&lt;\/a&gt;&quot;;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t\/\/facebook\n\t\t\t\techo &quot;&lt;a class=&#039;facebook-share nectar-sharing&#039; href=&#039;#&#039; title=&#039;&quot;.__(&#039;Share this&#039;, NECTAR_THEME_NAME).&quot;&#039;&gt; &lt;i class=&#039;fa fa-facebook&#039;&gt;&lt;\/i&gt; &lt;span class=&#039;count&#039;&gt;&lt;\/span&gt;&lt;\/a&gt;&quot;;\n\t\t\t\techo &quot;&lt;a class=&#039;twitter-share nectar-sharing&#039; href=&#039;#&#039; title=&#039;&quot;.__(&#039;Tweet this&#039;, NECTAR_THEME_NAME).&quot;&#039;&gt; &lt;i class=&#039;fa fa-twitter&#039;&gt;&lt;\/i&gt; &lt;span class=&#039;count&#039;&gt;&lt;\/span&gt;&lt;\/a&gt;&quot;;\n\t\t\t\techo &quot;&lt;a class=&#039;google-plus-share nectar-sharing-alt&#039; href=&#039;#&#039; title=&#039;&quot;.__(&#039;Share this&#039;, NECTAR_THEME_NAME).&quot;&#039;&gt; &lt;i class=&#039;fa fa-google-plus&#039;&gt;&lt;\/i&gt; &lt;span class=&#039;count&#039;&gt;0&lt;\/span&gt;&lt;\/a&gt;&quot;;\n\t\t\t\techo &quot;&lt;a class=&#039;linkedin-share nectar-sharing&#039; href=&#039;#&#039; title=&#039;&quot;.__(&#039;Share this&#039;, NECTAR_THEME_NAME).&quot;&#039;&gt; &lt;i class=&#039;fa fa-linkedin&#039;&gt;&lt;\/i&gt; &lt;span class=&#039;count&#039;&gt; &lt;\/span&gt;&lt;\/a&gt;&quot;;\n\t\t\t\techo &quot;&lt;a class=&#039;pinterest-share nectar-sharing&#039; href=&#039;#&#039; title=&#039;&quot;.__(&#039;Pin this&#039;, NECTAR_THEME_NAME).&quot;&#039;&gt; &lt;i class=&#039;fa fa-pinterest&#039;&gt;&lt;\/i&gt; &lt;span class=&#039;count&#039;&gt;&lt;\/span&gt;&lt;\/a&gt;&quot;;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t  echo &#039;&lt;\/div&gt;&#039;;\n\n\t\t}\n\n\t\t$sharing_output = ob_get_contents();\n\t\tob_end_clean();\n\n\t\techo $sharing_output;\n}\n\nfunction nectar_next_post_display() {\n\n\t global $post;\n\t global $options;\n\n\t $post_header_style = (!empty($options[&#039;blog_header_type&#039;])) ? $options[&#039;blog_header_type&#039;] : &#039;default&#039;; \n\n\t ob_start(); \n\t $next_post = get_previous_post();\n\t if (!empty( $next_post ) &amp;&amp; !empty($options[&#039;blog_next_post_link&#039;]) &amp;&amp; $options[&#039;blog_next_post_link&#039;] == &#039;1&#039;) { ?&gt;\n\n\t\t\t&lt;div data-post-header-style=&quot;&lt;?php echo $post_header_style; ?&gt;&quot; class=&quot;blog_next_prev_buttons wpb_row vc_row-fluid full-width-content standard_section&quot; data-midnight=&quot;light&quot;&gt;\n\n\t\t\t\t&lt;?php \n\n\t\t\t\t\t$bg = get_post_meta($next_post-&gt;ID, &#039;_nectar_header_bg&#039;, true);\n\t\t\t\t\t$bg_color = get_post_meta($next_post-&gt;ID, &#039;_nectar_header_bg_color&#039;, true);\n\n\t\t\t\t\tif(!empty($bg) || !empty($bg_color)){\n\t\t\t\t\t\t\/\/page header\n\t\t\t\t\t\tif(!empty($bg)) echo &#039;&lt;img src=&quot;&#039;.$bg.&#039;&quot; alt=&quot;&#039;.get_the_title($next_post-&gt;ID).&#039;&quot; \/&gt;&#039;;\n\t\t\t\t\t\telse echo &#039;&lt;span class=&quot;bg-color-only-indicator&quot;&gt;&lt;\/span&gt;&#039;;\n\t\t\t\t\t} elseif(has_post_thumbnail($next_post-&gt;ID)) {\n\t\t\t\t\t\t\/\/featured image\n\t\t\t\t\t\t$post_thumbnail_id = get_post_thumbnail_id($next_post-&gt;ID);\n\t\t\t\t\t\t$post_thumbnail_url = wp_get_attachment_url( $post_thumbnail_id );\n\t\t\t\t\t\techo &#039;&lt;img src=&quot;&#039;.$post_thumbnail_url.&#039;&quot; alt=&quot;&#039;.get_the_title($next_post-&gt;ID).&#039;&quot; \/&gt;&#039;;\n\t\t\t\t\t} \n\t\t\t\t\t\n\t\t\t\t?&gt;\n\t\t\t\t\n\t\t\t\t&lt;div class=&quot;col span_12 dark left&quot;&gt;\n\t\t\t\t\t&lt;div class=&quot;inner&quot;&gt;\n\t\t\t\t\t\t&lt;span&gt;&lt;?php echo &#039;&lt;i&gt;&#039;. __(&#039;Next Post&#039;,NECTAR_THEME_NAME) .&#039;&lt;\/i&gt;&#039;; ?&gt;&lt;\/span&gt;\n\t\t\t\t\t\t&lt;?php previous_post_link(&#039;%link&#039;,&#039;&lt;h3&gt;%title&lt;\/h3&gt;&#039;); ?&gt;\n\t\t\t\t\t&lt;\/div&gt;\t\t\t\t\n\t\t\t &lt;\/div&gt;\n\t\t\t &lt;span class=&quot;bg-overlay&quot;&gt;&lt;\/span&gt;\n\t\t\t &lt;span class=&quot;full-link&quot;&gt;&lt;?php previous_post_link(&#039;%link&#039;); ?&gt;&lt;\/span&gt;\n\t\t &lt;\/div&gt;\n\n\t&lt;?php }\n\n\t$next_post_link_output = ob_get_contents();\n\tob_end_clean();\n\n\techo $next_post_link_output;\n\n} \n\n\/\/default video size\n$content_width = 1080;\n\n\/** Grab IDs from new WP 3.5 gallery **\/\nfunction grab_ids_from_gallery() {\n\tglobal $post;\n\t\n\tif($post != null) {\n\t\t\n\t\t$attachment_ids = array();  \n\t\t$pattern = &#039;\\[(\\[?)(gallery)(?![\\w-])([^\\]\\\/]*(?:\\\/(?!\\])[^\\]\\\/]*)*?)(?:(\\\/)\\]|\\](?:([^\\[]*+(?:\\[(?!\\\/\\2\\])[^\\[]*+)*+)\\[\\\/\\2\\])?)(\\]?)&#039;;\n\t\t$ids = array();\n\t\t$portfolio_extra_content = get_post_meta($post-&gt;ID, &#039;_nectar_portfolio_extra_content&#039;, true);\n\t\t\n\t\tif (preg_match_all( &#039;\/&#039;. $pattern .&#039;\/s&#039;, $post-&gt;post_content, $matches ) ) { \n\t\t\n\t\t\t$count=count($matches[3]);      \/\/in case there is more than one gallery in the post.\n\t\t\tfor ($i = 0; $i &lt; $count; $i++){\n\t\t\t\t$atts = shortcode_parse_atts( $matches[3][$i] );\n\t\t\t\tif ( isset( $atts[&#039;ids&#039;] ) ){\n\t\t\t\t\t$attachment_ids = explode( &#039;,&#039;, $atts[&#039;ids&#039;] );\n\t\t\t\t\t$ids = array_merge($ids, $attachment_ids);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\tif (preg_match_all( &#039;\/&#039;. $pattern .&#039;\/s&#039;, $portfolio_extra_content, $matches ) ) {   \n\t\t\t$count=count($matches[3]);     \n\t\t\tfor ($i = 0; $i &lt; $count; $i++){\n\t\t\t\t$atts = shortcode_parse_atts( $matches[3][$i] );\n\t\t\t\tif ( isset( $atts[&#039;ids&#039;] ) ){\n\t\t\t\t\t$attachment_ids = explode( &#039;,&#039;, $atts[&#039;ids&#039;] );\n\t\t\t\t\t$ids = array_merge($ids, $attachment_ids);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\treturn $ids;\n  } else {\n  \t$ids = array();\n  \treturn $ids;\n  }\n\n}\n\nadd_action( &#039;wp&#039;, &#039;grab_ids_from_gallery&#039; );\n\n\/*Previous and Next Post in Same Taxonomy*\/\n\/*Author: Bill Erickson*\/\n\nfunction be_get_previous_post($in_same_cat = false, $excluded_categories = &#039;&#039;, $taxonomy = &#039;category&#039;) {\n\treturn be_get_adjacent_post($in_same_cat, $excluded_categories, true, $taxonomy);\n}\n\nfunction be_get_next_post($in_same_cat = false, $excluded_categories = &#039;&#039;, $taxonomy = &#039;category&#039;) {\n\treturn be_get_adjacent_post($in_same_cat, $excluded_categories, false, $taxonomy);\n}\n\nfunction be_get_adjacent_post( $in_same_cat = false, $excluded_categories = &#039;&#039;, $previous = true, $taxonomy = &#039;category&#039; ) {\n\tglobal $post, $wpdb;\n\n\tif ( empty( $post ) )\n\t\treturn null;\n\n\t$current_post_date = $post-&gt;post_date;\n\n\t$join = &#039;&#039;;\n\t$posts_in_ex_cats_sql = &#039;&#039;;\n\tif ( $in_same_cat || ! empty( $excluded_categories ) ) {\n\t\t$join = &quot; INNER JOIN $wpdb-&gt;term_relationships AS tr ON p.ID = tr.object_id INNER JOIN $wpdb-&gt;term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id&quot;;\n\n\t\tif ( $in_same_cat ) {\n\t\t\t$cat_array = wp_get_object_terms($post-&gt;ID, $taxonomy, array(&#039;fields&#039; =&gt; &#039;ids&#039;));\n\t\t\t$join .= &quot; AND tt.taxonomy = &#039;$taxonomy&#039; AND tt.term_id IN (&quot; . implode(&#039;,&#039;, $cat_array) . &quot;)&quot;;\n\t\t}\n\n\t\t$posts_in_ex_cats_sql = &quot;AND tt.taxonomy = &#039;$taxonomy&#039;&quot;;\n\t\tif ( ! empty( $excluded_categories ) ) {\n\t\t\tif ( ! is_array( $excluded_categories ) ) {\n\t\t\t\t\/\/ back-compat, $excluded_categories used to be IDs separated by &quot; and &quot;\n\t\t\t\tif ( strpos( $excluded_categories, &#039; and &#039; ) !== false ) {\n\t\t\t\t\t_deprecated_argument( __FUNCTION__, &#039;3.3&#039;, sprintf( __( &#039;Use commas instead of %s to separate excluded categories.&#039; ), &quot;&#039;and&#039;&quot; ) );\n\t\t\t\t\t$excluded_categories = explode( &#039; and &#039;, $excluded_categories );\n\t\t\t\t} else {\n\t\t\t\t\t$excluded_categories = explode( &#039;,&#039;, $excluded_categories );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$excluded_categories = array_map( &#039;intval&#039;, $excluded_categories );\n\t\t\t\t\n\t\t\tif ( ! empty( $cat_array ) ) {\n\t\t\t\t$excluded_categories = array_diff($excluded_categories, $cat_array);\n\t\t\t\t$posts_in_ex_cats_sql = &#039;&#039;;\n\t\t\t}\n\n\t\t\tif ( !empty($excluded_categories) ) {\n\t\t\t\t$posts_in_ex_cats_sql = &quot; AND tt.taxonomy = &#039;$taxonomy&#039; AND tt.term_id NOT IN (&quot; . implode($excluded_categories, &#039;,&#039;) . &#039;)&#039;;\n\t\t\t}\n\t\t}\n\t}\n\n\t$adjacent = $previous ? &#039;previous&#039; : &#039;next&#039;;\n\t$op = $previous ? &#039;&lt;&#039; : &#039;&gt;&#039;;\n\t$order = $previous ? &#039;DESC&#039; : &#039;ASC&#039;;\n\n\t$join = apply_filters( &quot;get_{$adjacent}_post_join&quot;, $join, $in_same_cat, $excluded_categories );\n\t$where = apply_filters( &quot;get_{$adjacent}_post_where&quot;, $wpdb-&gt;prepare(&quot;WHERE p.post_date $op %s AND p.post_type = %s AND p.post_status = &#039;publish&#039; $posts_in_ex_cats_sql&quot;, $current_post_date, $post-&gt;post_type), $in_same_cat, $excluded_categories );\n\t$sort = apply_filters( &quot;get_{$adjacent}_post_sort&quot;, &quot;ORDER BY p.post_date $order LIMIT 1&quot; );\n\n\t$query = &quot;SELECT p.* FROM $wpdb-&gt;posts AS p $join $where $sort&quot;;\n\t$query_key = &#039;adjacent_post_&#039; . md5($query);\n\t$result = wp_cache_get($query_key, &#039;counts&#039;);\n\tif ( false !== $result )\n\t\treturn $result;\n\n\t$result = $wpdb-&gt;get_row(&quot;SELECT p.* FROM $wpdb-&gt;posts AS p $join $where $sort&quot;);\n\tif ( null === $result )\n\t\t$result = &#039;&#039;;\n\n\twp_cache_set($query_key, $result, &#039;counts&#039;);\n\treturn $result;\n}\n\nfunction be_previous_post_link($format=&#039;&amp;laquo; %link&#039;, $link=&#039;%title&#039;, $in_same_cat = false, $excluded_categories = &#039;&#039;, $taxonomy = &#039;category&#039;) {\n\tbe_adjacent_post_link($format, $link, $in_same_cat, $excluded_categories, true, $taxonomy);\n}\n\nfunction be_next_post_link($format=&#039;%link &amp;raquo;&#039;, $link=&#039;%title&#039;, $in_same_cat = false, $excluded_categories = &#039;&#039;, $taxonomy = &#039;category&#039;) {\n\tbe_adjacent_post_link($format, $link, $in_same_cat, $excluded_categories, false, $taxonomy);\n}\n\nfunction be_adjacent_post_link($format, $link, $in_same_cat = false, $excluded_categories = &#039;&#039;, $previous = true, $taxonomy = &#039;category&#039;) {\n\tif ( $previous &amp;&amp; is_attachment() )\n\t\t$post = &amp; get_post($GLOBALS[&#039;post&#039;]-&gt;post_parent);\n\telse\n\t\t$post = be_get_adjacent_post($in_same_cat, $excluded_categories, $previous, $taxonomy);\n\n\tif ( !$post )\n\t\treturn;\n\n\t$title = $post-&gt;post_title;\n\n\tif ( empty($post-&gt;post_title) )\n\t\t$title = $previous ? __(&#039;Previous Post&#039;) : __(&#039;Next Post&#039;);\n\n\t$title = apply_filters(&#039;the_title&#039;, $title, $post-&gt;ID);\n\t$date = mysql2date(get_option(&#039;date_format&#039;), $post-&gt;post_date);\n\t$rel = $previous ? &#039;prev&#039; : &#039;next&#039;;\n\n\t$string = &#039;&lt;a href=&quot;&#039;.get_permalink($post).&#039;&quot; rel=&quot;&#039;.$rel.&#039;&quot;&gt;&#039;;\n\t$link = str_replace(&#039;%title&#039;, $title, $link);\n\t$link = str_replace(&#039;%date&#039;, $date, $link);\n\t$link = $string . $link . &#039;&lt;\/a&gt;&#039;;\n\n\t$format = str_replace(&#039;%link&#039;, $link, $format);\n\n\t$adjacent = $previous ? &#039;previous&#039; : &#039;next&#039;;\n\techo apply_filters( &quot;{$adjacent}_post_link&quot;, $format, $link );\n}\n\n#-----------------------------------------------------------------#\n# Custom page header\n#-----------------------------------------------------------------# \n\nif ( !function_exists( &#039;nectar_page_header&#039; ) ) {\n    function nectar_page_header($postid) {\n\t\t\n\t\tglobal $options;\n\t\tglobal $post;\n\t\tglobal $nectar_theme_skin;\n\t\tglobal $woocommerce;\n\n\t\t$bg = get_post_meta($postid, &#039;_nectar_header_bg&#039;, true);\n\t\t$bg_color = get_post_meta($postid, &#039;_nectar_header_bg_color&#039;, true);\n\t\t$bg_type = get_post_meta($postid, &#039;_nectar_slider_bg_type&#039;, true);\n\t\t$height = get_post_meta($postid, &#039;_nectar_header_bg_height&#039;, true); \n\t\t$title = get_post_meta($postid, &#039;_nectar_header_title&#039;, true);\n    \t\n\n\t\tif(empty($bg_type)) $bg_type = &#039;image_bg&#039;; \n\n\t\t$early_exit = ($post-&gt;post_type == &#039;page&#039; &amp;&amp; $bg_type == &#039;image_bg&#039; &amp;&amp; empty($bg_color) &amp;&amp; empty($bg) &amp;&amp; empty($height) &amp;&amp; empty($title)) ? true : false;\n\n\t\t$fullscreen_rows = get_post_meta($postid, &#039;_nectar_full_screen_rows&#039;, true);\n\t\tif($fullscreen_rows == &#039;on&#039; || $early_exit)\n\t\t\treturn;\n\n    \t$subtitle = get_post_meta($postid, &#039;_nectar_header_subtitle&#039;, true);\n\t\t$bg_overlay_color = get_post_meta($postid, &#039;_nectar_header_bg_overlay_color&#039;, true);\n\t\t$font_color = get_post_meta($postid, &#039;_nectar_header_font_color&#039;, true);\n\t\t$parallax_bg = get_post_meta($postid, &#039;_nectar_header_parallax&#039;, true);\n    \t\n    \t\/\/woocommerce archives\n    \tif(function_exists(&#039;woocommerce_page_title&#039;)) {\n\t    \tif($woocommerce &amp;&amp; is_product_category() || $woocommerce &amp;&amp; is_product_tag()) {\n\t    \t\t$subtitle = &#039;&#039;;\n\t    \t\t$title = woocommerce_page_title(false);\n\n\t    \t\t$cate = get_queried_object();\n\t    \t\t$t_id = (property_exists($cate, &#039;term_id&#039;)) ? $cate-&gt;term_id : &#039;&#039;;\n\t    \t\t$product_terms =  get_option( &quot;taxonomy_$t_id&quot; );\n\n\t    \t\t$bg = (!empty($product_terms[&#039;product_category_image&#039;])) ? $product_terms[&#039;product_category_image&#039;] : $bg;\n\t    \t}\n\t    }\n\t\t\n\t\t$page_template = get_post_meta($postid, &#039;_wp_page_template&#039;, true); \n\t\t$display_sortable = get_post_meta($postid, &#039;nectar-metabox-portfolio-display-sortable&#039;, true);\n\t\t$inline_filters = (!empty($options[&#039;portfolio_inline_filters&#039;]) &amp;&amp; $options[&#039;portfolio_inline_filters&#039;] == &#039;1&#039;) ? &#039;1&#039; : &#039;0&#039;;\n\t\t$filters_id = (!empty($options[&#039;portfolio_inline_filters&#039;]) &amp;&amp; $options[&#039;portfolio_inline_filters&#039;] == &#039;1&#039;) ? &#039;portfolio-filters-inline&#039; : &#039;portfolio-filters&#039;;\n\t\t$text_align = get_post_meta($postid, &#039;_nectar_page_header_alignment&#039;, true); \n\t\t$text_align_v = get_post_meta($postid, &#039;_nectar_page_header_alignment_v&#039;, true); \n\t\t$fullscreen_header = (!empty($options[&#039;blog_header_type&#039;]) &amp;&amp; $options[&#039;blog_header_type&#039;] == &#039;fullscreen&#039; &amp;&amp; is_singular(&#039;post&#039;)) ? true : false;\n\t\t$post_header_style = (!empty($options[&#039;blog_header_type&#039;])) ? $options[&#039;blog_header_type&#039;] : &#039;default&#039;; \n\t\t$bottom_shadow = get_post_meta($postid, &#039;_nectar_header_bottom_shadow&#039;, true); \n\t\t$bg_overlay = get_post_meta($postid, &#039;_nectar_header_overlay&#039;, true); \n\t\t$text_effect = get_post_meta($postid, &#039;_nectar_page_header_text-effect&#039;, true); \n\t\t$animate_in_effect = (!empty($options[&#039;header-animate-in-effect&#039;])) ? $options[&#039;header-animate-in-effect&#039;] : &#039;none&#039;;\n\t\t(!empty($display_sortable) &amp;&amp; $display_sortable == &#039;on&#039;) ? $display_sortable = &#039;1&#039; : $display_sortable = &#039;0&#039;;\n\t\t\n\t\t\/\/incase no title is entered for portfolio, still show the filters\n\t\tif( $page_template == &#039;template-portfolio.php&#039; &amp;&amp; empty($title)) $title = get_the_title($post-&gt;ID);\n\t\t\n\n\t\tif( (!empty($bg) || !empty($bg_color) || $bg_type == &#039;video_bg&#039; || $bg_type == &#039;particle_bg&#039;) &amp;&amp; !is_post_type_archive( &#039;post&#039; ) ) {  \n    \t\n    \t$social_img_src = (empty($bg)) ? &#039;none&#039; : $bg;\n\t\t$bg = (empty($bg)) ? &#039;none&#039; : $bg;\n\n\t\tif($bg_type == &#039;image_bg&#039; || $bg_type == &#039;particle_bg&#039;) {\n    \t\t(empty($bg_color)) ? $bg_color = &#039;#000&#039; : $bg_color = $bg_color;\n    \t} else {\n    \t\t$bg = &#039;none&#039;; \/\/remove stnd bg image for video BG type\n    \t}\n    \t$bg_color_string = (!empty($bg_color)) ? &#039;background-color: &#039;.$bg_color.&#039;; &#039; : null;\n\n    \tif($bg_type == &#039;particle_bg&#039;) {\n\t    \t$rotate_timing = get_post_meta($postid, &#039;_nectar_particle_rotation_timing&#039;, true); \n\t    \t$disable_explosion = get_post_meta($postid, &#039;_nectar_particle_disable_explosion&#039;, true);\n\t    \t$shapes = get_post_meta($postid, &#039;_nectar_canvas_shapes&#039;, true); \n\t    \tif(empty($shapes)) $bg_type = &#039;image_bg&#039;;\n\t    }\n\t    if($bg_type == &#039;video_bg&#039;) {\n\t\t\t$video_webm = get_post_meta($postid, &#039;_nectar_media_upload_webm&#039;, true); \n\t\t\t$video_mp4 = get_post_meta($postid, &#039;_nectar_media_upload_mp4&#039;, true); \n\t\t\t$video_ogv = get_post_meta($postid, &#039;_nectar_media_upload_ogv&#039;, true); \n\t\t\t$video_image = get_post_meta($postid, &#039;_nectar_slider_preview_image&#039;, true); \n\t\t}\n\t\t$box_roll = get_post_meta($postid, &#039;_nectar_header_box_roll&#039;, true); \n\t\tif(!empty($options[&#039;boxed_layout&#039;]) &amp;&amp; $options[&#039;boxed_layout&#039;] == &#039;1&#039;) $box_roll = &#039;off&#039;;\n\t\t$bg_position = get_post_meta($postid, &#039;_nectar_page_header_bg_alignment&#039;, true); \n\t\tif(empty($bg_position)) $bg_position = &#039;top&#039;; \n\n\t\tif( $post_header_style == &#039;default_minimal&#039; &amp;&amp; ($post-&gt;post_type == &#039;post&#039; &amp;&amp; is_single())) {\n\t\t\t$height = (!empty($height)) ? preg_replace(&#039;\/\\s+\/&#039;, &#039;&#039;, $height) : 550;\n\t\t} else {\n\t\t\t$height = (!empty($height)) ? preg_replace(&#039;\/\\s+\/&#039;, &#039;&#039;, $height) : 350;\n\t\t}\n\n\t\t$not_loaded_class = ($nectar_theme_skin != &#039;ascend&#039;) ? &quot;not-loaded&quot; : null;\t\t\n\t\t$page_fullscreen_header = get_post_meta($postid, &#039;_nectar_header_fullscreen&#039;, true); \n\t\t$fullscreen_class = ($fullscreen_header == true || $page_fullscreen_header == &#039;on&#039;) ? &quot;fullscreen-header&quot; : null;\n\t\t$bottom_shadow_class = ($bottom_shadow == &#039;on&#039;) ? &quot; bottom-shadow&quot;: null;\n\t\t$bg_overlay_class = ($bg_overlay == &#039;on&#039;) ? &quot; bg-overlay&quot;: null;\n\t\t$ajax_page_loading = (!empty($options[&#039;ajax-page-loading&#039;]) &amp;&amp; $options[&#039;ajax-page-loading&#039;] == &#039;1&#039;) ? true : false;\n\n\t\tif($animate_in_effect == &#039;slide-down&#039;) {\n\t\t\t$wrapper_height_style = null;\n\t\t} else {\n\t\t\t$wrapper_height_style = &#039;style=&quot;height: &#039;.$height.&#039;px;&quot;&#039;;\n\t\t}\n\t\tif($fullscreen_header == true &amp;&amp; ($post-&gt;post_type == &#039;post&#039; &amp;&amp; is_single()) || $page_fullscreen_header == &#039;on&#039;) $wrapper_height_style = null; \/\/diable slide down for fullscreen headers\n\t\n\t\t$midnight_non_parallax = (!empty($parallax_bg) &amp;&amp; $parallax_bg == &#039;on&#039;) ? null : &#039;data-midnight=&quot;light&quot;&#039;;\n    \tif($box_roll != &#039;on&#039;) { echo &#039;&lt;div id=&quot;page-header-wrap&quot; data-animate-in-effect=&quot;&#039;. $animate_in_effect .&#039;&quot; data-midnight=&quot;light&quot; class=&quot;&#039;.$fullscreen_class.&#039;&quot; &#039;.$wrapper_height_style.&#039;&gt;&#039;; } \n    \tif(!empty($box_roll) &amp;&amp; $box_roll == &#039;on&#039;) { \n    \t\twp_enqueue_style(&#039;box-roll&#039;); \n    \t\techo &#039;&lt;div class=&quot;nectar-box-roll&quot;&gt;&#039;; \n    \t}\n    \t?&gt;\n\t    &lt;div class=&quot;&lt;?php echo $not_loaded_class . &#039; &#039; . $fullscreen_class . $bottom_shadow_class . $bg_overlay_class; ?&gt;&quot; &lt;?php if($post-&gt;post_type == &#039;post&#039; &amp;&amp; is_single()) echo &#039;data-post-hs=&quot;&#039;.$post_header_style.&#039;&quot;&#039;; ?&gt; data-animate-in-effect=&quot;&lt;?php echo $animate_in_effect; ?&gt;&quot; id=&quot;page-header-bg&quot; &lt;?php echo $midnight_non_parallax; ?&gt; data-text-effect=&quot;&lt;?php echo $text_effect; ?&gt;&quot; data-bg-pos=&quot;&lt;?php echo $bg_position; ?&gt;&quot; data-alignment=&quot;&lt;?php echo (!empty($text_align)) ? $text_align : &#039;left&#039; ; ?&gt;&quot; data-alignment-v=&quot;&lt;?php echo (!empty($text_align_v)) ? $text_align_v : &#039;middle&#039; ; ?&gt;&quot; data-parallax=&quot;&lt;?php echo (!empty($parallax_bg) &amp;&amp; $parallax_bg == &#039;on&#039;) ? &#039;1&#039; : &#039;0&#039;; ?&gt;&quot; data-height=&quot;&lt;?php echo (!empty($height)) ? $height : &#039;350&#039;; ?&gt;&quot; style=&quot;&lt;?php echo $bg_color_string; ?&gt; height: &lt;?php echo (!empty($height)) ? $height : &#039;350&#039;; ?&gt;px;&quot;&gt;\n\t\t\t\n\t\t\t&lt;?php \n\n\t\t\tif(!empty($bg) &amp;&amp; $bg != &#039;none&#039;) { ?&gt;&lt;div class=&quot;page-header-bg-image&quot; style=&quot;background-image: url(&lt;?php echo $bg; ?&gt;);&quot;&gt;&lt;\/div&gt; &lt;?php  } \n\n\t\t\tif(!empty($bg_overlay_color)) { ?&gt;&lt;div class=&quot;page-header-overlay-color&quot; style=&quot;background-color: &lt;?php echo $bg_overlay_color; ?&gt;;&quot;&gt;&lt;\/div&gt; &lt;?php }  ?&gt;\n\n\t\t\t&lt;?php if($bg_type != &#039;particle_bg&#039;) { echo &#039;&lt;div class=&quot;container&quot;&gt;&#039;; }\n\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif($post-&gt;ID != 0 &amp;&amp; $post-&gt;post_type &amp;&amp; $post-&gt;post_type == &#039;portfolio&#039;) { ?&gt;\n\t\t\t\t\t\n\t\t\t\t\t&lt;div class=&quot;row project-title&quot;&gt;\n\t\t\t\t\t&lt;div class=&quot;container&quot;&gt;\n\t\t\t\t\t&lt;div class=&quot;col span_6 section-title &lt;?php if(empty($options[&#039;portfolio_social&#039;]) || $options[&#039;portfolio_social&#039;] == 0 || empty($options[&#039;portfolio_date&#039;]) || $options[&#039;portfolio_date&#039;] == 0 ) echo &#039;no-date&#039;?&gt;&quot;&gt;\n\t\t\t\t\t\t&lt;div class=&quot;inner-wrap&quot;&gt;\n\t\t\t\t\t\t&lt;h1&gt;&lt;?php the_title(); ?&gt;&lt;\/h1&gt;\n\t\t\t\t\t\t&lt;?php if(!empty($subtitle)) { ?&gt; &lt;span class=&quot;subheader&quot;&gt;&lt;?php echo $subtitle; ?&gt;&lt;\/span&gt; &lt;?php } ?&gt;\n\t\t\t\t\t\t\n\t\t\t\t\t\t&lt;?php \n\n\t\t\t\t\t\tglobal $options;\n\t\t\t\t\t\t$single_nav_pos = (!empty($options[&#039;portfolio_single_nav&#039;])) ? $options[&#039;portfolio_single_nav&#039;] : &#039;in_header&#039;;\n\n\t\t\t\t\t\tif($single_nav_pos == &#039;in_header&#039;) project_single_controls(); ?&gt;\n\t\t\t\t\t\t&lt;\/div&gt;\n\t\t\t\t\t&lt;\/div&gt;\n\t\t\t\t&lt;\/div&gt; \n\t\t\t\n\t\t\t&lt;\/div&gt;&lt;!--\/row--&gt;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t&lt;?php } elseif($post-&gt;ID != 0 &amp;&amp; $post-&gt;post_type == &#039;post&#039; &amp;&amp; is_single() ) { \n\t\t\t\t\t\t\n\t\t\t\t\t\t\/\/ also set as an img for social sharing\/\n\t\t\t\t\t\tif($social_img_src != &#039;none&#039;) echo &#039;&lt;img class=&quot;hidden-social-img&quot; src=&quot;&#039;.$social_img_src.&#039;&quot; alt=&quot;&#039;.get_the_title().&#039;&quot; \/&gt;&#039;;\n\n\t\t\t\t\t\t?&gt;\n\t\t\t\t\t\t\n\t\t\t\t\t\t&lt;div class=&quot;row&quot;&gt;\n\n\t\t\t\t\t\t\t&lt;div class=&quot;col span_6 section-title blog-title&quot;&gt;\n\t\t\t\t\t\t\t\t&lt;div class=&quot;inner-wrap&quot;&gt;\n\n\t\t\t\t\t\t\t\t\t&lt;?php if(($post-&gt;post_type == &#039;post&#039; &amp;&amp; is_single()) &amp;&amp; $post_header_style == &#039;default_minimal&#039;) {\n\n\t\t\t\t\t\t\t\t\t\t    $categories = get_the_category();\n\t\t\t\t\t\t\t\t\t\t\tif ( ! empty( $categories ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t$output = null;\n\t\t\t\t\t\t\t\t\t\t\t    foreach( $categories as $category ) {\n\t\t\t\t\t\t\t\t\t\t\t        $output .= &#039;&lt;a class=&quot;&#039;.$category-&gt;slug.&#039;&quot; href=&quot;&#039; . esc_url( get_category_link( $category-&gt;term_id ) ) . &#039;&quot; alt=&quot;&#039; . esc_attr( sprintf( __( &#039;View all posts in %s&#039;, NECTAR_THEME_NAME), $category-&gt;name ) ) . &#039;&quot;&gt;&#039; . esc_html( $category-&gt;name ) . &#039;&lt;\/a&gt;&#039;;\n\t\t\t\t\t\t\t\t\t\t\t    }\n\t\t\t\t\t\t\t\t\t\t\t    echo trim( $output);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} ?&gt;\n\n\t\t\t\t\t\t\t\t\t&lt;h1 class=&quot;entry-title&quot;&gt;&lt;?php the_title(); ?&gt;&lt;\/h1&gt;\n\n\t\t\t\t\t\t\t\t\t &lt;?php if(($post-&gt;post_type == &#039;post&#039; &amp;&amp; is_single()) &amp;&amp; $fullscreen_header == true ) { ?&gt;\n\t\t\t\t\t\t\t\t\t \t&lt;div class=&quot;author-section&quot;&gt;\n\t\t\t\t\t\t\t\t\t\t \t&lt;span class=&quot;meta-author&quot;&gt;  \n\t\t\t\t\t\t\t\t\t\t \t\t&lt;?php if (function_exists(&#039;get_avatar&#039;)) { echo get_avatar( get_the_author_meta(&#039;email&#039;), 100 ); }?&gt;\n\t\t\t\t\t\t\t\t\t\t \t&lt;\/span&gt; \n\t\t\t\t\t\t\t\t\t\t \t&lt;div class=&quot;avatar-post-info vcard author&quot;&gt;\n\t\t\t\t\t\t\t\t\t\t\t \t&lt;span class=&quot;fn&quot;&gt;&lt;?php the_author_posts_link(); ?&gt;&lt;\/span&gt;\n\t\t\t\t\t\t\t\t\t\t\t \t&lt;span class=&quot;meta-date date updated&quot;&gt;&lt;i&gt;&lt;?php echo get_the_date(); ?&gt;&lt;\/i&gt;&lt;\/span&gt;\n\t\t\t\t\t\t\t\t\t\t\t &lt;\/div&gt;\n\t\t\t\t\t\t\t\t\t\t&lt;\/div&gt;\n\t\t\t\t\t\t\t\t&lt;?php } ?&gt;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t&lt;?php if($fullscreen_header != true) { ?&gt;\t\n\t\t\t\t\t\t\t\t\t&lt;div id=&quot;single-below-header&quot;&gt;\n\t\t\t\t\t\t\t\t\t\t&lt;span class=&quot;meta-author vcard author&quot;&gt;&lt;span class=&quot;fn&quot;&gt;&lt;?php echo __(&#039;By&#039;, NECTAR_THEME_NAME); ?&gt; &lt;?php the_author_posts_link(); ?&gt;&lt;\/span&gt;&lt;\/span&gt;&lt;!--\n\t\t\t\t\t\t\t\t\t\t--&gt;&lt;span class=&quot;meta-date date updated&quot;&gt;&lt;?php echo get_the_date(); ?&gt;&lt;\/span&gt;&lt;!--\n\t\t\t\t\t\t\t\t\t\t--&gt;&lt;?php if($post_header_style != &#039;default_minimal&#039;) { ?&gt; &lt;span class=&quot;meta-category&quot;&gt;&lt;?php the_category(&#039;, &#039;); ?&gt;&lt;\/span&gt; &lt;?php } else { ?&gt;&lt;!--\n\t\t\t\t\t\t\t\t\t\t--&gt;&lt;span class=&quot;meta-comment-count&quot;&gt;&lt;a href=&quot;&lt;?php comments_link(); ?&gt;&quot;&gt; &lt;?php comments_number( __(&#039;No Comments&#039;, NECTAR_THEME_NAME), __(&#039;One Comment &#039;, NECTAR_THEME_NAME), __(&#039;% Comments&#039;, NECTAR_THEME_NAME) ); ?&gt;&lt;\/a&gt;&lt;\/span&gt;\n\t\t\t\t\t\t\t\t\t&lt;?php } ?&gt;\n\t\t\t\t\t\t\t\t\t&lt;\/div&gt;&lt;!--\/single-below-header--&gt;\n\t\t\t\t\t\t\t\t&lt;?php } ?&gt;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t&lt;?php if($fullscreen_header != true &amp;&amp; $post_header_style != &#039;default_minimal&#039;) { ?&gt;\n\n\t\t\t\t\t\t\t\t&lt;div id=&quot;single-meta&quot; data-sharing=&quot;&lt;?php echo ( !empty($options[&#039;blog_social&#039;]) &amp;&amp; $options[&#039;blog_social&#039;] == 1 ) ? &#039;1&#039; : &#039;0&#039;; ?&gt;&quot;&gt;\n\t\t\t\t\t\t\t\t\t&lt;ul&gt;\n\t\t\n\t  \t\n\t\t\t\t\t\t\t\t\t   \n\t\t\t\t\t\t\t\t\t\t&lt;li class=&quot;meta-comment-count&quot;&gt;\n\t\t\t\t\t\t\t\t\t\t\t&lt;a href=&quot;&lt;?php comments_link(); ?&gt;&quot;&gt;&lt;i class=&quot;icon-default-style steadysets-icon-chat&quot;&gt;&lt;\/i&gt; &lt;?php comments_number( __(&#039;No Comments&#039;, NECTAR_THEME_NAME), __(&#039;One Comment &#039;, NECTAR_THEME_NAME), __(&#039;% Comments&#039;, NECTAR_THEME_NAME) ); ?&gt;&lt;\/a&gt;\n\t\t\t\t\t\t\t\t\t\t&lt;\/li&gt;\n\t\t\t\t\t\t\t\t\t\t\t&lt;li&gt;\n\t\t\t\t\t\t\t\t\t   \t\t&lt;?php echo &#039;&lt;span class=&quot;n-shortcode&quot;&gt;&#039;.nectar_love(&#039;return&#039;).&#039;&lt;\/span&gt;&#039;; ?&gt;\n\t\t\t\t\t\t\t\t\t   \t&lt;\/li&gt;\n\t\t\t\t\t\t\t\t\t\t&lt;?php if( !empty($options[&#039;blog_social&#039;]) &amp;&amp; $options[&#039;blog_social&#039;] == 1 ) { \n\t\t\t\t\t\t\t\t\t\t   \n\t\t\t\t\t\t\t\t\t\t   echo &#039;&lt;li class=&quot;meta-share-count&quot;&gt;&lt;a href=&quot;#&quot;&gt;&lt;i class=&quot;icon-default-style steadysets-icon-share&quot;&gt;&lt;\/i&gt;&lt;span class=&quot;share-count-total&quot;&gt;0&lt;\/span&gt;&lt;\/a&gt; &lt;div class=&quot;nectar-social&quot;&gt;&#039;;\n\t\t\t\t\t\t\t\t\t\t   \n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\/\/facebook\n\t\t\t\t\t\t\t\t\t\t\tif(!empty($options[&#039;blog-facebook-sharing&#039;]) &amp;&amp; $options[&#039;blog-facebook-sharing&#039;] == 1) { \n\t\t\t\t\t\t\t\t\t\t\t\techo &quot;&lt;a class=&#039;facebook-share nectar-sharing&#039; href=&#039;#&#039; title=&#039;&quot;.__(&#039;Share this&#039;, NECTAR_THEME_NAME).&quot;&#039;&gt; &lt;i class=&#039;fa fa-facebook&#039;&gt;&lt;\/i&gt; &lt;span class=&#039;count&#039;&gt;&lt;\/span&gt;&lt;\/a&gt;&quot;;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\/\/twitter\n\t\t\t\t\t\t\t\t\t\t\tif(!empty($options[&#039;blog-twitter-sharing&#039;]) &amp;&amp; $options[&#039;blog-twitter-sharing&#039;] == 1) {\n\t\t\t\t\t\t\t\t\t\t\t\techo &quot;&lt;a class=&#039;twitter-share nectar-sharing&#039; href=&#039;#&#039; title=&#039;&quot;.__(&#039;Tweet this&#039;, NECTAR_THEME_NAME).&quot;&#039;&gt; &lt;i class=&#039;fa fa-twitter&#039;&gt;&lt;\/i&gt; &lt;span class=&#039;count&#039;&gt;&lt;\/span&gt;&lt;\/a&gt;&quot;;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\/\/google plus\n\t\t\t\t\t\t\t\t\t\t\tif(!empty($options[&#039;blog-google-plus-sharing&#039;]) &amp;&amp; $options[&#039;blog-google-plus-sharing&#039;] == 1) {\n\t\t\t\t\t\t\t\t\t\t\t\techo &quot;&lt;a class=&#039;google-plus-share nectar-sharing-alt&#039; href=&#039;#&#039; title=&#039;&quot;.__(&#039;Share this&#039;, NECTAR_THEME_NAME).&quot;&#039;&gt; &lt;i class=&#039;fa fa-google-plus&#039;&gt;&lt;\/i&gt; &lt;span class=&#039;count&#039;&gt;0&lt;\/span&gt;&lt;\/a&gt;&quot;;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\/\/linkedIn\n\t\t\t\t\t\t\t\t\t\t\tif(!empty($options[&#039;blog-linkedin-sharing&#039;]) &amp;&amp; $options[&#039;blog-linkedin-sharing&#039;] == 1) {\n\t\t\t\t\t\t\t\t\t\t\t\techo &quot;&lt;a class=&#039;linkedin-share nectar-sharing&#039; href=&#039;#&#039; title=&#039;&quot;.__(&#039;Share this&#039;, NECTAR_THEME_NAME).&quot;&#039;&gt; &lt;i class=&#039;fa fa-linkedin&#039;&gt;&lt;\/i&gt; &lt;span class=&#039;count&#039;&gt; &lt;\/span&gt;&lt;\/a&gt;&quot;;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\/\/pinterest\n\t\t\t\t\t\t\t\t\t\t\tif(!empty($options[&#039;blog-pinterest-sharing&#039;]) &amp;&amp; $options[&#039;blog-pinterest-sharing&#039;] == 1) {\n\t\t\t\t\t\t\t\t\t\t\t\techo &quot;&lt;a class=&#039;pinterest-share nectar-sharing&#039; href=&#039;#&#039; title=&#039;&quot;.__(&#039;Pin this&#039;, NECTAR_THEME_NAME).&quot;&#039;&gt; &lt;i class=&#039;fa fa-pinterest&#039;&gt;&lt;\/i&gt; &lt;span class=&#039;count&#039;&gt;&lt;\/span&gt;&lt;\/a&gt;&quot;;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t  echo &#039;&lt;\/div&gt;&lt;\/li&gt;&#039;;\n\t\t\n\t\t\t\t\t\t\t\t \t\t}\n\t\t\t\t\t\t\t\t\t?&gt;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t&lt;\/ul&gt;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t&lt;\/div&gt;&lt;!--\/single-meta--&gt;\n\n\t\t\t\t\t\t\t&lt;?php } \/\/end if theme skin default ?&gt;\n\t\t\t\t\t\t    &lt;\/div&gt;\n\t\t\t\t\t\t&lt;\/div&gt;&lt;!--\/section-title--&gt;\n\t\t\t\t\t&lt;\/div&gt;&lt;!--\/row--&gt;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t&lt;?php \/\/default\t\n\t\t\t\t\t} else if($bg_type != &#039;particle_bg&#039;) {\n\n\t\t\t\t\t\tif(!empty($box_roll) &amp;&amp; $box_roll == &#039;on&#039;) { \n\t\t\t\t\t\t\t$alignment = (!empty($text_align)) ? $text_align : &#039;left&#039;;\n\t\t\t\t\t\t\t$v_alignment = (!empty($text_align_v)) ? $text_align_v : &#039;middle&#039;;\n\t\t\t\t\t\t\techo &#039;&lt;div class=&quot;overlaid-content&quot; data-text-effect=&quot;&#039;.$text_effect.&#039;&quot; data-alignment=&quot;&#039;.$alignment.&#039;&quot; data-alignment-v=&quot;&#039;.$v_alignment.&#039;&quot;&gt;&lt;div class=&quot;container&quot;&gt;&#039;;\n\t\t\t\t\t\t}  ?&gt;\n\n\t\t\t\t\t\t &lt;div class=&quot;row&quot;&gt;\n\t\t\t\t\t\t\t&lt;div class=&quot;col span_6&quot;&gt;\n\t\t\t\t\t\t\t\t&lt;div class=&quot;inner-wrap&quot;&gt;\n\t\t\t\t\t\t\t\t\t&lt;h1&gt;&lt;?php echo $title; ?&gt;&lt;\/h1&gt;\n\t\t\t\t\t\t\t\t\t&lt;span class=&quot;subheader&quot;&gt;&lt;?php echo $subtitle; ?&gt;&lt;\/span&gt;\n\t\t\t\t\t\t\t\t&lt;\/div&gt;\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t&lt;?php \/\/ portfolio filters\n\t\t\t\t\t\t\t\t\tif( $page_template == &#039;template-portfolio.php&#039; &amp;&amp; $display_sortable == &#039;1&#039; &amp;&amp; $inline_filters == &#039;0&#039;) { ?&gt;\n\t\t\t\t\t\t\t\t\t&lt;div class=&quot;&lt;?php echo $filters_id;?&gt;&quot; instance=&quot;0&quot;&gt;\n\t\t\t\t\t\t\t\t\t\t\t&lt;a href=&quot;#&quot; data-sortable-label=&quot;&lt;?php echo (!empty($options[&#039;portfolio-sortable-text&#039;])) ? $options[&#039;portfolio-sortable-text&#039;] :&#039;Sort Portfolio&#039;; ?&gt;&quot; id=&quot;sort-portfolio&quot;&gt;&lt;span&gt;&lt;?php echo (!empty($options[&#039;portfolio-sortable-text&#039;])) ? $options[&#039;portfolio-sortable-text&#039;] : __(&#039;Sort Portfolio&#039;,NECTAR_THEME_NAME); ?&gt;&lt;\/span&gt; &lt;i class=&quot;icon-angle-down&quot;&gt;&lt;\/i&gt;&lt;\/a&gt; \n\t\t\t\t\t\t\t\t\t\t&lt;ul&gt;\n\t\t\t\t\t\t\t\t\t\t   &lt;li&gt;&lt;a href=&quot;#&quot; data-filter=&quot;*&quot;&gt;&lt;?php echo __(&#039;All&#039;, NECTAR_THEME_NAME); ?&gt;&lt;\/a&gt;&lt;\/li&gt;\n\t\t\t\t\t\t               \t   &lt;?php wp_list_categories(array(&#039;title_li&#039; =&gt; &#039;&#039;, &#039;taxonomy&#039; =&gt; &#039;project-type&#039;, &#039;show_option_none&#039;   =&gt; &#039;&#039;, &#039;walker&#039; =&gt; new Walker_Portfolio_Filter())); ?&gt;\n\t\t\t\t\t\t\t\t\t\t&lt;\/ul&gt;\n\t\t\t\t\t\t\t\t\t&lt;\/div&gt;\n\t\t\t\t\t\t\t\t&lt;?php } ?&gt;\n\t\t\t\t\t\t\t\t&lt;\/div&gt;\n\t\t\t\t\t\t  &lt;\/div&gt;\n\t\t\t\t\t  \n\t\t\t\t\t  &lt;?php if(!empty($box_roll) &amp;&amp; $box_roll == &#039;on&#039;) echo &#039;&lt;\/div&gt;&lt;\/div&gt;&lt;!--\/overlaid-content--&gt;&#039;;\n\n\t\t\t\t } ?&gt;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t&lt;?php if($bg_type != &#039;particle_bg&#039;) { echo &#039;&lt;\/div&gt;&#039;; } \/\/closing container \n\n\t\t\t if(($post-&gt;ID != 0 &amp;&amp; $post-&gt;post_type == &#039;post&#039; &amp;&amp; is_single()) &amp;&amp; $fullscreen_header == true || $page_fullscreen_header == &#039;on&#039;) { \n\t\t\t \t $rotate_in_class = ( $text_effect == &#039;rotate_in&#039;) ? &#039;hidden&#039; : null;\n\t\t\t \t $button_styling = (!empty($options[&#039;button-styling&#039;])) ? $options[&#039;button-styling&#039;] : &#039;default&#039;; \n\n\t\t\t \t $header_down_arrow_style = (!empty($options[&#039;header-down-arrow-style&#039;])) ? $options[&#039;header-down-arrow-style&#039;] : &#039;default&#039;; \n\t\t\t \t \n\t\t\t \t if($header_down_arrow_style == &#039;scroll-animation&#039; || $button_styling == &#039;slightly_rounded&#039; || $button_styling == &#039;slightly_rounded_shadow&#039;) {\n\t\t\t \t \techo &#039;&lt;div class=&quot;scroll-down-wrap no-border&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;section-down-arrow &#039;.$rotate_in_class.&#039;&quot;&gt;&lt;svg class=&quot;nectar-scroll-icon&quot; viewBox=&quot;0 0 30 45&quot; enable-background=&quot;new 0 0 30 45&quot;&gt;\n                \t\t\t&lt;path class=&quot;nectar-scroll-icon-path&quot; fill=&quot;none&quot; stroke=&quot;#ffffff&quot; stroke-width=&quot;2&quot; stroke-miterlimit=&quot;10&quot; d=&quot;M15,1.118c12.352,0,13.967,12.88,13.967,12.88v18.76  c0,0-1.514,11.204-13.967,11.204S0.931,32.966,0.931,32.966V14.05C0.931,14.05,2.648,1.118,15,1.118z&quot;&gt;&lt;\/path&gt;\n            \t\t\t  &lt;\/svg&gt;&lt;\/a&gt;&lt;\/div&gt;&#039;;\n\t\t\t \t } else {\n\t\t\t\t \t if($button_styling == &#039;default&#039;){\n\t\t\t\t \t \techo &#039;&lt;div class=&quot;scroll-down-wrap&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;section-down-arrow &#039;.$rotate_in_class.&#039;&quot;&gt;&lt;i class=&quot;icon-salient-down-arrow icon-default-style&quot;&gt; &lt;\/i&gt;&lt;\/a&gt;&lt;\/div&gt;&#039;;\n\t\t\t\t \t } else {\n\t\t\t\t \t \techo &#039;&lt;div class=&quot;scroll-down-wrap &#039;.$rotate_in_class.&#039;&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;section-down-arrow&quot;&gt;&lt;i class=&quot;fa fa-angle-down top&quot;&gt;&lt;\/i&gt;&lt;i class=&quot;fa fa-angle-down&quot;&gt;&lt;\/i&gt;&lt;\/a&gt;&lt;\/div&gt;&#039;;\n\t\t\t\t \t }\n\t\t\t\t }\n\n\t\t\t  } \n\n\t\t\n\t\t\/\/video bg\n\t\tif($bg_type == &#039;video_bg&#039;) {\n\t\t\t\n\t\t\tif ( floatval(get_bloginfo(&#039;version&#039;)) &gt;= &quot;3.6&quot; ) {\n\t\t\t\twp_enqueue_script(&#039;wp-mediaelement&#039;);\n\t\t\t\twp_enqueue_style(&#039;wp-mediaelement&#039;);\n\t\t\t} else {\n\t\t\t\t\/\/register media element for WordPress 3.5\n\t\t\t\twp_register_script(&#039;wp-mediaelement&#039;, get_template_directory_uri() . &#039;\/js\/mediaelement-and-player.min.js&#039;, array(&#039;jquery&#039;), &#039;1.0&#039;, TRUE);\n\t\t\t\twp_register_style(&#039;wp-mediaelement&#039;, get_template_directory_uri() . &#039;\/css\/mediaelementplayer.min.css&#039;);\n\t\t\t\t\n\t\t\t\twp_enqueue_script(&#039;wp-mediaelement&#039;);\n\t\t\t\twp_enqueue_style(&#039;wp-mediaelement&#039;);\n\t\t\t}\n\t\t\t\n\t\t\t\/\/parse video image\n\t\t\tif(strpos($video_image, &quot;http:\/\/&quot;) !== false || strpos($video_image, &quot;https:\/\/&quot;) !== false){\n\t\t\t\t$video_image_src = $video_image;\n\t\t\t} else {\n\t\t\t\t$video_image_src = wp_get_attachment_image_src($video_image, &#039;full&#039;);\n\t\t\t\t$video_image_src = $video_image_src[0];\n\t\t\t}\n\t\t\t\n\t\t\t\/\/$poster_markup = (!empty($video_image)) ? &#039;poster=&quot;&#039;.$video_image_src.&#039;&quot;&#039; : null ;\n\t\t\t$poster_markup = null;\n\t\t\t$video_markup = null;\n\t\t\t\n\t\t\t$video_markup .=  &#039;&lt;div class=&quot;video-color-overlay&quot; data-color=&quot;&#039;.$bg_color.&#039;&quot;&gt;&lt;\/div&gt;&#039;;\n\t\t\t\n\t\t\t\t \n\t\t\t$video_markup .= &#039;\n\t\t\t\n\t\t\t&lt;div class=&quot;mobile-video-image&quot; style=&quot;background-image: url(&#039;.$video_image_src.&#039;)&quot;&gt;&lt;\/div&gt;\n\t\t\t&lt;div class=&quot;nectar-video-wrap&quot; data-bg-alignment=&quot;&#039;.$bg_position.&#039;&quot;&gt;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t&lt;video class=&quot;nectar-video-bg&quot; width=&quot;1800&quot; height=&quot;700&quot; &#039;.$poster_markup.&#039;  preload=&quot;auto&quot; loop autoplay&gt;&#039;;\n\t\t\t\t    if(!empty($video_webm)) { $video_markup .= &#039;&lt;source type=&quot;video\/webm&quot; src=&quot;&#039;.$video_webm.&#039;&quot;&gt;&#039;; }\n\t\t\t\t    if(!empty($video_mp4)) { $video_markup .= &#039;&lt;source type=&quot;video\/mp4&quot; src=&quot;&#039;.$video_mp4.&#039;&quot;&gt;&#039;; }\n\t\t\t\t    if(!empty($video_ogv)) { $video_markup .= &#039;&lt;source type=&quot;video\/ogg&quot; src=&quot;&#039;. $video_ogv.&#039;&quot;&gt;&#039;; }\n\t\t\t\t  \n\t\t\t   $video_markup .=&#039;&lt;\/video&gt;\n\t\t\n\t\t\t&lt;\/div&gt;&#039;;\n\t\t\t\n\t\t\techo $video_markup;\n\t\t}\n\n\t\t\/\/particle bg\n\t\tif($bg_type == &#039;particle_bg&#039;) {\n\n\t\t\twp_enqueue_script(&#039;nectarParticles&#039;);\n\n\t\t\techo &#039;&lt;div class=&quot; nectar-particles&quot; data-disable-explosion=&quot;&#039;.$disable_explosion.&#039;&quot; data-rotation-timing=&quot;&#039;.$rotate_timing.&#039;&quot;&gt;&lt;div class=&quot;canvas-bg&quot;&gt;&lt;canvas id=&quot;canvas&quot; data-active-index=&quot;0&quot;&gt;&lt;\/canvas&gt;&lt;\/div&gt;&#039;;\n\n\t\t\t$images = explode( &#039;,&#039;, $shapes);\n\t\t\t$i = 0;\n\n\t\t\tif(!empty($shapes)) {\n\n\t\t\t\tif(!empty($box_roll) &amp;&amp; $box_roll == &#039;on&#039;) { \n\t\t\t\t\t$alignment = (!empty($text_align)) ? $text_align : &#039;left&#039;;\n\t\t\t\t\t$v_alignment = (!empty($text_align_v)) ? $text_align_v : &#039;middle&#039;;\n\t\t\t\t\techo &#039;&lt;div class=&quot;overlaid-content&quot; data-text-effect=&quot;&#039;.$text_effect.&#039;&quot; data-alignment=&quot;&#039;.$alignment.&#039;&quot; data-alignment-v=&quot;&#039;.$v_alignment.&#039;&quot;&gt;&#039;;\n\t\t\t\t}\n\n\t\t\t\techo &#039;&lt;div class=&quot;container&quot;&gt;&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;col span_6&quot; &gt;&#039;;\n\n\t\t\t\tforeach ( $images as $attach_id ) {\n\t\t\t\t\t$i++;\n\n\t    \t\t\t$img = wp_get_attachment_image_src(  $attach_id, &#039;full&#039; );\n\n\t    \t\t\t$attachment = get_post( $attach_id );\n\t\t\t\t\t$shape_meta = array(\n\t\t\t\t\t\t&#039;caption&#039; =&gt; $attachment-&gt;post_excerpt,\n\t\t\t\t\t\t&#039;title&#039; =&gt; $attachment-&gt;post_title,\n\t\t\t\t\t\t&#039;bg_color&#039; =&gt; get_post_meta( $attachment-&gt;ID, &#039;nectar_particle_shape_bg_color&#039;, true ),\n\t\t\t\t\t\t&#039;color&#039; =&gt; get_post_meta( $attachment-&gt;ID, &#039;nectar_particle_shape_color&#039;, true ),\n\t\t\t\t\t\t&#039;color_mapping&#039; =&gt; get_post_meta( $attachment-&gt;ID, &#039;nectar_particle_shape_color_mapping&#039;, true ),\n\t\t\t\t\t\t&#039;alpha&#039; =&gt; get_post_meta( $attachment-&gt;ID, &#039;nectar_particle_shape_color_alpha&#039;, true ),\n\t\t\t\t\t\t&#039;density&#039; =&gt; get_post_meta( $attachment-&gt;ID, &#039;nectar_particle_shape_density&#039;, true ),\n\t\t\t\t\t\t&#039;max_particle_size&#039; =&gt; get_post_meta( $attachment-&gt;ID, &#039;nectar_particle_max_particle_size&#039;, true )\n\t\t\t\t\t);\n\t\t\t\t\tif(!empty($shape_meta[&#039;density&#039;])) {\n\t\t\t\t\t\tswitch($shape_meta[&#039;density&#039;]) {\n\t\t\t\t\t\t\tcase &#039;very_low&#039;:\n\t\t\t\t\t\t\t\t$shape_meta[&#039;density&#039;] = &#039;19&#039;;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase &#039;low&#039;:\n\t\t\t\t\t\t\t\t$shape_meta[&#039;density&#039;] = &#039;16&#039;;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase &#039;medium&#039;:\n\t\t\t\t\t\t\t\t$shape_meta[&#039;density&#039;] = &#039;13&#039;;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase &#039;high&#039;:\n\t\t\t\t\t\t\t\t$shape_meta[&#039;density&#039;] = &#039;10&#039;;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase &#039;very_high&#039;:\n\t\t\t\t\t\t\t\t$shape_meta[&#039;density&#039;] = &#039;8&#039;;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif(!empty($shape_meta[&#039;color&#039;]) &amp;&amp; $shape_meta[&#039;color&#039;] == &#039;#fff&#039; || !empty($shape_meta[&#039;color&#039;]) &amp;&amp; $shape_meta[&#039;color&#039;] == &#039;#ffffff&#039;) $shape_meta[&#039;color&#039;] = &#039;#fefefe&#039;;\n\n\t    \t\t\t\/\/data for particle shape\n\t    \t\t\techo &#039;&lt;div class=&quot;shape&quot; data-src=&quot;&#039;.$img[0].&#039;&quot; data-max-size=&quot;&#039;.$shape_meta[&#039;max_particle_size&#039;].&#039;&quot; data-alpha=&quot;&#039;.$shape_meta[&#039;alpha&#039;].&#039;&quot; data-density=&quot;&#039;.$shape_meta[&#039;density&#039;].&#039;&quot; data-color-mapping=&quot;&#039;.$shape_meta[&#039;color_mapping&#039;].&#039;&quot; data-color=&quot;&#039;.$shape_meta[&#039;color&#039;].&#039;&quot; data-bg-color=&quot;&#039;.$shape_meta[&#039;bg_color&#039;].&#039;&quot;&gt;&lt;\/div&gt;&#039;;\n\n\t    \t\t\t\/\/overlaid content\n\t    \t\t\techo &#039;&lt;div class=&quot;inner-wrap shape-&#039;.$i.&#039;&quot;&gt;&#039;;\n\t    \t\t\techo &#039;&lt;h1&gt;&#039;.$shape_meta[&quot;title&quot;].&#039;&lt;\/h1&gt; &lt;span class=&quot;subheader&quot;&gt;&#039;.$shape_meta[&quot;caption&quot;].&#039;&lt;\/span&gt;&#039;;\n\t    \t\t\techo &#039;&lt;\/div&gt;&#039;;\n\n\t    \t\t} ?&gt;\n\n\t    \t\t&lt;\/div&gt;&lt;\/div&gt;&lt;\/div&gt;\n\n\t    \t\t&lt;div class=&quot;pagination-navigation&quot;&gt;\n\t\t\t\t\t&lt;div class=&quot;pagination-current&quot;&gt;&lt;\/div&gt;\n\t\t\t\t\t&lt;div class=&quot;pagination-dots&quot;&gt;\n\t\t\t\t\t\t&lt;?php foreach ( $images as $attach_id ) {\n\t\t\t\t\t\t\techo &#039;&lt;button class=&quot;pagination-dot&quot;&gt;&lt;\/button&gt;&#039;;\n\t\t\t\t\t\t} ?&gt;\n\t\t\t\t\t&lt;\/div&gt;\n\t\t\t\t&lt;\/div&gt;\n\t\t\t\t&lt;svg xmlns=&quot;http:\/\/www.w3.org\/2000\/svg&quot; version=&quot;1.1&quot; width=&quot;690&quot;&gt;\n\t\t\t\t  &lt;defs&gt;\n\t\t\t\t    &lt;filter id=&quot;goo&quot;&gt;\n\t\t\t\t      &lt;feGaussianBlur in=&quot;SourceGraphic&quot; stdDeviation=&quot;10&quot; result=&quot;blur&quot;&gt;&lt;\/feGaussianBlur&gt;\n\t\t\t\t      &lt;feColorMatrix in=&quot;blur&quot; mode=&quot;matrix&quot; values=&quot;1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 69 -16&quot; result=&quot;goo&quot;&gt;&lt;\/feColorMatrix&gt;\n\t\t\t\t      &lt;feComposite in=&quot;SourceGraphic&quot; in2=&quot;goo&quot; operator=&quot;atop&quot;&gt;&lt;\/feComposite&gt;\n\t\t\t\t    &lt;\/filter&gt;\n\t\t\t\t  &lt;\/defs&gt;\n\t\t\t\t&lt;\/svg&gt;\n\n\t\t\t\t&lt;?php if(!empty($box_roll) &amp;&amp; $box_roll == &#039;on&#039;) echo &#039;&lt;\/div&gt;&lt;!--\/overlaid-content--&gt;&#039;; ?&gt;\n\n\t\t\t&lt;\/div&gt; &lt;!--\/nectar particles--&gt;\n\n\t\t\t&lt;?php }\n\t\t} \/\/particle bg ?&gt;\n\n\t\t&lt;\/div&gt;\n\n\t   &lt;?php \n\n\t    echo &#039;&lt;\/div&gt;&#039;;  \n\n\t    } else if( !empty($title) &amp;&amp; !is_archive()) { ?&gt;\n\t    \t\n\t\t    &lt;div class=&quot;row page-header-no-bg&quot; data-alignment=&quot;&lt;?php echo (!empty($text_align)) ? $text_align : &#039;left&#039; ; ?&gt;&quot;&gt;\n\t\t    \t&lt;div class=&quot;container&quot;&gt;\t\n\t\t\t\t\t&lt;div class=&quot;col span_12 section-title&quot;&gt;\n\t\t\t\t\t\t&lt;h1&gt;&lt;?php echo $title; ?&gt;&lt;?php if(!empty($subtitle)) echo &#039;&lt;span&gt;&#039; . $subtitle . &#039;&lt;\/span&gt;&#039;; ?&gt;&lt;\/h1&gt;\n\t\t\t\t\t\t\n\t\t\t\t\t\t&lt;?php \/\/ portfolio filters\n\t\t\t\t\t\tif( $page_template == &#039;template-portfolio.php&#039; &amp;&amp; $display_sortable == &#039;1&#039; &amp;&amp; $inline_filters == &#039;0&#039;) { ?&gt;\n\t\t\t\t\t\t&lt;div class=&quot;&lt;?php echo $filters_id;?&gt;&quot; instance=&quot;0&quot;&gt;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t&lt;a href=&quot;#&quot; data-sortable-label=&quot;&lt;?php echo (!empty($options[&#039;portfolio-sortable-text&#039;])) ? $options[&#039;portfolio-sortable-text&#039;] :&#039;Sort Portfolio&#039;; ?&gt;&quot; id=&quot;sort-portfolio&quot;&gt;&lt;span&gt;&lt;?php echo (!empty($options[&#039;portfolio-sortable-text&#039;])) ? $options[&#039;portfolio-sortable-text&#039;] : __(&#039;Sort Portfolio&#039;,NECTAR_THEME_NAME); ?&gt;&lt;\/span&gt; &lt;i class=&quot;icon-angle-down&quot;&gt;&lt;\/i&gt;&lt;\/a&gt; \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t&lt;ul&gt;\n\t\t\t\t\t\t\t   &lt;li&gt;&lt;a href=&quot;#&quot; data-filter=&quot;*&quot;&gt;&lt;?php echo __(&#039;All&#039;, NECTAR_THEME_NAME); ?&gt;&lt;\/a&gt;&lt;\/li&gt;\n\t\t\t               \t   &lt;?php wp_list_categories(array(&#039;title_li&#039; =&gt; &#039;&#039;, &#039;taxonomy&#039; =&gt; &#039;project-type&#039;, &#039;show_option_none&#039;   =&gt; &#039;&#039;, &#039;walker&#039; =&gt; new Walker_Portfolio_Filter())); ?&gt;\n\t\t\t\t\t\t\t&lt;\/ul&gt;\n\t\t\t\t\t\t&lt;\/div&gt;\n\t\t\t\t\t&lt;?php } ?&gt;\n\t\t\t\t\t\t\n\t\t\t\t\t&lt;\/div&gt;\n\t\t\t\t&lt;\/div&gt;\n\n\t\t\t&lt;\/div&gt; \n\t \t   \t\n\t    &lt;?php } else if(is_category() || is_tag() || is_date() || is_author() ) {\n\n\t    \t\/*blog archives*\/\n\t    \t$archive_bg_img = (isset($options[&#039;blog_archive_bg_image&#039;])) ? nectar_options_img($options[&#039;blog_archive_bg_image&#039;]) : null;\n\t    \t$t_id =  get_cat_ID( single_cat_title( &#039;&#039;, false ) ) ;\n\t    \t$terms =  get_option( &quot;taxonomy_$t_id&quot; );\n\n\t    \t$heading = null;\n\t\t\t$subtitle = null;\n\n\t\t\tif(is_author()){\n\n\t\t\t\t$heading =  get_the_author();\n\t\t\t\t$subtitle = __(&#039;All Posts By&#039;, NECTAR_THEME_NAME );\n\n\t\t\t} else if(is_category()) {\n\n\t\t\t\t$heading =  single_cat_title( &#039;&#039;, false );\n\t\t\t\t$subtitle = __(&#039;Category&#039;, NECTAR_THEME_NAME );\n\n\t\t\t} else if(is_tag()) {\n\n\t\t\t\t$heading =  wp_title(&quot;&quot;,false);\n\t\t\t\t$subtitle = __(&#039;Tag&#039;, NECTAR_THEME_NAME );\n\n\t\t\t} else if(is_date()){\n\n\t\t\t\tif ( is_day() ) :\n\n\t\t\t\t\t$heading = get_the_date();\n\t\t\t\t\t$subtitle = __(&#039;Daily Archives&#039;, NECTAR_THEME_NAME );\n\t\t\t\t\n\t\t\t\telseif ( is_month() ) :\n\n\t\t\t\t\t$heading = get_the_date( _x( &#039;F Y&#039;, &#039;monthly archives date format&#039;, NECTAR_THEME_NAME ) );\n\t\t\t\t\t$subtitle = __(&#039;Monthly Archives&#039;, NECTAR_THEME_NAME );\n\n\t\t\t\telseif ( is_year() ) :\n\n\t\t\t\t\t$heading =  get_the_date( _x( &#039;Y&#039;, &#039;yearly archives date format&#039;, NECTAR_THEME_NAME ) );\n\t\t\t\t\t$subtitle = __(&#039;Yearly Archives&#039;, NECTAR_THEME_NAME );\n\n\t\t\t\telse :\n\t\t\t\t\t$heading = __( &#039;Archives&#039;, NECTAR_THEME_NAME );\n\n\t\t\t\tendif;\n\t\t\t} else {\n\t\t\t\t\t$heading = wp_title(&quot;&quot;,false);\n\t\t\t} ?&gt;\n\n\t\t\t&lt;?php \n\t\t\t\/\/category archive text align\n\t\t\t$blog_type = $options[&#039;blog_type&#039;];\n\t\t\tif($blog_type == null) $blog_type = &#039;std-blog-sidebar&#039;;\n\n\t\t\t$blog_standard_type = (!empty($options[&#039;blog_standard_type&#039;])) ? $options[&#039;blog_standard_type&#039;] : &#039;classic&#039;;\n\t\t\t$archive_header_text_align = ($blog_type != &#039;masonry-blog-sidebar&#039; &amp;&amp; $blog_type != &#039;masonry-blog-fullwidth&#039; &amp;&amp; $blog_type != &#039;masonry-blog-full-screen-width&#039; &amp;&amp; $blog_standard_type == &#039;minimal&#039;) ? &#039;center&#039; : &#039;left&#039;;\n\n\t\t\tif(!empty($terms[&#039;category_image&#039;]) || !empty($archive_bg_img)) { \n\n\t\t\t\t$bg_img = $archive_bg_img;\n\t\t\t\tif(!empty($terms[&#039;category_image&#039;])) $bg_img = $terms[&#039;category_image&#039;];\n\n\t\t\t\tif($animate_in_effect == &#039;slide-down&#039;) {\n\t\t\t\t\t$wrapper_height_style = null;\n\t\t\t\t} else {\n\t\t\t\t\t$wrapper_height_style = &#039;style=&quot;height: 350px;&quot;&#039;;\n\t\t\t\t}\n\t\t\t?&gt;\n\n\t\t\t&lt;div id=&quot;page-header-wrap&quot; data-midnight=&quot;light&quot; &lt;?php echo $wrapper_height_style; ?&gt;&gt;\t \n\t\t\t\t&lt;div id=&quot;page-header-bg&quot; data-animate-in-effect=&quot;&lt;?php echo $animate_in_effect; ?&gt;&quot; id=&quot;page-header-bg&quot; data-text-effect=&quot;&quot; data-bg-pos=&quot;center&quot; data-alignment=&quot;&lt;?php echo $archive_header_text_align; ?&gt;&quot; data-alignment-v=&quot;center&quot; data-parallax=&quot;0&quot; data-height=&quot;350&quot; style=&quot;height: 350px;&quot;&gt;\n\t\t\t\n\t\t\t\t\t&lt;div class=&quot;page-header-bg-image&quot; style=&quot;background-image: url(&lt;?php echo $bg_img; ?&gt;);&quot;&gt;&lt;\/div&gt; \n\n\t\t\t\t\t&lt;div class=&quot;container&quot;&gt;\n\t\t\t\t\t    &lt;div class=&quot;row&quot;&gt;\n\t\t\t\t\t\t    &lt;div class=&quot;col span_6&quot;&gt;\n\t\t\t\t\t\t\t     &lt;div class=&quot;inner-wrap&quot;&gt;\n\t\t\t\t\t\t\t     \t&lt;span class=&quot;subheader&quot;&gt;&lt;?php echo $subtitle; ?&gt;&lt;\/span&gt;\n\t\t\t\t\t\t\t\t\t&lt;h1&gt;&lt;?php echo $heading; ?&gt;&lt;\/h1&gt;\n\t\t\t\t\t\t\t    &lt;\/div&gt;\n\t\t\t\t\t\t\t \n\t\t\t\t\t   \t    &lt;\/div&gt;\n\t\t\t\t        &lt;\/div&gt;\n\t\t\t\t\t\t\t  \n\t\t\t\t   &lt;\/div&gt;\n\t\t        &lt;\/div&gt;\n\n   \t\t\t&lt;\/div&gt;\n   \t\t\t&lt;?php } else { ?&gt;\n\n\t   \t\t\t &lt;div class=&quot;row page-header-no-bg&quot; data-alignment=&quot;&lt;?php echo (!empty($text_align)) ? $text_align : &#039;left&#039; ; ?&gt;&quot;&gt;\n\t\t\t    \t&lt;div class=&quot;container&quot;&gt;\t\n\t\t\t\t\t\t&lt;div class=&quot;col span_12 section-title&quot;&gt;\n\t\t\t\t\t\t\t&lt;span class=&quot;subheader&quot;&gt;&lt;?php echo $subtitle; ?&gt;&lt;\/span&gt;\n\t\t\t\t\t\t\t&lt;h1&gt;&lt;?php echo $heading; ?&gt;&lt;\/h1&gt;\n\t\t\t\t\t\t&lt;\/div&gt;\n\t\t\t\t\t&lt;\/div&gt;\n\n\t\t\t\t&lt;\/div&gt; \n\n   \t\t\t&lt;?php }\n\t    }\n \n    }\n}\n\nfunction using_page_header($post_id){\n\n\t global $post; \n\t global $woocommerce; \n\t global $options;\n\n\t $force_effect = null;\n\n\t if($woocommerce &amp;&amp; is_shop() || $woocommerce &amp;&amp; is_product_category() || $woocommerce &amp;&amp; is_product_tag()) {\n\n\t \tif( version_compare( $woocommerce-&gt;version, &quot;3.0&quot;, &quot;&gt;=&quot; ) ) {\n\t\t\t$header_title = get_post_meta(wc_get_page_id(&#039;shop&#039;), &#039;_nectar_header_title&#039;, true);\n\t\t\t$header_bg = get_post_meta(wc_get_page_id(&#039;shop&#039;), &#039;_nectar_header_bg&#039;, true);\n\t\t\t$header_bg_color = get_post_meta(wc_get_page_id(&#039;shop&#039;), &#039;_nectar_header_bg_color&#039;, true);\n\t\t\t$bg_type = get_post_meta(wc_get_page_id(&#039;shop&#039;), &#039;_nectar_slider_bg_type&#039;, true); \n\t\t\tif(empty($bg_type)) $bg_type = &#039;image_bg&#039;; \n\t\t\t$disable_effect = get_post_meta(wc_get_page_id(&#039;shop&#039;), &#039;_disable_transparent_header&#039;, true);\n\t\t\t$force_effect = null;\n\t\t} else {\n\t\t\t$header_title = get_post_meta(woocommerce_get_page_id(&#039;shop&#039;), &#039;_nectar_header_title&#039;, true);\n\t\t\t$header_bg = get_post_meta(woocommerce_get_page_id(&#039;shop&#039;), &#039;_nectar_header_bg&#039;, true);\n\t\t\t$header_bg_color = get_post_meta(woocommerce_get_page_id(&#039;shop&#039;), &#039;_nectar_header_bg_color&#039;, true);\n\t\t\t$bg_type = get_post_meta(woocommerce_get_page_id(&#039;shop&#039;), &#039;_nectar_slider_bg_type&#039;, true); \n\t\t\tif(empty($bg_type)) $bg_type = &#039;image_bg&#039;; \n\t\t\t$disable_effect = get_post_meta(woocommerce_get_page_id(&#039;shop&#039;), &#039;_disable_transparent_header&#039;, true);\n\t\t\t$force_effect = null;\n\t\t}\n\n\t } \n\t else if(is_home()){\n\t \t$header_title = get_post_meta(get_option(&#039;page_for_posts&#039;), &#039;_nectar_header_title&#039;, true);\n\t\t$header_bg = get_post_meta(get_option(&#039;page_for_posts&#039;), &#039;_nectar_header_bg&#039;, true); \n\t\t$header_bg_color = get_post_meta(get_option(&#039;page_for_posts&#039;), &#039;_nectar_header_bg_color&#039;, true); \n\t\t$bg_type = get_post_meta(get_option(&#039;page_for_posts&#039;), &#039;_nectar_slider_bg_type&#039;, true); \n\t\tif(empty($bg_type)) $bg_type = &#039;image_bg&#039;; \n\t\t$disable_effect = get_post_meta(get_option(&#039;page_for_posts&#039;), &#039;_disable_transparent_header&#039;, true);\n\t\t$force_effect = null;\n\t }  \n\n\t else if(!is_category() &amp;&amp; !is_tag() &amp;&amp; !is_date() &amp; !is_author()) {\n\t\t$header_title = get_post_meta($post-&gt;ID, &#039;_nectar_header_title&#039;, true);\n\t\t$header_bg = get_post_meta($post-&gt;ID, &#039;_nectar_header_bg&#039;, true); \n\t\t$header_bg_color = get_post_meta($post-&gt;ID, &#039;_nectar_header_bg_color&#039;, true); \n\t\t$bg_type = get_post_meta($post-&gt;ID, &#039;_nectar_slider_bg_type&#039;, true); \n\t\tif(empty($bg_type)) $bg_type = &#039;image_bg&#039;; \n\t\t$disable_effect = get_post_meta($post-&gt;ID, &#039;_disable_transparent_header&#039;, true);\n\t\t$force_effect = get_post_meta($post-&gt;ID, &#039;_force_transparent_header&#039;, true);\n\t }\n\n\t\/\/blog archives\n\tif(is_category() || is_tag() || is_date() || is_author()){\n\t\t$bg_type = null;\n\t\t$disable_effect = null;\n\t\t$archive_bg_img = ( isset($options[&#039;blog_archive_bg_image&#039;][&#039;id&#039;]) &amp;&amp; !empty($options[&#039;blog_archive_bg_image&#039;][&#039;id&#039;]) ) ? nectar_options_img($options[&#039;blog_archive_bg_image&#039;]) : null;\n\t\t$t_id =  get_cat_ID( single_cat_title( &#039;&#039;, false ) ) ;\n\t\t$terms =  get_option( &quot;taxonomy_$t_id&quot; );\n\t\tif(!empty($archive_bg_img) || !empty($terms[&#039;category_image&#039;])) {\n\t\t     $force_effect = &#039;on&#039;;\n\t\t     $bg_type = &#039;image_bg&#039;;\n\t\t }\n\t}\n\n\t$pattern = get_shortcode_regex();\n\t\n\t$using_applicable_shortcode = 0;\n\t\n    if ( preg_match_all( &#039;\/&#039;. $pattern .&#039;\/s&#039;, $post-&gt;post_content, $matches )  &amp;&amp; array_key_exists( 0, $matches ))  {\n    \t\n\t\tif($matches[0][0]){\n\t\t\tif( strpos($matches[0][0],&#039;nectar_slider&#039;) !== false &amp;&amp; strpos($matches[0][0],&#039;full_width=&quot;true&quot;&#039;) !== false) {\n\t\t\t\t\n\t\t\t\tif(empty($header_title)) $using_applicable_shortcode = 1;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t$using_applicable_shortcode = 0;\n\t\t\t}\n\t\t}\n    \t\n    }\n\t\n\t\/\/stop effect from WooCommerce single pages\n\tglobal $woocommerce; \n\tif($woocommerce &amp;&amp; is_product()) { $using_applicable_shortcode = 0; $header_bg = 0; $header_bg_color = 0; }\n\n\t\/\/alternate header style\n\tglobal $options;\n\tif(!empty($options[&#039;blog_header_type&#039;]) &amp;&amp; $options[&#039;blog_header_type&#039;] == &#039;fullscreen&#039; &amp;&amp; is_singular(&#039;post&#039;))  $using_applicable_shortcode = 1;\n\n\t\/\/incase of search \/ tax \/ removing effect\n\tif(is_search() || $disable_effect == &#039;on&#039;) { $using_applicable_shortcode = 0; $header_bg = 0; $header_bg_color = 0; $bg_type = &#039;image_bg&#039;; }\n\n\t$page_full_screen_rows = (isset($post-&gt;ID)) ? get_post_meta($post-&gt;ID, &#039;_nectar_full_screen_rows&#039;, true) : &#039;&#039;;\n\t\/\/if forcing effect\n\tif($force_effect == &#039;on&#039; &amp;&amp; (!is_search() &amp;&amp; !is_tax()) || $page_full_screen_rows == &#039;on&#039; &amp;&amp; (!is_search() &amp;&amp; !is_tax()) ) { $using_applicable_shortcode = 1; }\n\n\t$the_verdict = (!empty($header_bg_color) || !empty($header_bg) || $bg_type == &#039;video_bg&#039; || $bg_type == &#039;particle_bg&#039; || $using_applicable_shortcode) ? true : false;\n\n\treturn $the_verdict;\n\n}\n\nfunction using_nectar_slider(){\n\t\n\tglobal $post; \n\tglobal $woocommerce;\n\t\n\tif($woocommerce &amp;&amp; is_shop() || $woocommerce &amp;&amp; is_product_category() || $woocommerce &amp;&amp; is_product_tag()) {\n\t\tif( version_compare( $woocommerce-&gt;version, &quot;3.0&quot;, &quot;&gt;=&quot; ) ) {\n\t\t\t$header_title = get_post_meta(wc_get_page_id(&#039;shop&#039;), &#039;_nectar_header_title&#039;, true);\n\t\t\t$header_bg = get_post_meta(wc_get_page_id(&#039;shop&#039;), &#039;_nectar_header_bg&#039;, true);\n\t\t\t$header_bg_color = get_post_meta(wc_get_page_id(&#039;shop&#039;), &#039;_nectar_header_bg_color&#039;, true);\n\t\t} else {\n\t\t\t$header_title = get_post_meta(woocommerce_get_page_id(&#039;shop&#039;), &#039;_nectar_header_title&#039;, true);\n\t\t\t$header_bg = get_post_meta(woocommerce_get_page_id(&#039;shop&#039;), &#039;_nectar_header_bg&#039;, true);\n\t\t\t$header_bg_color = get_post_meta(woocommerce_get_page_id(&#039;shop&#039;), &#039;_nectar_header_bg_color&#039;, true);\n\t\t}\n\t } \n\t else if(is_home() || is_archive()){\n\t \t$header_title = get_post_meta(get_option(&#039;page_for_posts&#039;), &#039;_nectar_header_title&#039;, true);\n\t\t$header_bg = get_post_meta(get_option(&#039;page_for_posts&#039;), &#039;_nectar_header_bg&#039;, true); \n\t\t$header_bg_color = get_post_meta(get_option(&#039;page_for_posts&#039;), &#039;_nectar_header_bg_color&#039;, true); \n\t }  else {\n\t\t$header_title = get_post_meta($post-&gt;ID, &#039;_nectar_header_title&#039;, true);\n\t\t$header_bg = get_post_meta($post-&gt;ID, &#039;_nectar_header_bg&#039;, true); \n\t\t$header_bg_color = get_post_meta($post-&gt;ID, &#039;_nectar_header_bg_color&#039;, true); \n\t }\n\t\n\t$pattern = get_shortcode_regex();\n\t$using_fullwidth_slider = 0;\n\t\n\tif ( preg_match_all( &#039;\/&#039;. $pattern .&#039;\/s&#039;, $post-&gt;post_content, $matches )  &amp;&amp; array_key_exists( 0, $matches ))  {\n    \t\n\t\tif($matches[0][0]){\n\t\t\t\n\t\t\tif( strpos($matches[0][0],&#039;nectar_slider&#039;) !== false &amp;&amp; strpos($matches[0][0],&#039;full_width=&quot;true&quot;&#039;) !== false \n\t\t\t|| strpos($matches[0][0],&#039; type=&quot;full_width_content&quot;&#039;) !== false &amp;&amp; strpos($matches[0][0],&#039;nectar_slider&#039;) !== false &amp;&amp; strpos($matches[0][0],&#039;[vc_column width=&quot;1\/1&quot;&#039;) !== false ) {\n\t\t\t\t\n\t\t\t\t$using_fullwidth_slider = 1;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$using_fullwidth_slider = 0;\n\t\t\t\t\n\t\t\t}\n\t\t}\n    \t\n    }\n\t\n\t\/\/incase of search\n\tif(is_search() || is_tax()) $using_fullwidth_slider = 0;\n\n\t\/\/stop effect from WooCommerce single pages\n\tglobal $woocommerce; \n\tif($woocommerce &amp;&amp; is_product()) $using_fullwidth_slider = 0; \n\n\t$the_verdict = (empty($header_title) &amp;&amp; empty($header_bg) &amp;&amp; empty($header_bg_color) &amp;&amp; $using_fullwidth_slider) ? true : false;\n\n\treturn $the_verdict;\n}\n\n#-----------------------------------------------------------------#\n# Pagination\n#-----------------------------------------------------------------#\n\nif ( !function_exists( &#039;nectar_pagination&#039; ) ) {\n\t\n\tfunction nectar_pagination() {\n\t\t\n\t\tglobal $options;\n\t\t\/\/extra pagination\n\t\tif( !empty($options[&#039;extra_pagination&#039;]) &amp;&amp; $options[&#039;extra_pagination&#039;] == &#039;1&#039; ){\n\t\t\t\n\t\t\t    global $wp_query, $wp_rewrite; \n\t      \n\t\t\t    $wp_query-&gt;query_vars[&#039;paged&#039;] &gt; 1 ? $current = $wp_query-&gt;query_vars[&#039;paged&#039;] : $current = 1; \n\t\t\t    $total_pages = $wp_query-&gt;max_num_pages; \n\t\t\t      \n\t\t\t    if ($total_pages &gt; 1){  \n\t\t\t      \n\t\t\t      $permalink_structure = get_option(&#039;permalink_structure&#039;);\n\t\t\t\t  $query_type = (count($_GET)) ? &#039;&amp;&#039; : &#039;?&#039;;\t\n\t\t\t      $format = empty( $permalink_structure ) ? $query_type.&#039;paged=%#%&#039; : &#039;page\/%#%\/&#039;;  \n\t\t\t\t\n\t\t\t\t  echo &#039;&lt;div id=&quot;pagination&quot; data-is-text=&quot;&#039;.__(&quot;All items loaded&quot;, NECTAR_THEME_NAME).&#039;&quot;&gt;&#039;;\n\t\t\t\t   \n\t\t\t      echo paginate_links(array(  \n\t\t\t          &#039;base&#039; =&gt; get_pagenum_link(1) . &#039;%_%&#039;,  \n\t\t\t          &#039;format&#039; =&gt; $format,  \n\t\t\t          &#039;current&#039; =&gt; $current,  \n\t\t\t          &#039;total&#039; =&gt; $total_pages,  \n\t\t\t          &#039;prev_text&#039;    =&gt; __(&#039;Previous&#039;,NECTAR_THEME_NAME),\n    \t\t\t\t  &#039;next_text&#039;    =&gt; __(&#039;Next&#039;,NECTAR_THEME_NAME)\n\t\t\t        )); \n\t\t\t\t\t\n\t\t\t\t  echo  &#039;&lt;\/div&gt;&#039;; \n\t\t\t\t\t\n\t\t\t    }  \n\t}\n\t\t\/\/regular pagination\n\t\telse{\n\t\t\t\n\t\t\tif( get_next_posts_link() || get_previous_posts_link() ) { \n\t\t\t\techo &#039;&lt;div id=&quot;pagination&quot; data-is-text=&quot;&#039;.__(&quot;All items loaded&quot;, NECTAR_THEME_NAME).&#039;&quot;&gt;\n\t\t\t\t      &lt;div class=&quot;prev&quot;&gt;&#039;.get_previous_posts_link(&#039;&amp;laquo; Previous&#039;).&#039;&lt;\/div&gt;\n\t\t\t\t      &lt;div class=&quot;next&quot;&gt;&#039;.get_next_posts_link(&#039;NextPrevious &amp;raquo;&#039;,&#039;&#039;).&#039;&lt;\/div&gt;\n\t\t\t          &lt;\/div&gt;&#039;;\n\t\t\t\n\t        }\n\t\t}\n\t\t\n\t\n\t}\n}\n\n#-----------------------------------------------------------------#\n# Woocommerce\n#-----------------------------------------------------------------#\nglobal $woocommerce;\n\n$main_shop_layout = (!empty($options[&#039;main_shop_layout&#039;])) ? $options[&#039;main_shop_layout&#039;] : &#039;no-sidebar&#039;;\n$single_product_layout = (!empty($options[&#039;single_product_layout&#039;])) ? $options[&#039;single_product_layout&#039;] : &#039;no-sidebar&#039;;\n\nremove_action( &#039;woocommerce_before_main_content&#039;, &#039;woocommerce_output_content_wrapper&#039;, 10);\nremove_action( &#039;woocommerce_after_main_content&#039;, &#039;woocommerce_output_content_wrapper_end&#039;, 10);\n\nfunction nectar_shop_wrapper_start() {\n   echo &#039;&lt;div class=&quot;container-wrap&quot;&gt;&lt;div class=&quot;container main-content&quot;&gt;&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;nectar-shop-header&quot;&gt;&#039;;\n   do_action( &#039;nectar_shop_header_markup&#039; );\n   echo &#039;&lt;\/div&gt;&#039;;\n}\n\nfunction nectar_shop_wrapper_end() {\n  echo &#039;&lt;\/div&gt;&lt;\/div&gt;&lt;\/div&gt;&#039;;\n}\n\nfunction nectar_shop_wrapper_start_sidebar_left() {\n\n    echo &#039;&lt;div class=&quot;container-wrap&quot;&gt;&lt;div class=&quot;container main-content&quot;&gt;&lt;div class=&quot;nectar-shop-header&quot;&gt;&#039;;\n    do_action( &#039;nectar_shop_header_markup&#039; );\n    echo &#039;&lt;\/div&gt;&lt;div class=&quot;row&quot;&gt;&lt;div id=&quot;sidebar&quot; class=&quot;col span_3 col&quot;&gt;&#039;;\n    wc_get_template( &#039;global\/sidebar.php&#039; );\n    echo &#039;&lt;\/div&gt;&lt;div id=&quot;post-area&quot; class=&quot;col span_9 col_last&quot;&gt;&#039;;\n}\n\nfunction nectar_shop_wrapper_end_sidebar_left() {\n    echo &#039;&lt;\/div&gt;&lt;\/div&gt;&lt;\/div&gt;&lt;\/div&gt;&#039;;\n}\n\nfunction nectar_shop_wrapper_start_sidebar_right() {\n    echo &#039;&lt;div class=&quot;container-wrap&quot;&gt;&lt;div class=&quot;container main-content&quot;&gt;&lt;div class=&quot;nectar-shop-header&quot;&gt;&#039;;\n    do_action( &#039;nectar_shop_header_markup&#039; );\n    echo &#039;&lt;\/div&gt;&lt;div class=&quot;row&quot;&gt;&lt;div id=&quot;post-area&quot; class=&quot;col span_9&quot;&gt;&#039;;\n}\n\nfunction nectar_shop_wrapper_end_sidebar_right() {\n\techo &#039;&lt;\/div&gt;&lt;div id=&quot;sidebar&quot; class=&quot;col span_3 col_last&quot;&gt;&#039;;\n    wc_get_template( &#039;global\/sidebar.php&#039; );\n    echo &#039;&lt;\/div&gt;&lt;\/div&gt;&lt;\/div&gt;&lt;\/div&gt;&#039;;\n}\n\nfunction nectar_shop_wrapper_start_fullwidth() {\n\n    echo &#039;&lt;div class=&quot;container-wrap&quot;&gt;&lt;div class=&quot;container main-content&quot;&gt;&lt;div class=&quot;row&quot;&gt;&lt;div class=&quot;full-width-content&quot;&gt;&lt;div class=&quot;nectar-shop-header&quot;&gt;&#039;;\n    do_action( &#039;nectar_shop_header_markup&#039; );\n    echo &#039;&lt;\/div&gt;&#039;;\n}\n\nfunction nectar_shop_wrapper_end_fullwidth() {\n    echo &#039;&lt;\/div&gt;&lt;\/div&gt;&lt;\/div&gt;&lt;\/div&gt;&#039;;\n}\n\nif (!function_exists(&#039;nectar_shop_loop_columns&#039;)) {\n\tfunction nectar_shop_loop_columns() {\n\t\treturn 3; \/\/ 3 products per row\n\t}\n}\n\n\/\/change header \nremove_action( &#039;woocommerce_before_shop_loop&#039;, &#039;woocommerce_result_count&#039;, 20 );\nremove_action(&#039;woocommerce_before_shop_loop&#039;, &#039;woocommerce_catalog_ordering&#039;,30);\nadd_filter( &#039;woocommerce_show_page_title&#039;, &#039;__return_false&#039; );\nadd_filter( &#039;woocommerce_breadcrumb_defaults&#039;, &#039;nectar_change_breadcrumb_delimiter&#039; );\nfunction nectar_change_breadcrumb_delimiter( $defaults ) {\n\t$defaults[&#039;delimiter&#039;] = &#039; &lt;i class=&quot;fa fa-angle-right&quot;&gt;&lt;\/i&gt; &#039;;\n\treturn $defaults;\n}\n\nif($woocommerce) {\n\tadd_action( &#039;wp&#039;, &#039;nectar_woo_shop_markup&#039; );\n}\n\nfunction nectar_woo_shop_markup() {\n\n\tglobal $single_product_layout;\n\tglobal $main_shop_layout;\n\tglobal $woocommerce;\n\n\tif($woocommerce &amp;&amp; !is_product()) {\n\t\tremove_action( &#039;woocommerce_before_main_content&#039;, &#039;woocommerce_breadcrumb&#039;, 20);\n\t}\n\n\t\/\/page header\n\tif(is_shop() || is_product_category() || is_product_tag()) {\n\t\n\t\tadd_action(&#039;woocommerce_before_main_content&#039;, &#039;salient_shop_header&#039;, 10);\n\n\t\tfunction salient_shop_header() {\n\t\t\tglobal $woocommerce;\n\t\t\t\/\/page header for main shop page\n\t\t\tif( $woocommerce &amp;&amp; version_compare( $woocommerce-&gt;version, &quot;3.0&quot;, &quot;&gt;=&quot; ) ) {\n\t\t\t\tnectar_page_header(wc_get_page_id(&#039;shop&#039;));\n\t\t\t} else {\n\t\t\t\tnectar_page_header(woocommerce_get_page_id(&#039;shop&#039;));\n\t\t\t}\n\t\t}\n\n\t\tfunction salient_woo_shop_title() {\n\t\t\techo &#039;&lt;h1 class=&quot;page-title&quot;&gt;&#039;;\n\t\t\twoocommerce_page_title();\n\t\t\techo &#039;&lt;\/h1&gt;&#039;;\n\t\t}\n\n\t\tif( $woocommerce &amp;&amp; version_compare( $woocommerce-&gt;version, &quot;3.0&quot;, &quot;&gt;=&quot; ) ) {\n\t\t\t$header_title = get_post_meta(wc_get_page_id(&#039;shop&#039;), &#039;_nectar_header_title&#039;, true);\n\t\t} else {\n\t\t\t$header_title = get_post_meta(woocommerce_get_page_id(&#039;shop&#039;), &#039;_nectar_header_title&#039;, true);\n\t\t}\n\n\t\tif(is_shop() &amp;&amp; empty($header_title)) {\n\t\t\tadd_action(&#039;nectar_shop_header_markup&#039;,&#039;salient_woo_shop_title&#039;,10);\n\t\t}\n\n\t\tadd_action(&#039;nectar_shop_header_markup&#039;, &#039;woocommerce_catalog_ordering&#039;, 10);\n\t\tadd_action(&#039;nectar_shop_header_markup&#039;, &#039;woocommerce_result_count&#039;, 10);\n\t\tadd_action(&#039;nectar_shop_header_markup&#039;, &#039;woocommerce_breadcrumb&#039;, 10);\n\n\t} \n\n\t\/\/no sidebar shop single\n\tif (is_product() &amp;&amp; $single_product_layout != &#039;right-sidebar&#039; &amp;&amp; is_product() &amp;&amp; $single_product_layout != &#039;left-sidebar&#039;) {\n\t\tremove_action(&#039;woocommerce_sidebar&#039;,&#039;woocommerce_get_sidebar&#039;,10);\n\t\tadd_action(&#039;woocommerce_before_main_content&#039;, &#039;nectar_shop_wrapper_start&#039;, 10);\n\t\tadd_action(&#039;woocommerce_after_main_content&#039;, &#039;nectar_shop_wrapper_end&#039;, 10);\n\t}\n\n\t\/\/no sidebar shop\n\tif(is_shop() || is_product_category() || is_product_tag()) {\n\t\tif($main_shop_layout != &#039;right-sidebar&#039; &amp;&amp; $main_shop_layout != &#039;left-sidebar&#039;  &amp;&amp; $main_shop_layout != &#039;fullwidth&#039;) {\n\t\t\tremove_action(&#039;woocommerce_sidebar&#039;,&#039;woocommerce_get_sidebar&#039;,10);\n\t\t\tadd_action(&#039;woocommerce_before_main_content&#039;, &#039;nectar_shop_wrapper_start&#039;, 10);\n\t\t\tadd_action(&#039;woocommerce_after_main_content&#039;, &#039;nectar_shop_wrapper_end&#039;, 10);\n\t\t}\n\n\t} \n\n\t\/\/using sidebar\n\tif(is_shop() || is_product_category() || is_product_tag() || is_product()) {\n\n\t\t$nectar_shop_layout = (is_product()) ? $single_product_layout : $main_shop_layout;\n\n\t\tif($nectar_shop_layout == &#039;right-sidebar&#039;) {\n\n\t\t\tremove_action(&#039;woocommerce_sidebar&#039;,&#039;woocommerce_get_sidebar&#039;,10);\n\t\t\t\n\t\t\tadd_action(&#039;woocommerce_before_main_content&#039;, &#039;nectar_shop_wrapper_start_sidebar_right&#039;, 10);\n\t\t\tadd_action(&#039;woocommerce_after_main_content&#039;, &#039;nectar_shop_wrapper_end_sidebar_right&#039;, 10);\n\n\t\t\tadd_filter(&#039;loop_shop_columns&#039;, &#039;nectar_shop_loop_columns&#039;);\n\n\t\t} else if($nectar_shop_layout == &#039;left-sidebar&#039;) {\n\n\t\t\tremove_action(&#039;woocommerce_sidebar&#039;,&#039;woocommerce_get_sidebar&#039;,10);\n\t\t\t\n\t\t\tadd_action(&#039;woocommerce_before_main_content&#039;, &#039;nectar_shop_wrapper_start_sidebar_left&#039;, 10);\n\t\t\tadd_action(&#039;woocommerce_after_main_content&#039;, &#039;nectar_shop_wrapper_end_sidebar_left&#039;, 10);\n\n\t\t\tadd_filter(&#039;loop_shop_columns&#039;, &#039;nectar_shop_loop_columns&#039;);\n\t\t}\n\n\t\telse if($nectar_shop_layout == &#039;fullwidth&#039;) {\n\n\t\t\tremove_action(&#039;woocommerce_sidebar&#039;,&#039;woocommerce_get_sidebar&#039;,10);\n\t\t\t\n\t\t\tadd_action(&#039;woocommerce_before_main_content&#039;, &#039;nectar_shop_wrapper_start_fullwidth&#039;, 10);\n\t\t\tadd_action(&#039;woocommerce_after_main_content&#039;, &#039;nectar_shop_wrapper_end_fullwidth&#039;, 10);\n\n\t\t}\n\t}\n\n}\n\n\/*\nremove_action( &#039;woocommerce_before_main_content&#039;, &#039;woocommerce_output_content_wrapper&#039;, 10);\nremove_action( &#039;woocommerce_after_main_content&#039;, &#039;woocommerce_output_content_wrapper_end&#039;, 10);\n\nadd_action(&#039;woocommerce_before_main_content&#039;, &#039;salient_theme_wrapper_start&#039;, 10);\nadd_action(&#039;woocommerce_after_main_content&#039;, &#039;salient_theme_wrapper_end&#039;, 10);\n\nfunction salient_theme_wrapper_start() {\n    echo &#039;&lt;div class=&quot;container main-content&quot;&gt;&#039;;\n}\n\nfunction salient_theme_wrapper_end() {\n    echo &#039;&lt;\/div&gt;&#039;;\n}*\/\n\nadd_theme_support( &#039;woocommerce&#039; );\n\n\/\/remove parentheses in counts\nfunction nectar_remove_categories_count ($variable) {\n   $variable = str_replace(&#039;(&#039;, &#039;&lt;span class=&quot;post_count&quot;&gt; &#039;, $variable);\n   $variable = str_replace(&#039;)&#039;, &#039; &lt;\/span&gt;&#039;, $variable);\n   return $variable;\n}\n\nif($woocommerce) {\n\tadd_filter(&#039;wp_list_categories&#039;,&#039;nectar_remove_categories_count&#039;);\n\tadd_filter(&#039;woocommerce_layered_nav_count&#039;,&#039;nectar_remove_categories_count&#039;);\n}\n \nadd_filter( &#039;woocommerce_pagination_args&#039; , &#039;nectar_override_pagination_args&#039; );\nfunction nectar_override_pagination_args( $args ) {\n\t$args[&#039;prev_text&#039;] = __( &#039;Previous&#039;, NECTAR_THEME_NAME );\n\t$args[&#039;next_text&#039;] = __( &#039;Next&#039;, NECTAR_THEME_NAME );\n\treturn $args;\n}\n\nif( $woocommerce &amp;&amp; version_compare( $woocommerce-&gt;version, &quot;3.0&quot;, &quot;&gt;=&quot; ) ) {\n\tadd_filter(&#039;woocommerce_add_to_cart_fragments&#039;, &#039;add_to_cart_fragment&#039;);\n} else {\n\tadd_filter(&#039;add_to_cart_fragments&#039;, &#039;add_to_cart_fragment&#039;);\n}\n\n\/\/ update the cart with ajax\nfunction add_to_cart_fragment( $fragments ) {\n\tglobal $woocommerce;\n\tob_start();\n\t$fragments[&#039;a.cart-parent&#039;] = ob_get_clean();\n\treturn $fragments;\n}\n\nremove_action( &#039;woocommerce_cart_collaterals&#039;, &#039;woocommerce_cart_totals&#039;, 10 );\n\n\/\/change summary html markup to fit responsive\nadd_action( &#039;woocommerce_before_single_product_summary&#039;, &#039;summary_div&#039;, 35);\nadd_action( &#039;woocommerce_after_single_product_summary&#039;,  &#039;close_div&#039;, 4);\nfunction summary_div() {\n\techo &quot;&lt;div class=&#039;span_7 col col_last single-product-summary&#039;&gt;&quot;;\n}\nfunction close_div() {\n\techo &quot;&lt;\/div&gt;&quot;;\n}\n\n\/\/change tab position to be inside summary\nif(empty($options[&#039;product_tab_position&#039;]) || $options[&#039;product_tab_position&#039;] == &#039;in_sidebar&#039;) {\n\tremove_action(&#039;woocommerce_after_single_product_summary&#039;, &#039;woocommerce_output_product_data_tabs&#039;, 10);\n\tadd_action(&#039;woocommerce_after_single_product_summary&#039;, &#039;woocommerce_output_product_data_tabs&#039;, 1);\t\n}\n\n\/\/wrap single product image in an extra div\nadd_action( &#039;woocommerce_before_single_product_summary&#039;, &#039;images_div&#039;, 8);\nadd_action( &#039;woocommerce_before_single_product_summary&#039;,  &#039;close_div&#039;, 29);\nfunction images_div()\n{\n\techo &quot;&lt;div class=&#039;span_5 col single-product-main-image&#039;&gt;&quot;;\n}\n\n\/\/ display upsells and related products within dedicated div with different column and number of products\nremove_action( &#039;woocommerce_after_single_product_summary&#039;, &#039;woocommerce_output_related_products&#039;,20);\nremove_action( &#039;woocommerce_after_single_product&#039;, &#039;woocommerce_output_related_products&#039;,10);\nadd_action( &#039;woocommerce_after_single_product_summary&#039;, &#039;woocommerce_output_related_products&#039;, 20);\n\nfunction woocommerce_output_related_products() {\n\t$output = null;\n\n\tob_start();\n\twoocommerce_related_products(array(&#039;columns&#039; =&gt; 4, &#039;posts_per_page&#039; =&gt; 4)); \n\t$content = ob_get_clean();\n\tif($content) { $output .= $content; }\n\n\techo &#039;&lt;div class=&quot;clear&quot;&gt;&lt;\/div&gt;&#039; . $output;\n}\n\nremove_action( &#039;woocommerce_after_single_product_summary&#039;, &#039;woocommerce_upsell_display&#039;, 15 );\nremove_action( &#039;woocommerce_after_single_product&#039;, &#039;woocommerce_upsell_display&#039;,10);\nadd_action( &#039;woocommerce_after_single_product_summary&#039;, &#039;woocommerce_output_upsells&#039;, 21);\n\nfunction woocommerce_output_upsells() {\n\n\t$output = null;\n\n\tob_start();\n\twoocommerce_upsell_display(4,4); \n\t$content = ob_get_clean(); \n\tif($content) { $output .= $content; }\n\n\techo $output;\n}\n\nif( $woocommerce &amp;&amp; version_compare( $woocommerce-&gt;version, &quot;3.0&quot;, &quot;&gt;=&quot; ) ) {\n\tadd_filter(&#039;woocommerce_add_to_cart_fragments&#039;, &#039;woocommerce_header_add_to_cart_fragment&#039;);\n} else {\n\tadd_filter(&#039;add_to_cart_fragments&#039;, &#039;woocommerce_header_add_to_cart_fragment&#039;);\n}\n\n\t \nfunction woocommerce_header_add_to_cart_fragment( $fragments ) {\n\tglobal $woocommerce;\n\t\n\tob_start(); ?&gt;\n\t&lt;a class=&quot;cart-contents&quot; href=&quot;&lt;?php echo $woocommerce-&gt;cart-&gt;get_cart_url(); ?&gt;&quot;&gt;&lt;div class=&quot;cart-icon-wrap&quot;&gt;&lt;i class=&quot;icon-salient-cart&quot;&gt;&lt;\/i&gt; &lt;div class=&quot;cart-wrap&quot;&gt;&lt;span&gt;&lt;?php echo $woocommerce-&gt;cart-&gt;cart_contents_count; ?&gt; &lt;\/span&gt;&lt;\/div&gt; &lt;\/div&gt;&lt;\/a&gt;\n\t&lt;?php\n\t\n\t$fragments[&#039;a.cart-contents&#039;] = ob_get_clean();\n\t\n\treturn $fragments;\n}\n\n\/\/change how many products are displayed per page\t\nglobal $options;\n\n$product_hover_alt_image = ( !empty($options[&#039;product_hover_alt_image&#039;]) ) ? $options[&#039;product_hover_alt_image&#039;] : &#039;off&#039;;\n$nectar_woo_products_per_page = ( !empty($options[&#039;woo-products-per-page&#039;]) ) ? $options[&#039;woo-products-per-page&#039;] : &#039;12&#039;;\n\nadd_filter( &#039;loop_shop_per_page&#039;, create_function( &#039;$cols&#039;, &#039;return &#039;.$nectar_woo_products_per_page.&#039;;&#039; ), 20 );\n\n\/\/change the position of add to cart\nremove_action(&#039;woocommerce_after_shop_loop_item&#039;, &#039;woocommerce_template_loop_add_to_cart&#039;, 10);\n\nremove_action( &#039;woocommerce_before_shop_loop_item_title&#039;, &#039;woocommerce_template_loop_product_thumbnail&#039;, 10 );\n\n$product_style = (!empty($options[&#039;product_style&#039;])) ? $options[&#039;product_style&#039;] : &#039;classic&#039;;\nif( $product_style == &#039;classic&#039;){\n\tadd_action(&#039;woocommerce_before_shop_loop_item_title&#039;, &#039;product_thumbnail_with_cart&#039;, 10 );\n} else if($product_style == &#039;text_on_hover&#039;) {\n\tadd_action(&#039;woocommerce_before_shop_loop_item_title&#039;, &#039;product_thumbnail_with_cart_alt&#039;, 10 );\n\n\tremove_action( &#039;woocommerce_after_shop_loop_item_title&#039;, &#039;woocommerce_template_loop_price&#039;, 10 );\n\tremove_action( &#039;woocommerce_after_shop_loop_item_title&#039;, &#039;woocommerce_template_loop_rating&#039;, 5 );\n\tadd_action( &#039;woocommerce_after_shop_loop_item_title&#039;, &#039;woocommerce_template_loop_price&#039;, 5 );\n\tadd_action( &#039;woocommerce_after_shop_loop_item_title&#039;, &#039;woocommerce_template_loop_rating&#039;, 10 );\n} else {\n\tadd_action(&#039;woocommerce_before_shop_loop_item_title&#039;, &#039;product_thumbnail_material&#039;, 10 );\n\tremove_action( &#039;woocommerce_before_shop_loop_item&#039;, &#039;woocommerce_template_loop_product_link_open&#039;, 10 );\n\tremove_action( &#039;woocommerce_after_shop_loop_item&#039;, &#039;woocommerce_template_loop_product_link_close&#039;, 5 );\n}\n\n\/*add 3.0 gallery support when using default lightbox option in theme*\/\n$nectar_product_gal_type = ( !empty($options[&#039;single_product_gallery_type&#039;]) ) ? $options[&#039;single_product_gallery_type&#039;] : &#039;default&#039;;\n\nif($nectar_product_gal_type != &#039;ios_slider&#039;) {\n\tadd_theme_support( &#039;wc-product-gallery-zoom&#039; );\n\tadd_theme_support( &#039;wc-product-gallery-lightbox&#039; );\n\tadd_theme_support( &#039;wc-product-gallery-slider&#039; );\n}\n\nfunction product_thumbnail_with_cart() { \n\tglobal $product;\n\tglobal $woocommerce;\n\tglobal $product_hover_alt_image; ?&gt;\n\t\n   &lt;div class=&quot;product-wrap&quot;&gt;\n\n\t    &lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot;&gt;\t&lt;?php \n\n\t    $product_second_image = null;\n\t    if($product_hover_alt_image == &#039;1&#039;) {\n\n\t    \tif( $woocommerce &amp;&amp; version_compare( $woocommerce-&gt;version, &quot;3.0&quot;, &quot;&gt;=&quot; ) ) {\n\t    \t\t$product_attach_ids = $product-&gt;get_gallery_image_ids(); \n\t   \t\t} else {\n\t   \t\t\t$product_attach_ids = $product-&gt;get_gallery_attachment_ids(); \n\t   \t\t}\n\n\t\t\tif ( isset($product_attach_ids[0]) ) \n\t\t\t\t$product_second_image = wp_get_attachment_image($product_attach_ids[0], &#039;shop_catalog&#039;, false, array( &#039;class&#039; =&gt; &#039;hover-gallery-image&#039; ));\n\t    } \n\n\t    echo  woocommerce_get_product_thumbnail() . $product_second_image; ?&gt; &lt;\/a&gt;\n\t   \t&lt;?php woocommerce_template_loop_add_to_cart(); ?&gt;\n   \t&lt;\/div&gt;\n&lt;?php \n}\n\nfunction product_thumbnail_material() { \n\n   global $product;\n   global $woocommerce;\n   global $product_hover_alt_image; ?&gt;\n\t\n   &lt;div class=&quot;product-wrap&quot;&gt;\n\t    &lt;?php \n\n\t    $product_second_image = null;\n\t    if($product_hover_alt_image == &#039;1&#039;) {\n\n\t    \tif( $woocommerce &amp;&amp; version_compare( $woocommerce-&gt;version, &quot;3.0&quot;, &quot;&gt;=&quot; ) ) {\n\t    \t\t$product_attach_ids = $product-&gt;get_gallery_image_ids(); \n\t   \t\t} else {\n\t   \t\t\t$product_attach_ids = $product-&gt;get_gallery_attachment_ids(); \n\t   \t\t}\n\n\t\t\tif ( isset($product_attach_ids[0]) ) \n\t\t\t\t$product_second_image = wp_get_attachment_image($product_attach_ids[0], &#039;shop_catalog&#039;, false, array( &#039;class&#039; =&gt; &#039;hover-gallery-image&#039; ));\n\t    } \n\n\t\techo &#039;&lt;a href=&quot;&#039;.get_permalink().&#039;&quot;&gt;&#039;;\n\t    echo  woocommerce_get_product_thumbnail() . $product_second_image;\n\t    echo &#039;&lt;\/a&gt;&#039;;\n\t    echo &#039;&lt;div class=&quot;product-meta&quot;&gt;&#039;; \n\t    echo &#039;&lt;a href=&quot;&#039;.get_permalink().&#039;&quot;&gt;&#039;;\n\t    do_action( &#039;woocommerce_shop_loop_item_title&#039; );\n\t    echo &#039;&lt;\/a&gt;&#039;;\n \t\tdo_action( &#039;woocommerce_after_shop_loop_item_title&#039; ); \n\n \t\techo &#039;&lt;div class=&quot;product-add-to-cart&quot;&gt;&#039;; \n\t  \t  woocommerce_template_loop_add_to_cart(); \n\t    echo &#039;&lt;\/div&gt;&lt;\/div&gt;&#039;; ?&gt;\n   \t&lt;\/div&gt;\n&lt;?php \n}\n\nfunction product_thumbnail_with_cart_alt() { ?&gt;\n\t\n   \t\n\n   &lt;div class=&quot;product-wrap&quot;&gt;\n\t   \t&lt;?php \n\t   \tglobal $product;\n\t   \tglobal $woocommerce;\n\t   \tglobal $product_hover_alt_image; \n\n\t   \t$product_second_image = null;\n\t    if($product_hover_alt_image == &#039;1&#039;) {\n\n\t    \tif( $woocommerce &amp;&amp; version_compare( $woocommerce-&gt;version, &quot;3.0&quot;, &quot;&gt;=&quot; ) ) {\n\t    \t\t$product_attach_ids = $product-&gt;get_gallery_image_ids(); \n\t   \t\t} else {\n\t   \t\t\t$product_attach_ids = $product-&gt;get_gallery_attachment_ids(); \n\t   \t\t}\n\n\t\t\tif ( isset($product_attach_ids[0]) ) \n\t\t\t\t$product_second_image = wp_get_attachment_image($product_attach_ids[0], &#039;shop_catalog&#039;, false, array( &#039;class&#039; =&gt; &#039;hover-gallery-image&#039; ));\n\t    } \n\n\t   \techo  woocommerce_get_product_thumbnail() . $product_second_image; ?&gt;\n\n\t   \t&lt;div class=&quot;bg-overlay&quot;&gt;&lt;\/div&gt;\n\t   \t&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot; class=&quot;link-overlay&quot;&gt;&lt;\/a&gt;\n\t   \t&lt;div class=&quot;text-on-hover-wrap&quot;&gt;\n\t\t\t&lt;?php do_action( &#039;woocommerce_after_shop_loop_item_title&#039; ); ?&gt;\n\t\t\t&lt;?php \n\n\t\t\t\tif( $woocommerce &amp;&amp; version_compare( $woocommerce-&gt;version, &quot;3.0&quot;, &quot;&gt;=&quot; ) ) {\n\t\t\t\t\techo &#039;&lt;div class=&quot;categories&quot;&gt;&#039; . wc_get_product_category_list($product-&gt;get_id()) .&#039;&lt;\/div&gt;&#039;; \n\t\t\t\t} else {\n\t\t\t\t\techo &#039;&lt;div class=&quot;categories&quot;&gt;&#039; . $product-&gt;get_categories() .&#039;&lt;\/div&gt;&#039;; \n\t\t\t\t}\n\n\t\t\t?&gt;\n\t\t&lt;\/div&gt; \n\n   \t&lt;\/div&gt;\n   \t&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot;&gt;&lt;?php do_action( &#039;woocommerce_shop_loop_item_title&#039; ); ?&gt;&lt;\/a&gt;\n   \t&lt;?php woocommerce_template_loop_add_to_cart();\n\n}\n\n\/\/add link to item titles\n\/*add_action(&#039;woocommerce_before_shop_loop_item_title&#039;,&#039;product_item_title_link_open&#039;);\nadd_action(&#039;woocommerce_after_shop_loop_item_title&#039;,&#039;product_item_title_link_close&#039;);\nfunction product_item_title_link_open(){\n\techo &#039;&lt;a href=&quot;&#039;.get_permalink().&#039;&quot;&gt;&#039;;\n}\nfunction product_item_title_link_close(){\n\techo &#039;&lt;\/a&gt;&#039;;\n}*\/\n\nif(empty($options[&#039;product_tab_position&#039;]) || $options[&#039;product_tab_position&#039;] == &#039;in_sidebar&#039;) {\n\tadd_action( &#039;woocommerce_single_product_summary&#039;, &#039;review_quickview&#039;, 7 );\n} else {\n\tadd_action( &#039;woocommerce_single_product_summary&#039;, &#039;review_quickview&#039;, 100 );\n\tadd_action( &#039;woocommerce_after_single_product_summary&#039;, &#039;nectar_woo_clearfix&#039;, 7 );\n}\n\nfunction nectar_woo_clearfix() {\n\techo &#039;&lt;div class=&quot;after-product-summary-clear&quot;&gt;&lt;\/div&gt;&#039;;\n}\n\nfunction review_quickview(){\n\tglobal $product, $options, $post;\n\t\n\t\/*$rating_count = $product-&gt;get_rating_count();\n\t\n\tif(!empty($rating_count)) {\n\t\n\t\techo &#039;&lt;div class=&quot;review_num&quot;&gt;&#039;.sprintf( _n(&#039;%s review %s&#039;, &#039;%s reviews %s&#039;, $rating_count, &#039;woocommerce&#039;), &#039;&lt;span itemprop=&quot;ratingCount&quot; class=&quot;count&quot;&gt;&#039;. $rating_count .&#039;&lt;\/span&gt;&#039;, &#039;&#039; ).&#039;&lt;\/div&gt;&#039;;\n\t\techo &#039;&lt;div class=&quot;quick_rating&quot;&gt;&#039;;\n\t\twoocommerce_get_template( &#039;loop\/rating.php&#039; );\n\t\techo &#039;&lt;\/div&gt;&#039;;\n\t\t \n\t} *\/ ?&gt;\n\t\t\n\t\t&lt;div id=&quot;single-meta&quot; data-sharing=&quot;&lt;?php echo ( !empty($options[&#039;woo_social&#039;]) &amp;&amp; $options[&#039;woo_social&#039;] == 1 ) ? &#039;1&#039; : &#039;0&#039;; ?&gt;&quot;&gt;\n\n\t\t\t&lt;ul class=&quot;product-sharing&quot;&gt; \n\n\t\t\t\t&lt;?php\n\t\t\t\t\/\/ portfolio social sharting icons\n\t\t\t\tif( !empty($options[&#039;woo_social&#039;]) &amp;&amp; $options[&#039;woo_social&#039;] == 1 ) {\n\t\t\t\t\t\n\t\t\t\t\techo &#039;&lt;li class=&quot;meta-share-count&quot;&gt;&lt;a href=&quot;#&quot;&gt;&lt;i class=&quot;icon-default-style steadysets-icon-share&quot;&gt;&lt;\/i&gt;&lt;span class=&quot;share-count-total&quot;&gt;0&lt;\/span&gt; &lt;span class=&quot;plural&quot;&gt;&#039;. __(&#039;Shares&#039;,NECTAR_THEME_NAME) . &#039;&lt;\/span&gt; &lt;span class=&quot;singular&quot;&gt;&#039;. __(&#039;Share&#039;,NECTAR_THEME_NAME) .&#039;&lt;\/span&gt;&lt;\/a&gt; &lt;div class=&quot;nectar-social&quot;&gt;&#039;;\n\n\t\t\t\t\techo &#039;&lt;div class=&quot;nectar-social woo&quot;&gt;&#039;;\n\t\t\t\t\t\n\t\t\t\t\t\/\/facebook\n\t\t\t\t\tif(!empty($options[&#039;woo-facebook-sharing&#039;]) &amp;&amp; $options[&#039;woo-facebook-sharing&#039;] == 1) {\n\t\t\t\t\t\techo &quot;&lt;a class=&#039;facebook-share nectar-sharing&#039; href=&#039;#&#039; title=&#039;Share this&#039;&gt; &lt;i class=&#039;fa fa-facebook&#039;&gt;&lt;\/i&gt; &lt;span class=&#039;count&#039;&gt;&lt;\/span&gt;&lt;\/a&gt;&quot;;\n\t\t\t\t\t}\n\t\t\t\t\t\/\/twitter\n\t\t\t\t\tif(!empty($options[&#039;woo-twitter-sharing&#039;]) &amp;&amp; $options[&#039;woo-twitter-sharing&#039;] == 1) {\n\t\t\t\t\t\techo &quot;&lt;a class=&#039;twitter-share nectar-sharing&#039; href=&#039;#&#039; title=&#039;Tweet this&#039;&gt; &lt;i class=&#039;fa fa-twitter&#039;&gt;&lt;\/i&gt; &lt;span class=&#039;count&#039;&gt;&lt;\/span&gt;&lt;\/a&gt;&quot;;\n\t\t\t\t\t}\n\n\t\t\t\t\t\/\/google plus\n\t\t\t\t\tif(!empty($options[&#039;woo-google-plus-sharing&#039;]) &amp;&amp; $options[&#039;woo-google-plus-sharing&#039;] == 1) {\n\t\t\t\t\t\techo &quot;&lt;a class=&#039;google-plus-share nectar-sharing-alt&#039; href=&#039;#&#039; title=&#039;&quot;.__(&#039;Share this&#039;, NECTAR_THEME_NAME).&quot;&#039;&gt; &lt;i class=&#039;fa fa-google-plus&#039;&gt;&lt;\/i&gt; &lt;span class=&#039;count&#039;&gt;0&lt;\/span&gt;&lt;\/a&gt;&quot;;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\/\/linkedIn\n\t\t\t\t\tif(!empty($options[&#039;woo-linkedin-sharing&#039;]) &amp;&amp; $options[&#039;woo-linkedin-sharing&#039;] == 1) {\n\t\t\t\t\t\techo &quot;&lt;a class=&#039;linkedin-share nectar-sharing&#039; href=&#039;#&#039; title=&#039;&quot;.__(&#039;Share this&#039;, NECTAR_THEME_NAME).&quot;&#039;&gt; &lt;i class=&#039;fa fa-linkedin&#039;&gt;&lt;\/i&gt; &lt;span class=&#039;count&#039;&gt; &lt;\/span&gt;&lt;\/a&gt;&quot;;\n\t\t\t\t\t}\n\n\t\t\t\t\t\/\/pinterest\n\t\t\t\t\tif(!empty($options[&#039;woo-pinterest-sharing&#039;]) &amp;&amp; $options[&#039;woo-pinterest-sharing&#039;] == 1) {\n\t\t\t\t\t\techo &quot;&lt;a class=&#039;pinterest-share nectar-sharing&#039; href=&#039;#&#039; title=&#039;Pin this&#039;&gt; &lt;i class=&#039;fa fa-pinterest&#039;&gt;&lt;\/i&gt; &lt;span class=&#039;count&#039;&gt;&lt;\/span&gt;&lt;\/a&gt;&quot;;\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\t\t\t\t\techo &#039;&lt;\/div&gt;&lt;\/div&gt;&lt;\/li&gt;&#039;;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t?&gt; \n\t\t\t&lt;\/ul&gt;\n\t\t&lt;\/div&gt; \n&lt;?php \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n}\n\n\/\/ Image sizes\nglobal $pagenow;\nif ( is_admin() &amp;&amp; isset( $_GET[&#039;activated&#039;] ) &amp;&amp; $pagenow == &#039;themes.php&#039; ) add_action( &#039;init&#039;, &#039;nectar_woocommerce_image_dimensions&#039;, 1 );\n \n\n\/\/ Define image sizes \nfunction nectar_woocommerce_image_dimensions() {\n\t$catalog = array(\n\t\t&#039;width&#039; =&gt; &#039;375&#039;,\t\n\t\t&#039;height&#039;\t=&gt; &#039;400&#039;,\t\n\t\t&#039;crop&#039;\t=&gt; 1 \n\t);\n\t \n\t$single = array(\n\t\t&#039;width&#039; =&gt; &#039;600&#039;,\t\n\t\t&#039;height&#039;\t=&gt; &#039;630&#039;,\t\n\t\t&#039;crop&#039;\t=&gt; 1 \n\t);\n\t \n\t$thumbnail = array(\n\t\t&#039;width&#039; =&gt; &#039;130&#039;,\t\n\t\t&#039;height&#039;\t=&gt; &#039;130&#039;,\t\n\t\t&#039;crop&#039;\t=&gt; 1 \n\t);\n\t \n\t\n\tupdate_option( &#039;shop_catalog_image_size&#039;, $catalog ); \/\/ Product category thumbs\n\tupdate_option( &#039;shop_single_image_size&#039;, $single ); \/\/ Single product image\n\tupdate_option( &#039;shop_thumbnail_image_size&#039;, $thumbnail ); \/\/ Image gallery thumbs\n}\n\n\/\/ Open Graph\nif (!function_exists(&#039;add_opengraph&#039;)) {\n\tfunction add_opengraph() {\n\t\tglobal $post; \/\/ Ensures we can use post variables outside the loop\n\n\t\t\/\/ Start with some values that don&#039;t change.\n\t\techo &quot;&lt;meta property=&#039;og:site_name&#039; content=&#039;&quot;. get_bloginfo(&#039;name&#039;) .&quot;&#039;\/&gt;&quot;; \/\/ Sets the site name to the one in your WordPress settings\n\t\techo &quot;&lt;meta property=&#039;og:url&#039; content=&#039;&quot; . get_permalink() . &quot;&#039;\/&gt;&quot;; \/\/ Gets the permalink to the post\/page\n\n\t\tif (is_singular()) { \/\/ If we are on a blog post\/page\n\t        echo &quot;&lt;meta property=&#039;og:title&#039; content=&#039;&quot; . get_the_title() . &quot;&#039;\/&gt;&quot;; \/\/ Gets the page title\n\t        echo &quot;&lt;meta property=&#039;og:type&#039; content=&#039;article&#039;\/&gt;&quot;; \/\/ Sets the content type to be article.\n\t    } elseif(is_front_page() or is_home()) { \/\/ If it is the front page or home page\n\t    \techo &quot;&lt;meta property=&#039;og:title&#039; content=&#039;&quot; . get_bloginfo(&quot;name&quot;) . &quot;&#039;\/&gt;&quot;; \/\/ Get the site title\n\t    \techo &quot;&lt;meta property=&#039;og:type&#039; content=&#039;website&#039;\/&gt;&quot;; \/\/ Sets the content type to be website.\n\t    }\n\n\t\tif(has_post_thumbnail( $post-&gt;ID )) { \/\/ If the post has a featured image.\n\t\t\t$thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post-&gt;ID ), &#039;large&#039; );\n\t\t\techo &quot;&lt;meta property=&#039;og:image&#039; content=&#039;&quot; . esc_attr( $thumbnail[0] ) . &quot;&#039;\/&gt;&quot;; \/\/ If it has a featured image, then display this for Facebook\n\t\t} \n\n\t}\n}\n\n$using_jetpack_publicize = ( class_exists( &#039;Jetpack&#039; ) &amp;&amp; in_array( &#039;publicize&#039;, Jetpack::get_active_modules()) ) ? true : false;\n\nif ( !defined(&#039;WPSEO_VERSION&#039;) &amp;&amp; !class_exists(&#039;NY_OG_Admin&#039;) &amp;&amp; !class_exists(&#039;Wpsso&#039;) &amp;&amp; $using_jetpack_publicize == false) {\n\tadd_action( &#039;wp_head&#039;, &#039;add_opengraph&#039;, 5 );\n}\n\nadd_filter( &#039;wp_image_editors&#039;, &#039;change_graphic_lib&#039; );\n\nfunction change_graphic_lib($array) {\n  return array( &#039;WP_Image_Editor_GD&#039;, &#039;WP_Image_Editor_Imagick&#039; );\n}\n\n?&gt;<\/code><\/pre>\n<p><strong>wc-formatting-functions.php<\/strong><\/p>\n<pre><code>&lt;?php\n\/**\n * WooCommerce Formatting\n *\n * Functions for formatting data.\n *\n * @author \t\tWooThemes\n * @category \tCore\n * @package \tWooCommerce\/Functions\n * @version     2.1.0\n *\/\n\nif ( ! defined( &#039;ABSPATH&#039; ) ) {\n\texit; \/\/ Exit if accessed directly.\n}\n\n\/**\n * Converts a string (e.g. &#039;yes&#039; or &#039;no&#039;) to a bool.\n *\n * @since 3.0.0\n * @param string $string String to convert.\n * @return bool\n *\/\nfunction wc_string_to_bool( $string ) {\n\treturn is_bool( $string ) ? $string : ( &#039;yes&#039; === $string || 1 === $string || &#039;true&#039; === $string || &#039;1&#039; === $string );\n}\n\n\/**\n * Converts a bool to a &#039;yes&#039; or &#039;no&#039;.\n *\n * @since 3.0.0\n * @param bool $bool String to convert.\n * @return string\n *\/\nfunction wc_bool_to_string( $bool ) {\n\tif ( ! is_bool( $bool ) ) {\n\t\t$bool = wc_string_to_bool( $bool );\n\t}\n\treturn true === $bool ? &#039;yes&#039; : &#039;no&#039;;\n}\n\n\/**\n * Explode a string into an array by $delimiter and remove empty values.\n *\n * @since 3.0.0\n * @param string $string    String to convert.\n * @param string $delimiter Delimiter, defaults to &#039;,&#039;.\n * @return array\n *\/\nfunction wc_string_to_array( $string, $delimiter = &#039;,&#039; ) {\n\treturn is_array( $string ) ? $string : array_filter( explode( $delimiter, $string ) );\n}\n\n\/**\n * Sanitize taxonomy names. Slug format (no spaces, lowercase).\n * Urldecode is used to reverse munging of UTF8 characters.\n *\n * @param string $taxonomy Taxonomy name.\n * @return string\n *\/\nfunction wc_sanitize_taxonomy_name( $taxonomy ) {\n\treturn apply_filters( &#039;sanitize_taxonomy_name&#039;, urldecode( sanitize_title( urldecode( $taxonomy ) ) ), $taxonomy );\n}\n\n\/**\n * Sanitize permalink values before insertion into DB.\n *\n * Cannot use wc_clean because it sometimes strips % chars and breaks the user&#039;s setting.\n *\n * @since  2.6.0\n * @param  string $value Permalink.\n * @return string\n *\/\nfunction wc_sanitize_permalink( $value ) {\n\tglobal $wpdb;\n\n\t$value = $wpdb-&gt;strip_invalid_text_for_column( $wpdb-&gt;options, &#039;option_value&#039;, $value );\n\n\tif ( is_wp_error( $value ) ) {\n\t\t$value = &#039;&#039;;\n\t}\n\n\t$value = esc_url_raw( trim( $value ) );\n\t$value = str_replace( &#039;http:\/\/&#039;, &#039;&#039;, $value );\n\treturn untrailingslashit( $value );\n}\n\n\/**\n * Gets the filename part of a download URL.\n *\n * @param string $file_url File URL.\n * @return string\n *\/\nfunction wc_get_filename_from_url( $file_url ) {\n\t$parts = wp_parse_url( $file_url );\n\tif ( isset( $parts[&#039;path&#039;] ) ) {\n\t\treturn basename( $parts[&#039;path&#039;] );\n\t}\n}\n\n\/**\n * Normalise dimensions, unify to cm then convert to wanted unit value.\n *\n * Usage:\n * wc_get_dimension( 55, &#039;in&#039; );\n * wc_get_dimension( 55, &#039;in&#039;, &#039;m&#039; );\n *\n * @param int|float $dimension    Dimension.\n * @param string    $to_unit      Unit to convert to.\n *                                Options: &#039;in&#039;, &#039;m&#039;, &#039;cm&#039;, &#039;m&#039;.\n * @param string    $from_unit    Unit to convert from.\n *                                Defaults to &#039;&#039;.\n *                                Options: &#039;in&#039;, &#039;m&#039;, &#039;cm&#039;, &#039;m&#039;.\n * @return float\n *\/\nfunction wc_get_dimension( $dimension, $to_unit, $from_unit = &#039;&#039; ) {\n\t$to_unit = strtolower( $to_unit );\n\n\tif ( empty( $from_unit ) ) {\n\t\t$from_unit = strtolower( get_option( &#039;woocommerce_dimension_unit&#039; ) );\n\t}\n\n\t\/\/ Unify all units to cm first.\n\tif ( $from_unit !== $to_unit ) {\n\t\tswitch ( $from_unit ) {\n\t\t\tcase &#039;in&#039; :\n\t\t\t\t$dimension *= 2.54;\n\t\t\t\tbreak;\n\t\t\tcase &#039;m&#039; :\n\t\t\t\t$dimension *= 100;\n\t\t\t\tbreak;\n\t\t\tcase &#039;mm&#039; :\n\t\t\t\t$dimension *= 0.1;\n\t\t\t\tbreak;\n\t\t\tcase &#039;yd&#039; :\n\t\t\t\t$dimension *= 91.44;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t\/\/ Output desired unit.\n\t\tswitch ( $to_unit ) {\n\t\t\tcase &#039;in&#039; :\n\t\t\t\t$dimension *= 0.3937;\n\t\t\t\tbreak;\n\t\t\tcase &#039;m&#039; :\n\t\t\t\t$dimension *= 0.01;\n\t\t\t\tbreak;\n\t\t\tcase &#039;mm&#039; :\n\t\t\t\t$dimension *= 10;\n\t\t\t\tbreak;\n\t\t\tcase &#039;yd&#039; :\n\t\t\t\t$dimension *= 0.010936133;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn ( $dimension &lt; 0 ) ? 0 : $dimension;\n}\n\n\/**\n * Normalise weights, unify to kg then convert to wanted unit value.\n *\n * Usage:\n * wc_get_weight(55, &#039;kg&#039;);\n * wc_get_weight(55, &#039;kg&#039;, &#039;lbs&#039;);\n *\n * @param int|float $weight    Weight.\n * @param string    $to_unit   Unit to convert to.\n *                             Options: &#039;g&#039;, &#039;kg&#039;, &#039;lbs&#039;, &#039;oz&#039;.\n * @param string    $from_unit Unit to convert from.\n *                             Defaults to &#039;&#039;.\n *                             Options: &#039;g&#039;, &#039;kg&#039;, &#039;lbs&#039;, &#039;oz&#039;.\n * @return float\n *\/\nfunction wc_get_weight( $weight, $to_unit, $from_unit = &#039;&#039; ) {\n\t$weight  = (float) $weight;\n\t$to_unit = strtolower( $to_unit );\n\n\tif ( empty( $from_unit ) ) {\n\t\t$from_unit = strtolower( get_option( &#039;woocommerce_weight_unit&#039; ) );\n\t}\n\n\t\/\/ Unify all units to kg first.\n\tif ( $from_unit !== $to_unit ) {\n\t\tswitch ( $from_unit ) {\n\t\t\tcase &#039;g&#039; :\n\t\t\t\t$weight *= 0.001;\n\t\t\t\tbreak;\n\t\t\tcase &#039;lbs&#039; :\n\t\t\t\t$weight *= 0.453592;\n\t\t\t\tbreak;\n\t\t\tcase &#039;oz&#039; :\n\t\t\t\t$weight *= 0.0283495;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t\/\/ Output desired unit.\n\t\tswitch ( $to_unit ) {\n\t\t\tcase &#039;g&#039; :\n\t\t\t\t$weight *= 1000;\n\t\t\t\tbreak;\n\t\t\tcase &#039;lbs&#039; :\n\t\t\t\t$weight *= 2.20462;\n\t\t\t\tbreak;\n\t\t\tcase &#039;oz&#039; :\n\t\t\t\t$weight *= 35.274;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn ( $weight &lt; 0 ) ? 0 : $weight;\n}\n\n\/**\n * Trim trailing zeros off prices.\n *\n * @param string|float|int $price Price.\n * @return string\n *\/\nfunction wc_trim_zeros( $price ) {\n\treturn preg_replace( &#039;\/&#039; . preg_quote( wc_get_price_decimal_separator(), &#039;\/&#039; ) . &#039;0++$\/&#039;, &#039;&#039;, $price );\n}\n\n\/**\n * Round a tax amount.\n *\n * @param  double $value Amount to round.\n * @param  int    $precision DP to round. Defaults to wc_get_price_decimals.\n * @return float\n *\/\nfunction wc_round_tax_total( $value, $precision = null ) {\n\t$precision = is_null( $precision ) ? wc_get_price_decimals() : intval( $precision );\n\n\tif ( version_compare( PHP_VERSION, &#039;5.3.0&#039;, &#039;&gt;=&#039; ) ) {\n\t\t$rounded_tax = round( $value, $precision, wc_get_tax_rounding_mode() );\n\t} elseif ( 2 === wc_get_tax_rounding_mode() ) {\n\t\t$rounded_tax = wc_legacy_round_half_down( $value, $precision );\n\t} else {\n\t\t$rounded_tax = round( $value, $precision );\n\t}\n\n\treturn apply_filters( &#039;wc_round_tax_total&#039;, $rounded_tax, $value, $precision, WC_TAX_ROUNDING_MODE );\n}\n\n\/**\n * Round half down in PHP 5.2.\n *\n * @since 3.2.6\n * @param float $value Value to round.\n * @param int   $precision Precision to round down to.\n * @return float\n *\/\nfunction wc_legacy_round_half_down( $value, $precision ) {\n\t$value = wc_float_to_string( $value );\n\n\tif ( false !== strstr( $value, &#039;.&#039; ) ) {\n\t\t$value = explode( &#039;.&#039;, $value );\n\n\t\tif ( strlen( $value[1] ) &gt; $precision &amp;&amp; substr( $value[1], -1 ) === &#039;5&#039; ) {\n\t\t\t$value[1] = substr( $value[1], 0, -1 ) . &#039;4&#039;;\n\t\t}\n\n\t\t$value = implode( &#039;.&#039;, $value );\n\t}\n\n\treturn round( floatval( $value ), $precision );\n}\n\n\/**\n * Make a refund total negative.\n *\n * @param float $amount Refunded amount.\n *\n * @return float\n *\/\nfunction wc_format_refund_total( $amount ) {\n\treturn $amount * -1;\n}\n\n\/**\n * Format decimal numbers ready for DB storage.\n *\n * Sanitize, remove decimals, and optionally round + trim off zeros.\n *\n * This function does not remove thousands - this should be done before passing a value to the function.\n *\n * @param  float|string $number     Expects either a float or a string with a decimal separator only (no thousands).\n * @param  mixed        $dp number  Number of decimal points to use, blank to use woocommerce_price_num_decimals, or false to avoid all rounding.\n * @param  bool         $trim_zeros From end of string.\n * @return string\n *\/\nfunction wc_format_decimal( $number, $dp = false, $trim_zeros = false ) {\n\t$locale   = localeconv();\n\t$decimals = array( wc_get_price_decimal_separator(), $locale[&#039;decimal_point&#039;], $locale[&#039;mon_decimal_point&#039;] );\n\n\t\/\/ Remove locale from string.\n\tif ( ! is_float( $number ) ) {\n\t\t$number = str_replace( $decimals, &#039;.&#039;, $number );\n\t\t$number = preg_replace( &#039;\/[^0-9\\.,-]\/&#039;, &#039;&#039;, wc_clean( $number ) );\n\t}\n\n\tif ( false !== $dp ) {\n\t\t$dp     = intval( &#039;&#039; === $dp ? wc_get_price_decimals() : $dp );\n\t\t$number = number_format( floatval( $number ), $dp, &#039;.&#039;, &#039;&#039; );\n\t} elseif ( is_float( $number ) ) {\n\t\t\/\/ DP is false - don&#039;t use number format, just return a string using whatever is given. Remove scientific notation using sprintf.\n\t\t$number     = str_replace( $decimals, &#039;.&#039;, sprintf( &#039;%.&#039; . wc_get_rounding_precision() . &#039;f&#039;, $number ) );\n\t\t\/\/ We already had a float, so trailing zeros are not needed.\n\t\t$trim_zeros = true;\n\t}\n\n\tif ( $trim_zeros &amp;&amp; strstr( $number, &#039;.&#039; ) ) {\n\t\t$number = rtrim( rtrim( $number, &#039;0&#039; ), &#039;.&#039; );\n\t}\n\n\treturn $number;\n}\n\n\/**\n * Convert a float to a string without locale formatting which PHP adds when changing floats to strings.\n *\n * @param  float $float Float value to format.\n * @return string\n *\/\nfunction wc_float_to_string( $float ) {\n\tif ( ! is_float( $float ) ) {\n\t\treturn $float;\n\t}\n\n\t$locale = localeconv();\n\t$string = strval( $float );\n\t$string = str_replace( $locale[&#039;decimal_point&#039;], &#039;.&#039;, $string );\n\n\treturn $string;\n}\n\n\/**\n * Format a price with WC Currency Locale settings.\n *\n * @param  string $value Price to localize.\n * @return string\n *\/\nfunction wc_format_localized_price( $value ) {\n\treturn apply_filters( &#039;woocommerce_format_localized_price&#039;, str_replace( &#039;.&#039;, wc_get_price_decimal_separator(), strval( $value ) ), $value );\n}\n\n\/**\n * Format a decimal with PHP Locale settings.\n *\n * @param  string $value Decimal to localize.\n * @return string\n *\/\nfunction wc_format_localized_decimal( $value ) {\n\t$locale = localeconv();\n\treturn apply_filters( &#039;woocommerce_format_localized_decimal&#039;, str_replace( &#039;.&#039;, $locale[&#039;decimal_point&#039;], strval( $value ) ), $value );\n}\n\n\/**\n * Format a coupon code.\n *\n * @since  3.0.0\n * @param  string $value Coupon code to format.\n * @return string\n *\/\nfunction wc_format_coupon_code( $value ) {\n\treturn apply_filters( &#039;woocommerce_coupon_code&#039;, $value );\n}\n\n\/**\n * Clean variables using sanitize_text_field. Arrays are cleaned recursively.\n * Non-scalar values are ignored.\n *\n * @param string|array $var Data to sanitize.\n * @return string|array\n *\/\nfunction wc_clean( $var ) {\n\tif ( is_array( $var ) ) {\n\t\treturn array_map( &#039;wc_clean&#039;, $var );\n\t} else {\n\t\treturn is_scalar( $var ) ? sanitize_text_field( $var ) : $var;\n\t}\n}\n\n\/**\n * Run wc_clean over posted textarea but maintain line breaks.\n *\n * @since  3.0.0\n * @param  string $var Data to sanitize.\n * @return string\n *\/\nfunction wc_sanitize_textarea( $var ) {\n\treturn implode( &quot;\\n&quot;, array_map( &#039;wc_clean&#039;, explode( &quot;\\n&quot;, $var ) ) );\n}\n\n\/**\n * Sanitize a string destined to be a tooltip.\n *\n * @since  2.3.10 Tooltips are encoded with htmlspecialchars to prevent XSS. Should not be used in conjunction with esc_attr()\n * @param  string $var Data to sanitize.\n * @return string\n *\/\nfunction wc_sanitize_tooltip( $var ) {\n\treturn htmlspecialchars( wp_kses( html_entity_decode( $var ), array(\n\t\t&#039;br&#039;     =&gt; array(),\n\t\t&#039;em&#039;     =&gt; array(),\n\t\t&#039;strong&#039; =&gt; array(),\n\t\t&#039;small&#039;  =&gt; array(),\n\t\t&#039;span&#039;   =&gt; array(),\n\t\t&#039;ul&#039;     =&gt; array(),\n\t\t&#039;li&#039;     =&gt; array(),\n\t\t&#039;ol&#039;     =&gt; array(),\n\t\t&#039;p&#039;      =&gt; array(),\n\t) ) );\n}\n\n\/**\n * Merge two arrays.\n *\n * @param array $a1 First array to merge.\n * @param array $a2 Second array to merge.\n * @return array\n *\/\nfunction wc_array_overlay( $a1, $a2 ) {\n\tforeach ( $a1 as $k =&gt; $v ) {\n\t\tif ( ! array_key_exists( $k, $a2 ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\tif ( is_array( $v ) &amp;&amp; is_array( $a2[ $k ] ) ) {\n\t\t\t$a1[ $k ] = wc_array_overlay( $v, $a2[ $k ] );\n\t\t} else {\n\t\t\t$a1[ $k ] = $a2[ $k ];\n\t\t}\n\t}\n\treturn $a1;\n}\n\n\/**\n * Formats a stock amount by running it through a filter.\n *\n * @param  int|float $amount Stock amount.\n * @return int|float\n *\/\nfunction wc_stock_amount( $amount ) {\n\treturn apply_filters( &#039;woocommerce_stock_amount&#039;, $amount );\n}\n\n\/**\n * Get the price format depending on the currency position.\n *\n * @return string\n *\/\nfunction get_woocommerce_price_format() {\n\t$currency_pos = get_option( &#039;woocommerce_currency_pos&#039; );\n\t$format = &#039;%1$s%2$s&#039;;\n\n\tswitch ( $currency_pos ) {\n\t\tcase &#039;left&#039; :\n\t\t\t$format = &#039;%1$s%2$s&#039;;\n\t\tbreak;\n\t\tcase &#039;right&#039; :\n\t\t\t$format = &#039;%2$s%1$s&#039;;\n\t\tbreak;\n\t\tcase &#039;left_space&#039; :\n\t\t\t$format = &#039;%1$s&amp;nbsp;%2$s&#039;;\n\t\tbreak;\n\t\tcase &#039;right_space&#039; :\n\t\t\t$format = &#039;%2$s&amp;nbsp;%1$s&#039;;\n\t\tbreak;\n\t}\n\n\treturn apply_filters( &#039;woocommerce_price_format&#039;, $format, $currency_pos );\n}\n\n\/**\n * Return the thousand separator for prices.\n *\n * @since  2.3\n * @return string\n *\/\nfunction wc_get_price_thousand_separator() {\n\treturn stripslashes( apply_filters( &#039;wc_get_price_thousand_separator&#039;, get_option( &#039;woocommerce_price_thousand_sep&#039; ) ) );\n}\n\n\/**\n * Return the decimal separator for prices.\n *\n * @since  2.3\n * @return string\n *\/\nfunction wc_get_price_decimal_separator() {\n\t$separator = apply_filters( &#039;wc_get_price_decimal_separator&#039;, get_option( &#039;woocommerce_price_decimal_sep&#039; ) );\n\treturn $separator ? stripslashes( $separator ) : &#039;.&#039;;\n}\n\n\/**\n * Return the number of decimals after the decimal point.\n *\n * @since  2.3\n * @return int\n *\/\nfunction wc_get_price_decimals() {\n\treturn absint( apply_filters( &#039;wc_get_price_decimals&#039;, get_option( &#039;woocommerce_price_num_decimals&#039;, 2 ) ) );\n}\n\n\/**\n * Format the price with a currency symbol.\n *\n * @param  float $price Raw price.\n * @param  array $args  Arguments to format a price {\n *     Array of arguments.\n *     Defaults to empty array.\n *\n *     @type bool   $ex_tax_label       Adds exclude tax label.\n *                                      Defaults to false.\n *     @type string $currency           Currency code.\n *                                      Defaults to empty string (Use the result from get_woocommerce_currency()).\n *     @type string $decimal_separator  Decimal separator.\n *                                      Defaults the result of wc_get_price_decimal_separator().\n *     @type string $thousand_separator Thousand separator.\n *                                      Defaults the result of wc_get_price_thousand_separator().\n *     @type string $decimals           Number of decimals.\n *                                      Defaults the result of wc_get_price_decimals().\n *     @type string $price_format       Price format depending on the currency position.\n *                                      Defaults the result of get_woocommerce_price_format().\n * }\n * @return string\n *\/\nfunction wc_price( $price, $args = array() ) {\n\textract( apply_filters( &#039;wc_price_args&#039;, wp_parse_args( $args, array(\n\t\t&#039;ex_tax_label&#039;       =&gt; false,\n\t\t&#039;currency&#039;           =&gt; &#039;&#039;,\n\t\t&#039;decimal_separator&#039;  =&gt; wc_get_price_decimal_separator(),\n\t\t&#039;thousand_separator&#039; =&gt; wc_get_price_thousand_separator(),\n\t\t&#039;decimals&#039;           =&gt; wc_get_price_decimals(),\n\t\t&#039;price_format&#039;       =&gt; get_woocommerce_price_format(),\n\t) ) ) );\n\n\t$unformatted_price = $price;\n\t$negative          = $price &lt; 0;\n\t$price             = apply_filters( &#039;raw_woocommerce_price&#039;, floatval( $negative ? $price * -10 : $price ) );\n\t$price             = apply_filters( &#039;formatted_woocommerce_price&#039;, number_format( $price, $decimals, $decimal_separator, $thousand_separator ), $price, $decimals, $decimal_separator, $thousand_separator );\n\n\tif ( apply_filters( &#039;woocommerce_price_trim_zeros&#039;, false ) &amp;&amp; $decimals &gt; 0 ) {\n\t\t$price = wc_trim_zeros( $price );\n\t}\n\n$formatted_price = ( $negative ? &#039;-&#039; : &#039;&#039; ) . sprintf( $price_format, &#039;&lt;span class=&quot;woocommerce-Price-currencySymbol&quot;&gt;&#039; . get_woocommerce_currency_symbol( $currency ) . &#039;&lt;\/span&gt;&#039;, $price);\n\t\n\t$return          = &#039;&lt;span class=&quot;woocommerce-Price-amount amount&quot;&gt;&#039; . $formatted_price . &#039;&lt;\/span&gt;&#039;;\n\n\tif ( $ex_tax_label &amp;&amp; wc_tax_enabled() ) {\n\t\t$return .= &#039; &lt;small class=&quot;woocommerce-Price-taxLabel tax_label&quot;&gt;&#039; . WC()-&gt;countries-&gt;ex_tax_or_vat() . &#039;&lt;\/small&gt;&#039;;\n\t}\n\n\t\/**\n\t * Filters the string of price markup.\n\t *\n\t * @param string $return \t\t\tPrice HTML markup.\n\t * @param string $price\t            Formatted price.\n\t * @param array  $args     \t\t\tPass on the args.\n\t * @param float  $unformatted_price\tPrice as float to allow plugins custom formatting. Since 3.2.0.\n\t *\/\n\treturn apply_filters( &#039;wc_price&#039;, $return, $price, $args, $unformatted_price );\n}\n\n\/**\n * Notation to numbers.\n *\n * This function transforms the php.ini notation for numbers (like &#039;2M&#039;) to an integer.\n *\n * @param  string $size Size value.\n * @return int\n *\/\nfunction wc_let_to_num( $size ) {\n\t$l   = substr( $size, -1 );\n\t$ret = substr( $size, 0, -1 );\n\tswitch ( strtoupper( $l ) ) {\n\t\tcase &#039;P&#039;:\n\t\t\t$ret *= 1024;\n\t\tcase &#039;T&#039;:\n\t\t\t$ret *= 1024;\n\t\tcase &#039;G&#039;:\n\t\t\t$ret *= 1024;\n\t\tcase &#039;M&#039;:\n\t\t\t$ret *= 1024;\n\t\tcase &#039;K&#039;:\n\t\t\t$ret *= 1024;\n\t}\n\treturn $ret;\n}\n\n\/**\n * WooCommerce Date Format - Allows to change date format for everything WooCommerce.\n *\n * @return string\n *\/\nfunction wc_date_format() {\n\treturn apply_filters( &#039;woocommerce_date_format&#039;, get_option( &#039;date_format&#039; ) );\n}\n\n\/**\n * WooCommerce Time Format - Allows to change time format for everything WooCommerce.\n *\n * @return string\n *\/\nfunction wc_time_format() {\n\treturn apply_filters( &#039;woocommerce_time_format&#039;, get_option( &#039;time_format&#039; ) );\n}\n\n\/**\n * Convert mysql datetime to PHP timestamp, forcing UTC. Wrapper for strtotime.\n *\n * Based on wcs_strtotime_dark_knight() from WC Subscriptions by Prospress.\n *\n * @since  3.0.0\n * @param  string   $time_string    Time string.\n * @param  int|null $from_timestamp Timestamp to convert from.\n * @return int\n *\/\nfunction wc_string_to_timestamp( $time_string, $from_timestamp = null ) {\n\t$original_timezone = date_default_timezone_get();\n\n\t\/\/ @codingStandardsIgnoreStart\n\tdate_default_timezone_set( &#039;UTC&#039; );\n\n\tif ( null === $from_timestamp ) {\n\t\t$next_timestamp = strtotime( $time_string );\n\t} else {\n\t\t$next_timestamp = strtotime( $time_string, $from_timestamp );\n\t}\n\n\tdate_default_timezone_set( $original_timezone );\n\t\/\/ @codingStandardsIgnoreEnd\n\n\treturn $next_timestamp;\n}\n\n\/**\n * Convert a date string to a WC_DateTime.\n *\n * @since  3.1.0\n * @param  string $time_string Time string.\n * @return WC_DateTime\n *\/\nfunction wc_string_to_datetime( $time_string ) {\n\t\/\/ Strings are defined in local WP timezone. Convert to UTC.\n\tif ( 1 === preg_match( &#039;\/^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(Z|((-|\\+)\\d{2}:\\d{2}))$\/&#039;, $time_string, $date_bits ) ) {\n\t\t$offset    = ! empty( $date_bits[7] ) ? iso8601_timezone_to_offset( $date_bits[7] ) : wc_timezone_offset();\n\t\t$timestamp = gmmktime( $date_bits[4], $date_bits[5], $date_bits[6], $date_bits[2], $date_bits[3], $date_bits[1] ) - $offset;\n\t} else {\n\t\t$timestamp = wc_string_to_timestamp( get_gmt_from_date( gmdate( &#039;Y-m-d H:i:s&#039;, wc_string_to_timestamp( $time_string ) ) ) );\n\t}\n\t$datetime  = new WC_DateTime( &quot;@{$timestamp}&quot;, new DateTimeZone( &#039;UTC&#039; ) );\n\n\t\/\/ Set local timezone or offset.\n\tif ( get_option( &#039;timezone_string&#039; ) ) {\n\t\t$datetime-&gt;setTimezone( new DateTimeZone( wc_timezone_string() ) );\n\t} else {\n\t\t$datetime-&gt;set_utc_offset( wc_timezone_offset() );\n\t}\n\n\treturn $datetime;\n}\n\n\/**\n * WooCommerce Timezone - helper to retrieve the timezone string for a site until.\n * a WP core method exists (see https:\/\/core.trac.wordpress.org\/ticket\/24730).\n *\n * Adapted from https:\/\/secure.php.net\/manual\/en\/function.timezone-name-from-abbr.php#89155.\n *\n * @since 2.1\n * @return string PHP timezone string for the site\n *\/\nfunction wc_timezone_string() {\n\t\/\/ If site timezone string exists, return it.\n\tif ( $timezone = get_option( &#039;timezone_string&#039; ) ) {\n\t\treturn $timezone;\n\t}\n\n\t\/\/ Get UTC offset, if it isn&#039;t set then return UTC.\n\tif ( 0 === ( $utc_offset = intval( get_option( &#039;gmt_offset&#039;, 0 ) ) ) ) {\n\t\treturn &#039;UTC&#039;;\n\t}\n\n\t\/\/ Adjust UTC offset from hours to seconds.\n\t$utc_offset *= 3600;\n\n\t\/\/ Attempt to guess the timezone string from the UTC offset.\n\tif ( $timezone = timezone_name_from_abbr( &#039;&#039;, $utc_offset ) ) {\n\t\treturn $timezone;\n\t}\n\n\t\/\/ Last try, guess timezone string manually.\n\tforeach ( timezone_abbreviations_list() as $abbr ) {\n\t\tforeach ( $abbr as $city ) {\n\t\t\tif ( (bool) date( &#039;I&#039; ) === (bool) $city[&#039;dst&#039;] &amp;&amp; $city[&#039;timezone_id&#039;] &amp;&amp; intval( $city[&#039;offset&#039;] ) === $utc_offset ) {\n\t\t\t\treturn $city[&#039;timezone_id&#039;];\n\t\t\t}\n\t\t}\n\t}\n\n\t\/\/ Fallback to UTC.\n\treturn &#039;UTC&#039;;\n}\n\n\/**\n * Get timezone offset in seconds.\n *\n * @since  3.0.0\n * @return float\n *\/\nfunction wc_timezone_offset() {\n\tif ( $timezone = get_option( &#039;timezone_string&#039; ) ) {\n\t\t$timezone_object = new DateTimeZone( $timezone );\n\t\treturn $timezone_object-&gt;getOffset( new DateTime( &#039;now&#039; ) );\n\t} else {\n\t\treturn floatval( get_option( &#039;gmt_offset&#039;, 0 ) ) * HOUR_IN_SECONDS;\n\t}\n}\n\n\/**\n * Callback which can flatten post meta (gets the first value if it&#039;s an array).\n *\n * @since  3.0.0\n * @param  array $value Value to flatten.\n * @return mixed\n *\/\nfunction wc_flatten_meta_callback( $value ) {\n\treturn is_array( $value ) ? current( $value ) : $value;\n}\n\nif ( ! function_exists( &#039;wc_rgb_from_hex&#039; ) ) {\n\n\t\/**\n\t * Convert RGB to HEX.\n\t *\n\t * @param mixed $color Color.\n\t *\n\t * @return array\n\t *\/\n\tfunction wc_rgb_from_hex( $color ) {\n\t\t$color = str_replace( &#039;#&#039;, &#039;&#039;, $color );\n\t\t\/\/ Convert shorthand colors to full format, e.g. &quot;FFF&quot; -&gt; &quot;FFFFFF&quot;.\n\t\t$color = preg_replace( &#039;~^(.)(.)(.)$~&#039;, &#039;$1$1$2$2$3$3&#039;, $color );\n\n\t\t$rgb      = array();\n\t\t$rgb[&#039;R&#039;] = hexdec( $color{0} . $color{1} );\n\t\t$rgb[&#039;G&#039;] = hexdec( $color{2} . $color{3} );\n\t\t$rgb[&#039;B&#039;] = hexdec( $color{4} . $color{5} );\n\n\t\treturn $rgb;\n\t}\n}\n\nif ( ! function_exists( &#039;wc_hex_darker&#039; ) ) {\n\n\t\/**\n\t * Make HEX color darker.\n\t *\n\t * @param mixed $color  Color.\n\t * @param int   $factor Darker factor.\n\t *                      Defaults to 30.\n\t * @return string\n\t *\/\n\tfunction wc_hex_darker( $color, $factor = 30 ) {\n\t\t$base  = wc_rgb_from_hex( $color );\n\t\t$color = &#039;#&#039;;\n\n\t\tforeach ( $base as $k =&gt; $v ) {\n\t\t\t$amount      = $v \/ 100;\n\t\t\t$amount      = round( $amount * $factor );\n\t\t\t$new_decimal = $v - $amount;\n\n\t\t\t$new_hex_component = dechex( $new_decimal );\n\t\t\tif ( strlen( $new_hex_component ) &lt; 2 ) {\n\t\t\t\t$new_hex_component = &#039;0&#039; . $new_hex_component;\n\t\t\t}\n\t\t\t$color .= $new_hex_component;\n\t\t}\n\n\t\treturn $color;\n\t}\n}\n\nif ( ! function_exists( &#039;wc_hex_lighter&#039; ) ) {\n\n\t\/**\n\t * Make HEX color lighter.\n\t *\n\t * @param mixed $color  Color.\n\t * @param int   $factor Lighter factor.\n\t *                      Defaults to 30.\n\t * @return string\n\t *\/\n\tfunction wc_hex_lighter( $color, $factor = 30 ) {\n\t\t$base  = wc_rgb_from_hex( $color );\n\t\t$color = &#039;#&#039;;\n\n\t\tforeach ( $base as $k =&gt; $v ) {\n\t\t\t$amount      = 255 - $v;\n\t\t\t$amount      = $amount \/ 100;\n\t\t\t$amount      = round( $amount * $factor );\n\t\t\t$new_decimal = $v + $amount;\n\n\t\t\t$new_hex_component = dechex( $new_decimal );\n\t\t\tif ( strlen( $new_hex_component ) &lt; 2 ) {\n\t\t\t\t$new_hex_component = &#039;0&#039; . $new_hex_component;\n\t\t\t}\n\t\t\t$color .= $new_hex_component;\n\t\t}\n\n\t\treturn $color;\n\t}\n}\n\nif ( ! function_exists( &#039;wc_is_light&#039; ) ) {\n\n\t\/**\n\t * Determine whether a hex color is light.\n\t *\n\t * @param mixed  $color Color.\n\t * @return bool  True if a light color.\n\t *\/\n\tfunction wc_hex_is_light( $color ) {\n\t\t$hex = str_replace( &#039;#&#039;, &#039;&#039;, $color );\n\n\t\t$c_r = hexdec( substr( $hex, 0, 2 ) );\n\t\t$c_g = hexdec( substr( $hex, 2, 2 ) );\n\t\t$c_b = hexdec( substr( $hex, 4, 2 ) );\n\n\t\t$brightness = ( ( $c_r * 299 ) + ( $c_g * 587 ) + ( $c_b * 114 ) ) \/ 1000;\n\n\t\treturn $brightness &gt; 155;\n\t}\n}\n\nif ( ! function_exists( &#039;wc_light_or_dark&#039; ) ) {\n\n\t\/**\n\t * Detect if we should use a light or dark color on a background color.\n\t *\n\t * @param mixed  $color Color.\n\t * @param string $dark  Darkest reference.\n\t *                      Defaults to &#039;#000000&#039;.\n\t * @param string $light Lightest reference.\n\t *                      Defaults to &#039;#FFFFFF&#039;.\n\t * @return string\n\t *\/\n\tfunction wc_light_or_dark( $color, $dark = &#039;#000000&#039;, $light = &#039;#FFFFFF&#039; ) {\n\t\treturn wc_hex_is_light( $color ) ? $dark : $light;\n\t}\n}\n\nif ( ! function_exists( &#039;wc_format_hex&#039; ) ) {\n\n\t\/**\n\t * Format string as hex.\n\t *\n\t * @param string $hex HEX color.\n\t * @return string|null\n\t *\/\n\tfunction wc_format_hex( $hex ) {\n\t\t$hex = trim( str_replace( &#039;#&#039;, &#039;&#039;, $hex ) );\n\n\t\tif ( strlen( $hex ) === 3 ) {\n\t\t\t$hex = $hex[0] . $hex[0] . $hex[1] . $hex[1] . $hex[2] . $hex[2];\n\t\t}\n\n\t\treturn $hex ? &#039;#&#039; . $hex : null;\n\t}\n}\n\n\/**\n * Format the postcode according to the country and length of the postcode.\n *\n * @param string $postcode Unformatted postcode.\n * @param string $country  Base country.\n * @return string\n *\/\nfunction wc_format_postcode( $postcode, $country ) {\n\t$postcode = wc_normalize_postcode( $postcode );\n\n\tswitch ( $country ) {\n\t\tcase &#039;CA&#039; :\n\t\tcase &#039;GB&#039; :\n\t\t\t$postcode = trim( substr_replace( $postcode, &#039; &#039;, -3, 0 ) );\n\t\t\tbreak;\n\t\tcase &#039;BR&#039; :\n\t\tcase &#039;PL&#039; :\n\t\t\t$postcode = substr_replace( $postcode, &#039;-&#039;, -3, 0 );\n\t\t\tbreak;\n\t\tcase &#039;JP&#039; :\n\t\t\t$postcode = substr_replace( $postcode, &#039;-&#039;, 3, 0 );\n\t\t\tbreak;\n\t\tcase &#039;PT&#039; :\n\t\t\t$postcode = substr_replace( $postcode, &#039;-&#039;, 4, 0 );\n\t\t\tbreak;\n\t\tcase &#039;US&#039; :\n\t\t\t$postcode = rtrim( substr_replace( $postcode, &#039;-&#039;, 5, 0 ), &#039;-&#039; );\n\t\t\tbreak;\n\t}\n\n\treturn apply_filters( &#039;woocommerce_format_postcode&#039;, $postcode, $country );\n}\n\n\/**\n * Normalize postcodes.\n *\n * Remove spaces and convert characters to uppercase.\n *\n * @since 2.6.0\n * @param string $postcode Postcode.\n * @return string\n *\/\nfunction wc_normalize_postcode( $postcode ) {\n\treturn preg_replace( &#039;\/[\\s\\-]\/&#039;, &#039;&#039;, trim( wc_strtoupper( $postcode ) ) );\n}\n\n\/**\n * Format phone numbers.\n *\n * @param string $phone Phone number.\n * @return string\n *\/\nfunction wc_format_phone_number( $phone ) {\n\treturn str_replace( &#039;.&#039;, &#039;-&#039;, $phone );\n}\n\n\/**\n * Wrapper for mb_strtoupper which see&#039;s if supported first.\n *\n * @since  3.1.0\n * @param  string $string String to format.\n * @return string\n *\/\nfunction wc_strtoupper( $string ) {\n\treturn function_exists( &#039;mb_strtoupper&#039; ) ? mb_strtoupper( $string ) : strtoupper( $string );\n}\n\n\/**\n * Make a string lowercase.\n * Try to use mb_strtolower() when available.\n *\n * @since  2.3\n * @param  string $string String to format.\n * @return string\n *\/\nfunction wc_strtolower( $string ) {\n\treturn function_exists( &#039;mb_strtolower&#039; ) ? mb_strtolower( $string ) : strtolower( $string );\n}\n\n\/**\n * Trim a string and append a suffix.\n *\n * @param  string  $string String to trim.\n * @param  integer $chars  Amount of characters.\n *                         Defaults to 200.\n * @param  string  $suffix Suffix.\n *                         Defaults to &#039;...&#039;.\n * @return string\n *\/\nfunction wc_trim_string( $string, $chars = 200, $suffix = &#039;...&#039; ) {\n\tif ( strlen( $string ) &gt; $chars ) {\n\t\tif ( function_exists( &#039;mb_substr&#039; ) ) {\n\t\t\t$string = mb_substr( $string, 0, ( $chars - mb_strlen( $suffix ) ) ) . $suffix;\n\t\t} else {\n\t\t\t$string = substr( $string, 0, ( $chars - strlen( $suffix ) ) ) . $suffix;\n\t\t}\n\t}\n\treturn $string;\n}\n\n\/**\n * Format content to display shortcodes.\n *\n * @since  2.3.0\n * @param  string $raw_string Raw string.\n * @return string\n *\/\nfunction wc_format_content( $raw_string ) {\n\treturn apply_filters( &#039;woocommerce_format_content&#039;, apply_filters( &#039;woocommerce_short_description&#039;, $raw_string ), $raw_string );\n}\n\n\/**\n * Format product short description.\n * Adds support for Jetpack Markdown.\n *\n * @codeCoverageIgnore\n * @since  2.4.0\n * @param  string $content Product short description.\n * @return string\n *\/\nfunction wc_format_product_short_description( $content ) {\n\t\/\/ Add support for Jetpack Markdown.\n\tif ( class_exists( &#039;WPCom_Markdown&#039; ) ) {\n\t\t$markdown = WPCom_Markdown::get_instance();\n\n\t\treturn wpautop( $markdown-&gt;transform( $content, array(\n\t\t\t&#039;unslash&#039; =&gt; false,\n\t\t) ) );\n\t}\n\n\treturn $content;\n}\n\n\/**\n * Formats curency symbols when saved in settings.\n *\n * @codeCoverageIgnore\n * @param  string $value     Option value.\n * @param  array  $option    Option name.\n * @param  string $raw_value Raw value.\n * @return string\n *\/\nfunction wc_format_option_price_separators( $value, $option, $raw_value ) {\n\treturn wp_kses_post( $raw_value );\n}\nadd_filter( &#039;woocommerce_admin_settings_sanitize_option_woocommerce_price_decimal_sep&#039;, &#039;wc_format_option_price_separators&#039;, 10, 3 );\nadd_filter( &#039;woocommerce_admin_settings_sanitize_option_woocommerce_price_thousand_sep&#039;, &#039;wc_format_option_price_separators&#039;, 10, 3 );\n\n\/**\n * Formats decimals when saved in settings.\n *\n * @codeCoverageIgnore\n * @param  string $value     Option value.\n * @param  array  $option    Option name.\n * @param  string $raw_value Raw value.\n * @return string\n *\/\nfunction wc_format_option_price_num_decimals( $value, $option, $raw_value ) {\n\treturn is_null( $raw_value ) ? 2 : absint( $raw_value );\n}\nadd_filter( &#039;woocommerce_admin_settings_sanitize_option_woocommerce_price_num_decimals&#039;, &#039;wc_format_option_price_num_decimals&#039;, 10, 3 );\n\n\/**\n * Formats hold stock option and sets cron event up.\n *\n * @codeCoverageIgnore\n * @param  string $value     Option value.\n * @param  array  $option    Option name.\n * @param  string $raw_value Raw value.\n * @return string\n *\/\nfunction wc_format_option_hold_stock_minutes( $value, $option, $raw_value ) {\n\t$value = ! empty( $raw_value ) ? absint( $raw_value ) : &#039;&#039;; \/\/ Allow &gt; 0 or set to &#039;&#039;.\n\n\twp_clear_scheduled_hook( &#039;woocommerce_cancel_unpaid_orders&#039; );\n\n\tif ( &#039;&#039; !== $value ) {\n\t\twp_schedule_single_event( time() + ( absint( $value ) * 60 ), &#039;woocommerce_cancel_unpaid_orders&#039; );\n\t}\n\n\treturn $value;\n}\nadd_filter( &#039;woocommerce_admin_settings_sanitize_option_woocommerce_hold_stock_minutes&#039;, &#039;wc_format_option_hold_stock_minutes&#039;, 10, 3 );\n\n\/**\n * Sanitize terms from an attribute text based.\n *\n * @since  2.4.5\n * @param  string $term Term value.\n * @return string\n *\/\nfunction wc_sanitize_term_text_based( $term ) {\n\treturn trim( wp_unslash( strip_tags( $term ) ) );\n}\n\nif ( ! function_exists( &#039;wc_make_numeric_postcode&#039; ) ) {\n\t\/**\n\t * Make numeric postcode.\n\t *\n\t * Converts letters to numbers so we can do a simple range check on postcodes.\n\t * E.g. PE30 becomes 16050300 (P = 16, E = 05, 3 = 03, 0 = 00)\n\t *\n\t * @since 2.6.0\n\t * @param string $postcode Regular postcode.\n\t * @return string\n\t *\/\n\tfunction wc_make_numeric_postcode( $postcode ) {\n\t\t$postcode           = str_replace( array( &#039; &#039;, &#039;-&#039; ), &#039;&#039;, $postcode );\n\t\t$postcode_length    = strlen( $postcode );\n\t\t$letters_to_numbers = array_merge( array( 0 ), range( &#039;A&#039;, &#039;Z&#039; ) );\n\t\t$letters_to_numbers = array_flip( $letters_to_numbers );\n\t\t$numeric_postcode   = &#039;&#039;;\n\n\t\tfor ( $i = 0; $i &lt; $postcode_length; $i ++ ) {\n\t\t\tif ( is_numeric( $postcode[ $i ] ) ) {\n\t\t\t\t$numeric_postcode .= str_pad( $postcode[ $i ], 2, &#039;0&#039;, STR_PAD_LEFT );\n\t\t\t} elseif ( isset( $letters_to_numbers[ $postcode[ $i ] ] ) ) {\n\t\t\t\t$numeric_postcode .= str_pad( $letters_to_numbers[ $postcode[ $i ] ], 2, &#039;0&#039;, STR_PAD_LEFT );\n\t\t\t} else {\n\t\t\t\t$numeric_postcode .= &#039;00&#039;;\n\t\t\t}\n\t\t}\n\n\t\treturn $numeric_postcode;\n\t}\n}\n\n\/**\n * Format the stock amount ready for display based on settings.\n *\n * @since  3.0.0\n * @param  WC_Product $product Product object for which the stock you need to format.\n * @return string\n *\/\nfunction wc_format_stock_for_display( $product ) {\n\t$display      = __( &#039;In stock&#039;, &#039;woocommerce&#039; );\n\t$stock_amount = $product-&gt;get_stock_quantity();\n\n\tswitch ( get_option( &#039;woocommerce_stock_format&#039; ) ) {\n\t\tcase &#039;low_amount&#039; :\n\t\t\tif ( $stock_amount &lt;= get_option( &#039;woocommerce_notify_low_stock_amount&#039; ) ) {\n\t\t\t\t\/* translators: %s: stock amount *\/\n\t\t\t\t$display = sprintf( __( &#039;Only %s left in stock&#039;, &#039;woocommerce&#039; ), wc_format_stock_quantity_for_display( $stock_amount, $product ) );\n\t\t\t}\n\t\tbreak;\n\t\tcase &#039;&#039; :\n\t\t\t\/* translators: %s: stock amount *\/\n\t\t\t$display = sprintf( __( &#039;%s in stock&#039;, &#039;woocommerce&#039; ), wc_format_stock_quantity_for_display( $stock_amount, $product ) );\n\t\tbreak;\n\t}\n\n\tif ( $product-&gt;backorders_allowed() &amp;&amp; $product-&gt;backorders_require_notification() ) {\n\t\t$display .= &#039; &#039; . __( &#039;(can be backordered)&#039;, &#039;woocommerce&#039; );\n\t}\n\n\treturn $display;\n}\n\n\/**\n * Format the stock quantity ready for display.\n *\n * @since  3.0.0\n * @param  int        $stock_quantity Stock quantity.\n * @param  WC_Product $product        Product instance so that we can pass through the filters.\n * @return string\n *\/\nfunction wc_format_stock_quantity_for_display( $stock_quantity, $product ) {\n\treturn apply_filters( &#039;woocommerce_format_stock_quantity&#039;, $stock_quantity, $product );\n}\n\n\/**\n * Format a sale price for display.\n *\n * @since  3.0.0\n * @param  string $regular_price Regular price.\n * @param  string $sale_price    Sale price.\n * @return string\n *\/\nfunction wc_format_sale_price( $regular_price, $sale_price ) {\n\t$price = &#039;&lt;del&gt;&#039; . ( is_numeric( $regular_price ) ? wc_price( $regular_price ) : $regular_price ) . &#039;&lt;\/del&gt; &lt;ins&gt;&#039; . ( is_numeric( $sale_price ) ? wc_price( $sale_price ) : $sale_price ) . &#039;&lt;\/ins&gt;&#039;;\n\treturn apply_filters( &#039;woocommerce_format_sale_price&#039;, $price, $regular_price, $sale_price );\n}\n\n\/**\n * Format a price range for display.\n *\n * @param  string $from Price from.\n * @param  string $to   Price to.\n * @return string\n *\/\nfunction wc_format_price_range( $from, $to ) {\n\t\/* translators: 1: price from 2: price to *\/\n\t$price = sprintf( _x( &#039;%1$s &amp;ndash; %2$s&#039;, &#039;Price range: from-to&#039;, &#039;woocommerce&#039; ), is_numeric( $from ) ? wc_price( $from ) : $from, is_numeric( $to ) ? wc_price( $to ) : $to );\n\treturn apply_filters( &#039;woocommerce_format_price_range&#039;, $price, $from, $to );\n}\n\n\/**\n * Format a weight for display.\n *\n * @since  3.0.0\n * @param  float $weight Weight.\n * @return string\n *\/\nfunction wc_format_weight( $weight ) {\n\t$weight_string = wc_format_localized_decimal( $weight );\n\n\tif ( ! empty( $weight_string ) ) {\n\t\t$weight_string .= &#039; &#039; . get_option( &#039;woocommerce_weight_unit&#039; );\n\t} else {\n\t\t$weight_string = __( &#039;N\/A&#039;, &#039;woocommerce&#039; );\n\t}\n\n\treturn apply_filters( &#039;woocommerce_format_weight&#039;, $weight_string, $weight );\n}\n\n\/**\n * Format dimensions for display.\n *\n * @since  3.0.0\n * @param  array $dimensions Array of dimensions.\n * @return string\n *\/\nfunction wc_format_dimensions( $dimensions ) {\n\t$dimension_string = implode( &#039; x &#039;, array_filter( array_map( &#039;wc_format_localized_decimal&#039;, $dimensions ) ) );\n\n\tif ( ! empty( $dimension_string ) ) {\n\t\t$dimension_string .= &#039; &#039; . get_option( &#039;woocommerce_dimension_unit&#039; );\n\t} else {\n\t\t$dimension_string = __( &#039;N\/A&#039;, &#039;woocommerce&#039; );\n\t}\n\n\treturn apply_filters( &#039;woocommerce_format_dimensions&#039;, $dimension_string, $dimensions );\n}\n\n\/**\n * Format a date for output.\n *\n * @since  3.0.0\n * @param  WC_DateTime $date   Instance of WC_DateTime.\n * @param  string      $format Data format.\n *                             Defaults to the wc_date_format function if not set.\n * @return string\n *\/\nfunction wc_format_datetime( $date, $format = &#039;&#039; ) {\n\tif ( ! $format ) {\n\t\t$format = wc_date_format();\n\t}\n\tif ( ! is_a( $date, &#039;WC_DateTime&#039; ) ) {\n\t\treturn &#039;&#039;;\n\t}\n\treturn $date-&gt;date_i18n( $format );\n}\n\n\/**\n * Process oEmbeds.\n *\n * @since  3.1.0\n * @param  string $content Content.\n * @return string\n *\/\nfunction wc_do_oembeds( $content ) {\n\tglobal $wp_embed;\n\n\t$content = $wp_embed-&gt;autoembed( $content );\n\n\treturn $content;\n}\n\n\/**\n * Get part of a string before :.\n *\n * Used for example in shipping methods ids where they take the format\n * method_id:instance_id\n *\n * @since  3.2.0\n * @param  string $string String to extract.\n * @return string\n *\/\nfunction wc_get_string_before_colon( $string ) {\n\treturn trim( current( explode( &#039;:&#039;, (string) $string ) ) );\n}\n\n\/**\n * Array merge and sum function.\n *\n * Source:  https:\/\/gist.github.com\/Nickology\/f700e319cbafab5eaedc\n *\n * @since 3.2.0\n * @return array\n *\/\nfunction wc_array_merge_recursive_numeric() {\n\t$arrays = func_get_args();\n\n\t\/\/ If there&#039;s only one array, it&#039;s already merged.\n\tif ( 1 === count( $arrays ) ) {\n\t\treturn $arrays[0];\n\t}\n\n\t\/\/ Remove any items in $arrays that are NOT arrays.\n\tforeach ( $arrays as $key =&gt; $array ) {\n\t\tif ( ! is_array( $array ) ) {\n\t\t\tunset( $arrays[ $key ] );\n\t\t}\n\t}\n\n\t\/\/ We start by setting the first array as our final array.\n\t\/\/ We will merge all other arrays with this one.\n\t$final = array_shift( $arrays );\n\n\tforeach ( $arrays as $b ) {\n\t\tforeach ( $final as $key =&gt; $value ) {\n\t\t\t\/\/ If $key does not exist in $b, then it is unique and can be safely merged.\n\t\t\tif ( ! isset( $b[ $key ] ) ) {\n\t\t\t\t$final[ $key ] = $value;\n\t\t\t} else {\n\t\t\t\t\/\/ If $key is present in $b, then we need to merge and sum numeric values in both.\n\t\t\t\tif ( is_numeric( $value ) &amp;&amp; is_numeric( $b[ $key ] ) ) {\n\t\t\t\t\t\/\/ If both values for these keys are numeric, we sum them.\n\t\t\t\t\t$final[ $key ] = $value + $b[ $key ];\n\t\t\t\t} elseif ( is_array( $value ) &amp;&amp; is_array( $b[ $key ] ) ) {\n\t\t\t\t\t\/\/ If both values are arrays, we recursively call ourself.\n\t\t\t\t\t$final[ $key ] = wc_array_merge_recursive_numeric( $value, $b[ $key ] );\n\t\t\t\t} else {\n\t\t\t\t\t\/\/ If both keys exist but differ in type, then we cannot merge them.\n\t\t\t\t\t\/\/ In this scenario, we will $b&#039;s value for $key is used.\n\t\t\t\t\t$final[ $key ] = $b[ $key ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t\/\/ Finally, we need to merge any keys that exist only in $b.\n\t\tforeach ( $b as $key =&gt; $value ) {\n\t\t\tif ( ! isset( $final[ $key ] ) ) {\n\t\t\t\t$final[ $key ] = $value;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $final;\n}\n<\/code><\/pre>\n<p>Desde j\u00e1, agrade\u00e7o a ajuda de todos!<\/p>\n","protected":false},"template":"","class_list":["post-79203","topic","type-topic","status-publish","hentry","topic-tag-alterar-preco","topic-tag-exibicao-de-preco","topic-tag-woocommerce"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/br.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/79203","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/br.wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/br.wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/br.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/79203\/revisions"}],"predecessor-version":[{"id":79230,"href":"https:\/\/br.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/79203\/revisions\/79230"}],"wp:attachment":[{"href":"https:\/\/br.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=79203"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}