<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Snippets</title>
	<atom:link href="http://wp.djtedfunke.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://wp.djtedfunke.com</link>
	<description></description>
	<lastBuildDate>Fri, 28 Jan 2022 10:51:41 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.9</generator>

<image>
	<url>http://wp.djtedfunke.com/wp-content/uploads/2018/12/cropped-front-end_developer-2-512-32x32.png</url>
	<title>Snippets</title>
	<link>http://wp.djtedfunke.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Rename Order Status Messages in WooCommerce</title>
		<link>http://wp.djtedfunke.com/rename-order-status-messages-in-woocommerce/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Fri, 28 Jan 2022 10:51:41 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Woocommerce]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=348</guid>

					<description><![CDATA[https://www.tychesoftwares.com/how-to-rename-order-status-messages-in-woocommerce/ You will see that the&#160;order status has changed. We used the hook&#160;wc_order_statuses&#160;here and attached our function&#160;ts_rename_order_status_msg&#160;to it. The&#160;$order_statuses&#160;array that we passed as the argument&#8230;]]></description>
										<content:encoded><![CDATA[
<p><a href="https://www.tychesoftwares.com/how-to-rename-order-status-messages-in-woocommerce/">https://www.tychesoftwares.com/how-to-rename-order-status-messages-in-woocommerce/</a></p>



<pre class="wp-block-code"><code lang="php" class="language-php">add_filter( 'wc_order_statuses', 'ts_rename_order_status_msg', 20, 1 );
function ts_rename_order_status_msg( $order_statuses ) {
    $order_statuses['wc-completed']  = _x( 'Order Received', 'Order status', 'woocommerce' );
    $order_statuses['wc-processing'] = _x( 'Your Order is being processed', 'Order status', 'woocommerce' );
    $order_statuses['wc-on-hold']    = _x( 'Your Order is on hold', 'Order status', 'woocommerce' );
    $order_statuses['wc-pending']    = _x( 'Your Order is pending', 'Order status', 'woocommerce' );
    return $order_statuses;
}</code></pre>



<div class="wp-block-image"><figure class="aligncenter"><img src="https://cdn2.tychesoftwares.com/wp-content/uploads/2019/08/14195735/Order_Status_Changed.jpg" alt="Rename Order Status Messages in WooCommerce - Order Status Messages changed" class="wp-image-385694" title="How to Rename Order Status Messages in WooCommerce 2"/></figure></div>



<p>You will see that the&nbsp;<strong>order status has changed</strong>. We used the hook&nbsp;<a href="https://docs.woocommerce.com/wc-apidocs/hook-docs.html" target="_blank" rel="noreferrer noopener"><strong>wc_order_statuses</strong></a>&nbsp;here and attached our function&nbsp;<strong>ts_rename_order_status_msg</strong>&nbsp;to it. The&nbsp;<strong>$order_statuses</strong>&nbsp;array that we passed as the argument contains the status messages as its first value.</p>



<p>The status messages also change in the front-end, where you check your order status under&nbsp;<strong>My account-&gt;Orders</strong>:</p>



<div class="wp-block-image"><figure class="aligncenter"><img src="https://cdn2.tychesoftwares.com/wp-content/uploads/2019/08/19184049/MyAccount_Orders.jpg" alt="Rename Order Status Messages in WooCommerce - Order Status Messages changed in the front end" class="wp-image-386285" title="How to Rename Order Status Messages in WooCommerce 3"/></figure></div>



<p>There are two other places though where the&nbsp;<strong>Woocommerce order status message</strong>&nbsp;gets displayed i.e. in the top menu inside the Admin Dashboard, and also in the dropdown for Bulk Actions:</p>



<div class="wp-block-image"><figure class="aligncenter"><img src="https://cdn2.tychesoftwares.com/wp-content/uploads/2019/08/14200137/TopMenu_Dropdown_Order_status.jpg" alt="Rename Order Status Messages in WooCommerce - Order Status Messages in the Top Menu and Bulk Actions in the Admin Dashboard" class="wp-image-385695" title="How to Rename Order Status Messages in WooCommerce 4"/></figure></div>



<p>These status messages can be changed too using two other hooks to which we will attach two other functions.</p>



<p>Add the below code to the functions.php file of your child theme to change the status message in the top menu:</p>



<pre class="wp-block-code"><code lang="php" class="language-php">foreach( array( 'post', 'shop_order' ) as $hook )
    add_filter( "views_edit-shop_order", 'ts_order_status_top_changed' );
function ts_order_status_top_changed( $views ){
    if( isset( $views['wc-completed'] ) )
        $views['wc-completed'] = str_replace( 'Completed', __( 'Order Received', 'woocommerce'), $views['wc-completed'] );
    if( isset( $views['wc-processing'] ) )
        $views['wc-processing'] = str_replace( 'Processing', __( 'In Process', 'woocommerce'), $views['wc-processing'] );
    if( isset( $views['wc-on-hold'] ) )
        $views['wc-on-hold'] = str_replace( 'On hold', __( 'Order on Hold', 'woocommerce'), $views['wc-on-hold'] );
    if( isset( $views['wc-pending'] ) )
        $views['wc-pending'] = str_replace( 'Pending payment', __( 'Payment Pending', 'woocommerce'), $views['wc-pending'] );
        return $views;
}</code></pre>



<p>You can see that we have used&nbsp;<a href="https://docs.woocommerce.com/wc-apidocs/hook-docs.html" target="_blank" rel="noreferrer noopener"><strong>views_edit-shop_order&nbsp;</strong></a>hook here to simply replace the String values that each array key (for different order status messages) contains.</p>



<div class="wp-block-image"><figure class="aligncenter"><img src="https://cdn2.tychesoftwares.com/wp-content/uploads/2019/08/15210155/TopMenu_Status_Changed1.jpg" alt="Rename Order Status Messages in WooCommerce - Order Status Message changed in Admin Top Menu" class="wp-image-385808" title="How to Rename Order Status Messages in WooCommerce 5"/></figure></div>



<p>Now, the last place that we have to change the order status messages (if necessary) is the Bulk Actions dropdown that we highlighted above. For this, we will use yet another code snippet and add it to the same functions.php file:</p>



<pre class="wp-block-code"><code lang="php" class="language-php">add_filter( 'bulk_actions-edit-shop_order', 'ts_bulk_actions_order_status', 20, 1 );
function ts_bulk_actions_order_status( $actions ) {
    $actions['mark_processing'] = __( 'Mark as In Process', 'woocommerce' );
    $actions['mark_on-hold']    = __( 'Mark as Order on Hold', 'woocommerce' );
    $actions['mark_completed']  = __( 'Mark as Order Received', 'woocommerce' );
    return $actions;
}</code></pre>



<p>Here, the&nbsp;<a href="https://docs.woocommerce.com/wc-apidocs/hook-docs.html" target="_blank" rel="noreferrer noopener"><strong>bulk_actions-edit-shop_order</strong></a>&nbsp;hook is being used to change the values of the different actions that are applied to orders.</p>



<p>You can see that the order status messages will have changed in this dropdown:</p>



<div class="wp-block-image"><figure class="aligncenter"><img src="https://cdn2.tychesoftwares.com/wp-content/uploads/2019/08/15210847/Bulk_Actions_Status_Changed.jpg" alt="Rename Order Status Messages in WooCommerce - Bulk Actions Order Status Message changed" class="wp-image-385809" title="How to Rename Order Status Messages in WooCommerce 6"/></figure></div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Minimum and maximum allowable product quantities to be added in WooCommerce Cart</title>
		<link>http://wp.djtedfunke.com/minimum-and-maximum-allowable-product-quantities-to-be-added-in-woocommerce-cart/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Fri, 28 Jan 2022 10:40:27 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Woocommerce]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=345</guid>

					<description><![CDATA[woocommerce_quantity_input_min : Allows to change the minimum value for the quantity. Default value is 0.woocommerce_quantity_input_max : Allows to change maximum value for the quantity. Default&#8230;]]></description>
										<content:encoded><![CDATA[
<p>woocommerce_quantity_input_min : Allows to change the minimum value for the quantity. Default value is 0.<br>woocommerce_quantity_input_max : Allows to change maximum value for the quantity. Default value is -1.</p>



<pre class="wp-block-code"><code lang="php" class="language-php">/*
* Changing the minimum quantity to 2 for all the WooCommerce products
*/

function woocommerce_quantity_input_min_callback( $min, $product ) {
	$min = 2;  
	return $min;
}
add_filter( 'woocommerce_quantity_input_min', 'woocommerce_quantity_input_min_callback', 10, 2 );

/*
* Changing the maximum quantity to 5 for all the WooCommerce products
*/

function woocommerce_quantity_input_max_callback( $max, $product ) {
	$max = 5;  
	return $max;
}
add_filter( 'woocommerce_quantity_input_max', 'woocommerce_quantity_input_max_callback', 10, 2 );</code></pre>



<p>With backend fields:</p>



<p><a href="https://www.tychesoftwares.com/how-to-set-minimum-and-maximum-allowable-product-quantities-to-be-added-in-woocommerce-cart/">https://www.tychesoftwares.com/how-to-set-minimum-and-maximum-allowable-product-quantities-to-be-added-in-woocommerce-cart/</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Add to Cart Quantity Plus &#038; Minus Buttons</title>
		<link>http://wp.djtedfunke.com/add-to-cart-quantity-plus-minus-buttons/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Fri, 28 Jan 2022 10:38:00 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Woocommerce]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=342</guid>

					<description><![CDATA[PHP Snippet: Display Plus &#38; Minus Quantity Buttons @ WooCommerce Single Product Page And Cart Page:https://www.businessbloomer.com/woocommerce-add-plus-minus-buttons-to-add-to-cart-quantity-input]]></description>
										<content:encoded><![CDATA[
<p>PHP Snippet: Display Plus &amp; Minus Quantity Buttons @ WooCommerce Single Product Page And Cart Page:<br><a href="https://www.businessbloomer.com/woocommerce-add-plus-minus-buttons-to-add-to-cart-quantity-input">https://www.businessbloomer.com/woocommerce-add-plus-minus-buttons-to-add-to-cart-quantity-input</a></p>



<p></p>



<pre class="wp-block-code"><code lang="php" class="language-php">/**
 * @snippet       Plus Minus Quantity Buttons @ WooCommerce Product Page &amp; Cart
 * @how-to        Get CustomizeWoo.com FREE
 * @author        Rodolfo Melogli
 * @compatible    WooCommerce 5
 * @donate $9     https://businessbloomer.com/bloomer-armada/
 */
  
// -------------
// 1. Show plus minus buttons
  
add_action( 'woocommerce_after_quantity_input_field', 'bbloomer_display_quantity_plus' );
  
function bbloomer_display_quantity_plus() {
   echo '&lt;button type="button" class="plus"&gt;+&lt;/button&gt;';
}
  
add_action( 'woocommerce_before_quantity_input_field', 'bbloomer_display_quantity_minus' );
  
function bbloomer_display_quantity_minus() {
   echo '&lt;button type="button" class="minus"&gt;-&lt;/button&gt;';
}
  
// -------------
// 2. Trigger update quantity script
  
add_action( 'wp_footer', 'bbloomer_add_cart_quantity_plus_minus' );
  
function bbloomer_add_cart_quantity_plus_minus() {
 
   if ( ! is_product() &amp;&amp; ! is_cart() ) return;
    
   wc_enqueue_js( "   
           
      $(document).on( 'click', 'button.plus, button.minus', function() {
  
         var qty = $( this ).parent( '.quantity' ).find( '.qty' );
         var val = parseFloat(qty.val());
         var max = parseFloat(qty.attr( 'max' ));
         var min = parseFloat(qty.attr( 'min' ));
         var step = parseFloat(qty.attr( 'step' ));
 
         if ( $( this ).is( '.plus' ) ) {
            if ( max &amp;&amp; ( max &lt;= val ) ) {
               qty.val( max ).change();
            } else {
               qty.val( val + step ).change();
            }
         } else {
            if ( min &amp;&amp; ( min &gt;= val ) ) {
               qty.val( min ).change();
            } else if ( val &gt; 1 ) {
               qty.val( val - step ).change();
            }
         }
 
      });
        
   " );
}</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Disable WordPress Auto-Update Email Notifications</title>
		<link>http://wp.djtedfunke.com/disable-wordpress-auto-update-email-notifications/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 05 Oct 2021 13:31:38 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=331</guid>

					<description><![CDATA[Disable Auto Update Plugin and Theme Emails: Disable Auto Update Core Emails:]]></description>
										<content:encoded><![CDATA[
<p><strong>Disable Auto Update Plugin and Theme Emails:</strong></p>



<pre class="wp-block-code"><code lang="php" class="language-php">//Disable plugin auto-update email notification
add_filter('auto_plugin_update_send_email', '__return_false');
 
//Disable theme auto-update email notification
add_filter('auto_theme_update_send_email', '__return_false');</code></pre>



<p><strong>Disable Auto Update Core Emails:</strong></p>



<pre class="wp-block-code"><code lang="php" class="language-php">//Disable automatic "Your Site Has Been Updated..." emails
add_filter( 'auto_core_update_send_email', 'smartwp_disable_core_update_emails', 10, 4 );
function smartwp_disable_core_update_emails( $send, $type, $core_update, $result ) {
  if ( !empty($type) &amp;&amp; $type == 'success' ) {
    return false;
  }
  
  return true;
}</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>URL parameter value with js / javascript</title>
		<link>http://wp.djtedfunke.com/url-parameter-value-with-js-javascript/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Sun, 19 Sep 2021 17:58:22 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[javascript]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=326</guid>

					<description><![CDATA[Get URL parameter using JavaScript? And this is how you can use this function assuming the URL is,http://dummy.com/?technology=jquery&#38;blog=jquerybyexample.]]></description>
										<content:encoded><![CDATA[
<p>Get URL parameter using JavaScript?</p>



<pre class="wp-block-code"><code lang="javascript" class="language-javascript">var getUrlParameter = function getUrlParameter(sParam) {
    var sPageURL = window.location.search.substring(1),
        sURLVariables = sPageURL.split('&amp;'),
        sParameterName,
        i;

    for (i = 0; i &lt; sURLVariables.length; i++) {
        sParameterName = sURLVariables[i].split('=');

        if (sParameterName[0] === sParam) {
            return typeof sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]);
        }
    }
    return false;
};

</code></pre>



<p>And this is how you can use this function assuming the URL is,<br><code>http://dummy.com/?technology=jquery&amp;blog=jquerybyexample</code>.</p>



<pre class="wp-block-code"><code lang="javascript" class="language-javascript">var tech = getUrlParameter('technology');
var blog = getUrlParameter('blog');</code></pre>



<p></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Create File Upload Type in Visual Composer</title>
		<link>http://wp.djtedfunke.com/create-file-upload-type-in-visual-composer/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Sun, 19 Sep 2021 17:55:32 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=324</guid>

					<description><![CDATA[Create File uplad type for custom element: Create File Upload Type in Visual Composer]]></description>
										<content:encoded><![CDATA[
<p>Create File uplad type for custom element:</p>



<p><blockquote class="wp-embedded-content" data-secret="kZSyfR8cSV"><a href="http://mehimali.com.np/create-file-upload-type-in-visual-composer/">Create File Upload Type in Visual Composer</a></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" title="&#8220;Create File Upload Type in Visual Composer&#8221; &#8212; Kabita Dhimal" src="http://mehimali.com.np/create-file-upload-type-in-visual-composer/embed/#?secret=kZSyfR8cSV" data-secret="kZSyfR8cSV" width="600" height="338" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>



<p></p>



<p></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Circular Progress Button</title>
		<link>http://wp.djtedfunke.com/circular-progress-button/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jun 2021 12:12:47 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=313</guid>

					<description><![CDATA[How to Create a Circular Progress Button:]]></description>
										<content:encoded><![CDATA[
<p>How to Create a Circular Progress Button:</p>



<figure class="wp-block-embed is-type-wp-embed is-provider-codrops wp-block-embed-codrops"><div class="wp-block-embed__wrapper">
<blockquote class="wp-embedded-content" data-secret="PU37K4rd9k"><a href="https://tympanus.net/codrops/2014/04/09/how-to-create-a-circular-progress-button/">How to Create a Circular Progress Button</a></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" title="&#8220;How to Create a Circular Progress Button&#8221; &#8212; Codrops" src="https://tympanus.net/codrops/2014/04/09/how-to-create-a-circular-progress-button/embed/#?secret=PU37K4rd9k" data-secret="PU37K4rd9k" width="600" height="338" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div></figure>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Horizontal Smooth Scroll Layouts</title>
		<link>http://wp.djtedfunke.com/horizontal-smooth-scroll-layouts/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jun 2021 12:09:05 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=310</guid>

					<description><![CDATA[An experimental page transition concept for magazines and blogs where an excerpt item opens for a full page view.]]></description>
										<content:encoded><![CDATA[
<p>An experimental page transition concept for magazines and blogs where an excerpt item opens for a full page view.</p>



<figure class="wp-block-embed is-type-wp-embed is-provider-codrops wp-block-embed-codrops"><div class="wp-block-embed__wrapper">
<blockquote class="wp-embedded-content" data-secret="99Vla8MuCm"><a href="https://tympanus.net/codrops/2020/12/08/horizontal-smooth-scroll-layouts/">Horizontal Smooth Scroll Layouts</a></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" title="&#8220;Horizontal Smooth Scroll Layouts&#8221; &#8212; Codrops" src="https://tympanus.net/codrops/2020/12/08/horizontal-smooth-scroll-layouts/embed/#?secret=99Vla8MuCm" data-secret="99Vla8MuCm" width="600" height="338" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div></figure>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Convert hex color to rgb or rgba using PHP</title>
		<link>http://wp.djtedfunke.com/convert-hex-color-to-rgb-or-rgba-using-php-2/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jun 2021 12:06:53 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=308</guid>

					<description><![CDATA[Convert hexdec color string to rgb(a) string: Here&#8217;s a usage example how to use this function for dynamicaly created CSS:]]></description>
										<content:encoded><![CDATA[
<p><em>Convert hexdec color string to rgb(a) string</em>:</p>



<pre class="wp-block-code"><code lang="php" class="language-php">function hex2rgba($color, $opacity = false) {
 
 $default = 'rgb(0,0,0)';
 
 <em>//Return default if no color provided</em>
 if(empty($color))
          return $default; 
 
 <em>//Sanitize $color if "#" is provided </em>
        if ($color[0] == '#' ) {
         $color = substr( $color, 1 );
        }
 
        <em>//Check if color has 6 or 3 characters and get values</em>
        if (strlen($color) == 6) {
                $hex = array( $color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5] );
        } elseif ( strlen( $color ) == 3 ) {
                $hex = array( $color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2] );
        } else {
                return $default;
        }
 
        <em>//Convert hexadec to rgb</em>
        $rgb =  array_map('hexdec', $hex);
 
        <em>//Check if opacity is set(rgba or rgb)</em>
        if($opacity){
         if(abs($opacity) > 1)
         $opacity = 1.0;
         $output = 'rgba('.implode(",",$rgb).','.$opacity.')';
        } else {
         $output = 'rgb('.implode(",",$rgb).')';
        }
 
        <em>//Return rgb(a) color string</em>
        return $output;
}</code></pre>



<p><em>Here&#8217;s a usage example how to use this function for dynamicaly created CSS</em>:</p>



<pre class="wp-block-code"><code lang="php" class="language-php">$color = '#ffa226';
$rgb = hex2rgba($color);
$rgba = hex2rgba($color, 0.7);
 
<em>/* CSS output */</em>
 
echo ' 
 div.example{
  background: '.$rgb.';
  color: '.$rgba.';
 }
';</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Upload field</title>
		<link>http://wp.djtedfunke.com/upload-field/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jun 2021 11:57:54 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=304</guid>

					<description><![CDATA[Styling &#038; Customizing File Inputs the Smart Way JavaScript:]]></description>
										<content:encoded><![CDATA[
<p><blockquote class="wp-embedded-content" data-secret="nQMac9ACcr"><a href="https://tympanus.net/codrops/2015/09/15/styling-customizing-file-inputs-smart-way/">Styling &#038; Customizing File Inputs the Smart Way</a></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" title="&#8220;Styling &#038; Customizing File Inputs the Smart Way&#8221; &#8212; Codrops" src="https://tympanus.net/codrops/2015/09/15/styling-customizing-file-inputs-smart-way/embed/#?secret=nQMac9ACcr" data-secret="nQMac9ACcr" width="600" height="338" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>



<div class="wp-block-image"><figure class="aligncenter"><img src="https://i7x7p5b7.stackpathcdn.com/codrops/wp-content/uploads/2015/09/smart-custom-file-input-4.gif" alt="" class="wp-image-24841"/></figure></div>



<pre class="wp-block-code"><code lang="css" class="language-css">.inputfile {
    <em>width</em>: 0.1px;
    <em>height</em>: 0.1px;
    <em>opacity</em>: 0;
    <em>overflow</em>: hidden;
    <em>position</em>: absolute;
    <em>z-index</em>: -1;

    + label {
        <em>font-size</em>: $fontSizeBody;
        <em>line-height</em>: $lineHeightBody;
        <em>color</em>: white;
        <em>display</em>: inline-block;
        <em>cursor</em>: pointer;
    }

    &amp;:focus {
        + label {
            <em>outline</em>: 1px dotted $cBlack;
            <em>outline</em>: -webkit-focus-ring-color auto 5px;
        }
    }
}

/* style 6 */
.inputfile-6 {
    + label {
        <em>color</em>: $cBlue;
        <em>border</em>: 1px solid $cGray;
        <em>padding</em>: 0;

        strong {
            <em>padding</em>: 7px 15px;
            <em>font-weight</em>: 300;
            <em>height</em>: 100%;
            <em>color</em>: $cFont;
            <em>display</em>: inline-block;
            <em>background-color</em>:$cBlueLight;

            @media screen and (<em>max-width</em>: 576px) {
                <em>display</em>: block;
            }
        }

        span {
            <em>padding</em>: 7px 15px;
            <em>font-weight</em>: 300;
            <em>min-width</em>: 150px;
            <em>max-width</em>: 250px;
            <em>min-height</em>: 2em;
            <em>display</em>: inline-block;
            <em>text-overflow</em>: ellipsis;
            <em>white-space</em>: nowrap;
            <em>overflow</em>: hidden;
            <em>vertical-align</em>: top;

            svg path {
                <em>fill</em>: $cBlue;
            }
        }

        &amp;:hover {
            <em>border-color</em>: $cBlack;

            strong {
                <em>background-color</em>:$cBlue;
                <em>color</em>: $cWhite;
            }

            svg path {
                <em>fill</em>: $cWhite;
            }
        }
    }

    &amp;:focus,
    &amp;.has-focus {
        + label {
            <em>border-color</em>: $cBlack;

            strong {
                <em>background-color</em>:$cBlue;
                <em>color</em>: $cWhite;
            }
        }
        svg path {
            <em>fill</em>: $cWhite;
        }
    }
} </code></pre>



<p>JavaScript:</p>



<pre class="wp-block-code"><code lang="javascript" class="language-javascript">/*************************************************************
 *************  Custom File Upload Button  ****************
 *************************************************************/

<em>function</em> fileUploadButton() {

    $('.inputfile').each(<em>function</em> () {
        <em>let</em> $input = $(this),
            $label = $input.next('label'),
            labelVal = $label.html();

        $input.on('change', <em>function</em> (<em>e</em>) {
            <em>let</em> fileName = '';

            if (this.files &amp;&amp; this.files.length > 1) {
                fileName = (this.getAttribute('data-multiple-caption') || '').replace('{count}', this.files.length);
            } else if (e.target.value) {
                fileName = e.target.value.split('\\').pop();
            }

            if (fileName) {
                $label.find('span').html(fileName);
            } else {
                $label.html(labelVal);
            }
        });

        // Firefox bug fix
        $input
            .on('focus', <em>function</em> () {
                $input.addClass('has-focus');
            })
            .on('blur', <em>function</em> () {
                $input.removeClass('has-focus');
            });
    });

}</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Emails with the attachments</title>
		<link>http://wp.djtedfunke.com/emails-with-the-attachments/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jun 2021 11:55:12 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=302</guid>

					<description><![CDATA[JS script Ajax function:]]></description>
										<content:encoded><![CDATA[
<p>JS script</p>



<pre class="wp-block-code"><code lang="javascript" class="language-javascript">/*************************************************************
 *************  AJAX - Form sending  ****************
 *************************************************************/

<em>function</em> formSubmitTrigger() {

    $('#job-form').on('submit', <em>function</em> (<em>e</em>) {
        <em>e</em>.preventDefault();

        <em>let</em> submit_button = $(this).find('input[type=submit]');

        <em>var</em> data = new <em>FormData</em>(this);

        $.ajax({
            type: "POST",
            dataType: "json",
            url: ajaxurl,
            data: data,
            contentType: false,
            processData: false,
            beforeSend: <em>function</em> () {
                submit_button.attr("disabled", true);
                $(".spinner").show();
            },
            success: <em>function</em> (<em>data</em>) {
                $('.alert-notice').toggle().text(<em>data</em>['data']);
                $('#job-form')[0].reset();
                $(".spinner").hide();
                submit_button.attr("disabled", false);
            },
            error: <em>function</em> (<em>jqXHR</em>, <em>textStatus</em>, <em>errorThrown</em>) {
                $('.alert-notice').toggle().text(data['data']);
                console.log(<em>jqXHR</em> + " :: " + <em>textStatus</em> + " :: " + <em>errorThrown</em>);
            }
        });
    })
}

</code></pre>



<p>Ajax function:</p>



<pre class="wp-block-code"><code lang="php" class="language-php">
<em>function</em> contact_form_ajax(){

    $to = strip_tags($_POST['sendto']);

    $attachments = [];

        //upload file
        if (! function_exists('wp_handle_upload')) {
            require_once(ABSPATH . 'wp-admin/includes/file.php');
        }

        if($_FILES['file']) {
            foreach ($_FILES['file']['name'] as $n => $name) {
                $upload_overrides = ['test_form' => false ];
                $temp_file = $_FILES['file']['tmp_name'][$n];
                $file_name = $_FILES['file']['name'][$n];
                $file_path = WP_CONTENT_DIR . '/uploads/formattachments/' . $file_name;
                
                wp_handle_upload($temp_file, $upload_overrides);
                move_uploaded_file($temp_file, $file_path);
                
                $attachments[] .= $file_path;
            } 
        }


    $subject = "Neue Anfrage!";
    $headers = "From: Hochegger &lt;". $to . ">\r\n";
    $headers .= "Reply-To: ". strip_tags($_POST['Email']) . "\r\n";
    $headers .= "Content-Type: text/html; charset=UTF-8\r\n";

    $message = '&lt;html>&lt;body>';
    $message .= '&lt;h2>Neue Anfrage:&lt;/h2>';
    foreach ($_POST as $key => $value) {
        if(
            $key != 'action' &amp;&amp; 
            $key != 'datenschutz' &amp;&amp; 
            $key != 'sendto'
        ) {
         
            $message .= "&lt;strong>" . strip_tags($key) . ": &lt;/strong>" . strip_tags($value);
            $message .= "&lt;br/>";
        }
    }
    $message .= "&lt;br/>";
    $message .= "--";
    $message .= "&lt;br/>";
    $message .= "Hochegger Website";
    $message .= "&lt;/body>&lt;/html>";


        //Confirmation email
        $to_confirm = $_POST['Email'];
        $subject_confirm = "Ihre Hochegger Anfrage";
        $headers_confirm = "From: Hochegger &lt;". $to . ">\r\n";
        $headers_confirm .= "MIME-Version: 1.0" . "\r\n";
        $headers_confirm .= "Content-type: text/html; charset=UTF-8" . "\r\n";

        $message_user = '&lt;html>&lt;body>';
        $message_user .= '&lt;h2>Ihre Anfrage:&lt;/h2>';
        foreach ($_POST as $key => $value) {
            if(
                $key != 'action' &amp;&amp; 
                $key != 'datenschutz' &amp;&amp; 
                $key != 'sendto'
            ) {
             
                $message_user .= "&lt;strong>" . strip_tags($key) . ": &lt;/strong>" . strip_tags($value);
                $message_user .= "&lt;br/>";
            }
        }
        $message_user .= "&lt;br/>";
        $message_user .= "--";
        $message_user .= "&lt;br/>";
        $message_user .= "Hochegger Website";
        $message_user .= "&lt;/body>&lt;/html>";

        wp_mail($to_confirm, $subject_confirm, $message_user, $headers_confirm, $attachments);


    // Here put your Validation and send mail
    $sent = wp_mail($to, $subject, $message, $headers, $attachments);

    if($sent) {
        wp_send_json_success();
        return true;
    }
    else  {
        $message = "Error!";
        $return = array(
            'message' => $message
        );
        wp_send_json_error($return);
    }

    die();
}

add_action('wp_ajax_nopriv_contact_form_ajax', 'contact_form_ajax');
add_action('wp_ajax_contact_form_ajax', 'contact_form_ajax');</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SMTP</title>
		<link>http://wp.djtedfunke.com/smtp/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jun 2021 11:51:12 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=299</guid>

					<description><![CDATA[This function will connect wp_mail to your authenticated SMTP server]]></description>
										<content:encoded><![CDATA[
<p>This function will connect wp_mail to your authenticated SMTP server</p>



<pre class="wp-block-code"><code lang="php" class="language-php">/**
 * This function will connect wp_mail to your authenticated
 * SMTP server. This improves reliability of wp_mail, and 
 * avoids many potential problems.
 *
 * 
 * Values for constants are set in wp-config.php
 */
<em>function</em> send_smtp_email( $phpmailer ) {
    $phpmailer->isSMTP();
    $phpmailer->Host       = SMTP_HOST;
    $phpmailer->SMTPAuth   = SMTP_AUTH;
    $phpmailer->Port       = SMTP_PORT;
    $phpmailer->Username   = SMTP_USER;
    $phpmailer->Password   = SMTP_PASS;
    $phpmailer->SMTPSecure = SMTP_SECURE;
    $phpmailer->From       = SMTP_FROM;
    $phpmailer->FromName   = SMTP_NAME;
}
add_action( 'phpmailer_init', 'send_smtp_email' );</code></pre>



<pre class="wp-block-code"><code lang="php" class="language-php">/**
 * SMTP setting for wp_mail -> wp-config.php
 * 
 */
define( 'SMTP_USER',   'email@email.com' );    // Username to use for SMTP authentication
define( 'SMTP_PASS',   'password' );       // Password to use for SMTP authentication
define( 'SMTP_HOST',   'mail.host.com' );    // The hostname of the mail server
define( 'SMTP_FROM',   'email@email.com' ); // SMTP From email address
define( 'SMTP_NAME',   'Reprazent.me' );    // SMTP From name
define( 'SMTP_PORT',   '465' );                  // SMTP port number - likely to be 25, 465 or 587
define( 'SMTP_SECURE', 'ssl' );                 // Encryption system to use - ssl or tls
define( 'SMTP_AUTH',    true );                 // Use SMTP authentication (true|false)
define( 'SMTP_DEBUG',   0 );                    // for debugging purposes only set to 1 or 2


</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Remove JQuery migrate</title>
		<link>http://wp.djtedfunke.com/remove-jquery-migrate/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 13 Apr 2021 09:45:29 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=296</guid>

					<description><![CDATA[Remove JQuery migrate from WordPress frontend:]]></description>
										<content:encoded><![CDATA[
<p>Remove JQuery migrate from WordPress frontend:</p>



<pre class="wp-block-code"><code lang="php" class="language-php"><em>function</em> remove_jquery_migrate( $scripts ) {
    if ( ! is_admin() &amp;&amp; isset( $scripts->registered['jquery'] ) ) {
        $script = $scripts->registered['jquery'];
        if ( $script->deps ) {
            // Check whether the script has any dependencies
            $script->deps = array_diff( $script->deps, array( 'jquery-migrate' ) );
        }
    }
}
add_action( 'wp_default_scripts', 'remove_jquery_migrate' );</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Import Posts from CSV Data</title>
		<link>http://wp.djtedfunke.com/import-posts-from-csv-data/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Sat, 30 Jan 2021 21:50:39 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=290</guid>

					<description><![CDATA[Import Posts from Custom CSV Data: https://www.sitepoint.com/programmatically-creating-wordpress-posts-from-csv-data/ Example for CPT and ACF fields:]]></description>
										<content:encoded><![CDATA[
<p>Import Posts from Custom CSV Data:</p>



<p><a href="https://www.sitepoint.com/programmatically-creating-wordpress-posts-from-csv-data/">https://www.sitepoint.com/programmatically-creating-wordpress-posts-from-csv-data/</a></p>



<p>Example for CPT and ACF fields:</p>



<pre class="wp-block-code"><code lang="php" class="language-php">
/**
 * Show 'insert posts' button on backend
 */
add_action( "admin_notices", <em>function</em>() {
    echo "&lt;div class='updated'>";
    echo "&lt;p>";
    echo "To insert or overwrite the posts into the CSV files, click the button to the right.";
    echo "&lt;a class='button button-primary' style='margin:0.25em 1em' href='{$_SERVER["REQUEST_URI"]}&amp;insert_km_products'>Import products from CSV&lt;/a>";
    echo "&lt;/p>";
    echo "&lt;/div>";
});

/**
 * Create and insert posts from CSV files
 */
add_action( "admin_init", <em>function</em>() {

    //  the post creation _only_ happens when you want it to.
    if ( ! isset( $_GET["insert_km_products"] ) ) {
        return;
    }

    // Change these to whatever you set
    $custom_names = array(
        "custom-post-type" => "produkte"
    );

    // Get the data from all those CSVs!
    $posts = <em>function</em>() {
        $data = array();
        $errors = array();
        $uploads = wp_upload_dir();
        $upload_path = $uploads['basedir'];

        // Get array of CSV files
        $files = glob( $upload_path."/km_csv/*.csv" );

        foreach ( $files as $file ) {

            // Attempt to change permissions if not readable
            if ( ! is_readable( $file ) ) {
                chmod( $file, 0744 );
            }

            // Check if file is writable, then open it in 'read only' mode
            if ( is_readable( $file ) &amp;&amp; $_file = fopen( $file, "r" ) ) {
                $path_parts = pathinfo($file);

                // To sum this part up, all it really does is go row by row, column by column, saving all the data
                $post = array();

                // Get first row in CSV, which is of course the headers
                $header = fgetcsv( $_file, 0, "\t" );

                while ( $row = fgetcsv( $_file, 0, "\t" ) ) {

                    foreach ( $header as $i => $key ) {
                        $post[$key] = $row[$i];
                    }
                    
                    $post['filename'] = $path_parts['filename'];
                    $data[] = $post;
                    
                    // break; // only 1
                }

                fclose( $_file );

            } else {
                $errors[] = "File '$file' could not be opened. Check the file's permissions to make sure it's readable by your server.";
            }
        }

        if ( ! empty( $errors ) ) {
            // ... do stuff with the errors
        }

        return $data;
    };


    //  Check to see if the current post exists within the    
    $post_exists = <em>function</em>( $shop, $id, $import_post_type ) use ( $custom_names ) {
        $product_post = new <em>WP_Query</em>(
            array(
                'post_type'         => $import_post_type,
                'post_status '      => 'publish',
                'meta_query' => array(
                    array(
                        'key'     => 'shop',
                        'value'   => $shop,
                        // 'value'   => 'test',
                    ),
                    array(
                        'key'     => 'id',
                        'value'   => $id,
                    ),
                ),
            )
        );

        return $product_post->post->ID;
    };


    /**
     * IMPORT into post type
     */
    foreach ( $posts() as $post ) {

        $import_post_type = 'produkte';
        $import_taxonomy = 'kategorie';

        switch ($post['filename']) {
            case 'hubmann':
                $product_link = 'http://shop.hubmann-leibnitz.at/';
                break;
            case 'groebner':
                $product_link = 'https://shop.groebner.eu/';
                break;
            case 'blumenversand':
                $product_link = 'https://www.blumenversand.at/';
                break;
            case 'ma-chic':
                $product_link = 'https://shop.ma-chic.at/';
                break;
            default:
                $product_link = $post['Link'];
                break;
        }


        // If the post exists, skip this post and go to the next one
        if ( $existing_post_id = $post_exists( $post["filename"], $post['Id'], $import_post_type ) ) {

            wp_insert_post( array(
                'ID' => $existing_post_id,
                'post_title' => $post['Title'],
                'post_type' => $import_post_type,
                'post_status' => 'publish'
            ));

            $post['post_id'] = $existing_post_id;

        } else {
            // Insert the post into the database
            $post['post_id'] = wp_insert_post( array(
                'post_title' => $post['Title'],
                'post_type' => $import_post_type,
                'post_status' => 'publish'
            ));
        }

        update_field( 'condition', $post['Condition'], $post['post_id'] );
        update_field( 'price', $post['Price'], $post['post_id'] );
        update_field( 'availability', $post['Availability'], $post['post_id'] );
        update_field( 'image_link', $post['Image_Link'], $post['post_id'] );
        update_field( 'category', $post['Category'], $post['post_id'] );
        update_field( 'id', $post['Id'], $post['post_id'] );
        update_field( 'link', $product_link, $post['post_id'] );
        update_field( 'description', $post['Description'], $post['post_id'] );
        update_field( 'gtin', $post['GTIN'], $post['post_id'] );
        update_field( 'brand', $post['Brand'], $post['post_id'] );
        update_field( 'shipping_weight', $post['Shipping_weight'], $post['post_id'] );
        update_field( 'shop', $post['filename'], $post['post_id'] );


        //Assign 'Kategorie' taxonomy
        $args = array(
            'hide_empty' => false,
            'taxonomy'  => $import_taxonomy,
            'meta_query' => array(
                array(
                   'key'       => 'km_id',
                   'value'     => $post['Category'],
                   'compare'   => '='
                )
            ),
            );
        $terms = get_terms( $args );
    
        wp_delete_object_term_relationships( $post['post_id'], $import_taxonomy ); // remove all terms 
        
        if($terms) {
            wp_set_object_terms( $post['post_id'], $terms[0]->term_id, $import_taxonomy ); // assign new terms
        }
    }

});</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Import $ jQuery</title>
		<link>http://wp.djtedfunke.com/import-jquery/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Sun, 24 Jan 2021 10:34:04 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=285</guid>

					<description><![CDATA[Import jQuery to main.js:]]></description>
										<content:encoded><![CDATA[
<p>Import jQuery to main.js:</p>



<pre class="wp-block-code"><code lang="javascript" class="language-javascript">import $ from 'jquery';
window.$ = window.jQuery = $; </code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Speed test</title>
		<link>http://wp.djtedfunke.com/speed-test/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Mon, 04 Jan 2021 14:18:27 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=282</guid>

					<description><![CDATA[Page load speed:]]></description>
										<content:encoded><![CDATA[
<p>Page load speed:</p>



<pre class="wp-block-code"><code lang="php" class="language-php"><em>function</em> tr_head() {
    $GLOBALS['tr_time_start'] = microtime( true );
}
add_action( 'wp_head', 'tr_head' );

<em>function</em> tr_footer() {
    $start = $GLOBALS['tr_time_start'];
    $end   = microtime( true );
    
    echo sprintf( '&lt;p>Page generated in %0.2f seconds.&lt;/p>',
        $end - $start
    );
}
add_action( 'wp_footer', 'tr_footer' );</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Editor capabilities</title>
		<link>http://wp.djtedfunke.com/editor-capabilities/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Mon, 14 Dec 2020 11:39:44 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=277</guid>

					<description><![CDATA[Add editor the privilege to edit theme &#38; menu:]]></description>
										<content:encoded><![CDATA[
<p>Add editor the privilege to edit theme &amp; menu:</p>



<pre class="wp-block-code"><code lang="php" class="language-php">// get the the role object
$role_object = get_role( 'editor' );

// add $cap capability to this role object

// Design menu point
$role_object->add_cap( 'edit_theme_options' );

//theme settings
$role_object->add_cap( 'manage_options' );</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Coupon column &#8211; used in orders</title>
		<link>http://wp.djtedfunke.com/coupon-column-used-in-orders/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 03 Nov 2020 11:05:57 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=273</guid>

					<description><![CDATA[Coupon column &#8211; with list of orders coupon was used:]]></description>
										<content:encoded><![CDATA[
<p>Coupon column &#8211; with list of orders coupon was used:</p>



<pre class="wp-block-code"><code lang="php" class="language-php">function woo_customer_coupon_column_for_orders( $columns ) {
    $new_columns = array();
    
    foreach ( $columns as $column_key => $column_label ) {
        if ( 'expiry_date' === $column_key ) {
            $new_columns['order_coupons'] = __('Orders', 'woocommerce');
        }
        
        $new_columns[$column_key] = $column_label;
    }
    return $new_columns;
}
add_filter( 'manage_edit-shop_coupon_columns', 'woo_customer_coupon_column_for_orders' );


function woo_display_customer_coupon_in_column_for_orders( $column ) {
    global $the_order, $post;
    if( $column  == 'order_coupons' ) {

        $orders_with_coupon = wh_getOrderbyCouponCode($post->post_title);
        foreach ($orders_with_coupon as $order) {

            echo '- &lt;a href="'.get_admin_url().'/post.php?post='.$order.'&amp;action=edit">&lt;small>&lt;em>#' . $order . '&lt;/em>&lt;/small>&lt;/a>';
            echo '&lt;br/>';
        }
    }
}
add_action( 'manage_shop_coupon_posts_custom_column' , 'woo_display_customer_coupon_in_column_for_orders' );



function wh_getOrderbyCouponCode($coupon_code) {
    global $wpdb;
    $return_array = [];

    $query = "SELECT
        p.ID AS order_id
        FROM
        {$wpdb->prefix}posts AS p
        INNER JOIN {$wpdb->prefix}woocommerce_order_items AS woi ON p.ID = woi.order_id
        WHERE
        p.post_type = 'shop_order' AND
        p.post_status IN ('" . implode("','", array_keys(wc_get_order_statuses())) . "') AND
        woi.order_item_type = 'coupon' AND
        woi.order_item_name = '" . $coupon_code . "';";

    $orders = $wpdb->get_results($query);

    if (!empty($orders)) {
        $dp = ( isset($filter['dp']) ? intval($filter['dp']) : 2 );
        //looping throught all the order_id
        foreach ($orders as $key => $order) {
            $order_id = $order->order_id;
            $return_array[$key] = $order_id;
        }

    }
    return $return_array;
}
</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Coupons used column &#8211; Orders</title>
		<link>http://wp.djtedfunke.com/coupons-used-column-orders/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 03 Nov 2020 10:30:17 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Woocommerce]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=271</guid>

					<description><![CDATA[Add a column with coupons used on admin Orders list in Woocommerce:]]></description>
										<content:encoded><![CDATA[
<p>Add a column with coupons used on admin Orders list in Woocommerce:</p>



<pre class="wp-block-code"><code lang="php" class="language-php">function woo_customer_order_coupon_column_for_orders( $columns ) {
    $new_columns = array();
    
    foreach ( $columns as $column_key => $column_label ) {
        if ( 'order_total' === $column_key ) {
            $new_columns['order_coupons'] = __('Coupons', 'woocommerce');
        }
        
        $new_columns[$column_key] = $column_label;
    }
    return $new_columns;
}
add_filter( 'manage_edit-shop_order_columns', 'woo_customer_order_coupon_column_for_orders' );

function woo_display_customer_order_coupon_in_column_for_orders( $column ) {
    global $the_order, $post;
    if( $column  == 'order_coupons' ) {
        if( $coupons = $the_order->get_coupon_codes() ) {
            echo implode(', ', $coupons) . ' ('.count($coupons).')';
        } else {
            echo '&lt;small>&lt;em>'. __('No coupons') . '&lt;/em>&lt;/small>';
        }
    }
}
add_action( 'manage_shop_order_posts_custom_column' , 'woo_display_customer_order_coupon_in_column_for_orders' );</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Disable WordPress Updates</title>
		<link>http://wp.djtedfunke.com/disable-wordpress-updates/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Fri, 16 Oct 2020 08:57:25 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=268</guid>

					<description><![CDATA[Disable WordPress Updates for Specific Users (Not admin user):]]></description>
										<content:encoded><![CDATA[
<p>Disable WordPress Updates for Specific Users (Not admin user):</p>



<pre class="wp-block-code"><code lang="php" class="language-php">function disable_updates() {
    global $wp_version;
    return (object) array( 'last_checked' => time(), 'version_checked' => $wp_version, );
}

add_action( 'init', function () {
    if ( ! current_user_can( 'administrator' ) ) {
        add_filter( 'pre_site_transient_update_core', 'disable_updates' );     // Disable WordPress core updates
        add_filter( 'pre_site_transient_update_plugins', 'disable_updates' );  // Disable WordPress plugin updates
        add_filter( 'pre_site_transient_update_themes', 'disable_updates' );   // Disable WordPress theme updates
    }
} );</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Slugify</title>
		<link>http://wp.djtedfunke.com/slugify/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Fri, 16 Oct 2020 08:54:25 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=265</guid>

					<description><![CDATA[A snippet for generating a URL friendly slug in PHP]]></description>
										<content:encoded><![CDATA[
<p>A snippet for generating a URL friendly slug in PHP</p>



<pre class="wp-block-code"><code lang="php" class="language-php">function slugify($string){
return strtolower(trim(preg_replace('/[^A-Za-z0-9-]+/', '-', $string), '-'));
}</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Reset user roles</title>
		<link>http://wp.djtedfunke.com/reset-user-roles/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 06 Oct 2020 08:49:28 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=258</guid>

					<description><![CDATA[Reset user roles. Run once.]]></description>
										<content:encoded><![CDATA[
<p>Reset user roles. Run once.</p>



<pre class="wp-block-code"><code lang="php" class="language-php">if ( !function_exists( 'populate_roles' ) ) {
require_once( ABSPATH . 'wp-admin/includes/schema.php' );
}

populate_roles();</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Disable theme editor &#8211; backend</title>
		<link>http://wp.djtedfunke.com/disable-theme-editor-backend/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Thu, 19 Mar 2020 14:22:40 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[backend]]></category>
		<category><![CDATA[disable]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[theme]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=246</guid>

					<description><![CDATA[Insert in wp-config.php:]]></description>
										<content:encoded><![CDATA[
<p>Insert in wp-config.php:</p>



<pre class="wp-block-code"><code lang="php" class="language-php">define( 'DISALLOW_FILE_EDIT', true );</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>WooCommerce: Order Info</title>
		<link>http://wp.djtedfunke.com/woocommerce-order-info/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Sat, 29 Feb 2020 16:07:19 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Woocommerce]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=243</guid>

					<description><![CDATA[WooCommerce: Easily Get Order Info (total, items, etc) from $order Object 1. You have access to $order Hooks (do_action and apply_filters) use additional arguments which&#8230;]]></description>
										<content:encoded><![CDATA[
<p>WooCommerce: Easily Get Order Info (total, items, etc) from $order Object</p>



<h2>1. You have access to $order</h2>



<p>Hooks (do_action and apply_filters) use additional arguments which are passed on to the function. If they allow you to use the “$order” object you’re in business. Here’s how to get all the order information:</p>



<pre class="wp-block-code"><code lang="php" class="language-php">// Get Order ID
$order->get_id();
 
// Get Order Totals $0.00
$order->get_formatted_order_total();
$order->get_cart_tax();
$order->get_currency();
$order->get_discount_tax();
$order->get_discount_to_display();
$order->get_discount_total();
$order->get_fees();
$order->get_formatted_line_subtotal();
$order->get_shipping_tax();
$order->get_shipping_total();
$order->get_subtotal();
$order->get_subtotal_to_display();
$order->get_tax_location();
$order->get_tax_totals();
$order->get_taxes();
$order->get_total();
$order->get_total_discount();
$order->get_total_tax();
$order->get_total_refunded();
$order->get_total_tax_refunded();
$order->get_total_shipping_refunded();
$order->get_item_count_refunded();
$order->get_total_qty_refunded();
$order->get_qty_refunded_for_item();
$order->get_total_refunded_for_item();
$order->get_tax_refunded_for_item();
$order->get_total_tax_refunded_by_rate_id();
$order->get_remaining_refund_amount();
 
// Get Order Items
$order->get_items();
$order->get_items_key();
$order->get_items_tax_classes();
$order->get_item();
$order->get_item_count();
$order->get_item_subtotal();
$order->get_item_tax();
$order->get_item_total();
$order->get_downloadable_items();
 
// Get Order Lines
$order->get_line_subtotal();
$order->get_line_tax();
$order->get_line_total();
 
// Get Order Shipping
$order->get_shipping_method();
$order->get_shipping_methods();
$order->get_shipping_to_display();
 
// Get Order Dates
$order->get_date_created();
$order->get_date_modified();
$order->get_date_completed();
$order->get_date_paid();
 
// Get Order User, Billing &amp; Shipping Addresses
$order->get_customer_id();
$order->get_user_id();
$order->get_user();
$order->get_customer_ip_address();
$order->get_customer_user_agent();
$order->get_created_via();
$order->get_customer_note();
$order->get_address_prop();
$order->get_billing_first_name();
$order->get_billing_last_name();
$order->get_billing_company();
$order->get_billing_address_1();
$order->get_billing_address_2();
$order->get_billing_city();
$order->get_billing_state();
$order->get_billing_postcode();
$order->get_billing_country();
$order->get_billing_email();
$order->get_billing_phone();
$order->get_shipping_first_name();
$order->get_shipping_last_name();
$order->get_shipping_company();
$order->get_shipping_address_1();
$order->get_shipping_address_2();
$order->get_shipping_city();
$order->get_shipping_state();
$order->get_shipping_postcode();
$order->get_shipping_country();
$order->get_address();
$order->get_shipping_address_map_url();
$order->get_formatted_billing_full_name();
$order->get_formatted_shipping_full_name();
$order->get_formatted_billing_address();
$order->get_formatted_shipping_address();
 
// Get Order Payment Details
$order->get_payment_method();
$order->get_payment_method_title();
$order->get_transaction_id();
 
// Get Order URLs
$order->get_checkout_payment_url();
$order->get_checkout_order_received_url();
$order->get_cancel_order_url();
$order->get_cancel_order_url_raw();
$order->get_cancel_endpoint();
$order->get_view_order_url();
$order->get_edit_order_url();
 
// Get Order Status
$order->get_status();
 
// source: https://docs.woocommerce.com/wc-apidocs/class-WC_Order.html</code></pre>



<h2>2. You have access to $order_id</h2>



<p>If you have access to the order ID (once again, usually the do_action or apply_filters might give you this), you have to get the order object first. Then do the exact same things as above.</p>



<pre class="wp-block-code"><code lang="php" class="language-php">// Get $order object from order ID
 
$order = wc_get_order( $order_id );
 
// Now you have access to (see above)...
 
$order->get_id()
$order->get_formatted_order_total( )
// etc.
// etc.</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Woocommerce email</title>
		<link>http://wp.djtedfunke.com/woocommerce-email/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Sat, 29 Feb 2020 16:05:14 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[Woocommerce]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=241</guid>

					<description><![CDATA[This script will allow you to send a custom email from anywhere within wordpress but using the woocommerce template so that your emails look the&#8230;]]></description>
										<content:encoded><![CDATA[
<p>This script will allow you to send a custom email from anywhere within wordpress but using the woocommerce template so that your emails look the same.<br><a href="https://gist.github.com/craigedmonds/b65c65e02fd40bd381bf023ffef2c80e">https://gist.github.com/craigedmonds/b65c65e02fd40bd381bf023ffef2c80e</a></p>



<pre class="wp-block-code"><code lang="php" class="language-php">function get_custom_email_html( $order, $heading = false, $mailer ) {

	$template = 'emails/my-custom-email-i-want-to-send.php';

	return wc_get_template_html( $template, array(
		'order'         => $order,
		'email_heading' => $heading,
		'sent_to_admin' => false,
		'plain_text'    => false,
		'email'         => $mailer
	) );

}

// load the mailer class
$mailer = WC()->mailer();

//format the email
$recipient = "someone@somewhere.com";
$subject = __("Hi! Here is a custom notification from us!", 'theme_name');
$content = get_custom_email_html( $order, $subject, $mailer );
$headers = "Content-Type: text/html\r\n";

//send the email through wordpress
$mailer->send( $recipient, $subject, $content, $headers );</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Cute Hide (show/hide element)</title>
		<link>http://wp.djtedfunke.com/cute-hide-show-hide-element/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Thu, 20 Feb 2020 20:03:02 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[hidding]]></category>
		<category><![CDATA[hide]]></category>
		<category><![CDATA[javascript]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=238</guid>

					<description><![CDATA[Smooth hiddinig elements with js:]]></description>
										<content:encoded><![CDATA[
<p>Smooth hiddinig elements with js:</p>



<pre class="wp-block-code"><code>    function cuteHide(el) {
        el.animate({opacity: '0'}, 130, function(){
            el.animate({height: '0px'}, 130, function(){
            });
        });
    }

    function cuteUnhide(el) {
        el.animate({height: '100%'}, 130, function(){
            el.animate({opacity: '1'}, 130, function() {
            });
        });
    }
    function cuteRemove(el) {
        el.animate({opacity: '0'}, 150, function(){
            el.animate({height: '0px'}, 150, function(){
                el.remove();
            });
        });
    }</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How To Track Post Views Without a Plugin Using Post Meta</title>
		<link>http://wp.djtedfunke.com/how-to-track-post-views-without-a-plugin-using-post-meta/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Fri, 27 Sep 2019 19:29:39 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=233</guid>

					<description><![CDATA[https://www.isitwp.com/track-post-views-without-a-plugin-using-post-meta/ Are you looking for a way to track post views without a plugin using post meta? While there’s probably a plugin for this, we&#8230;]]></description>
										<content:encoded><![CDATA[
<p><a href="https://www.isitwp.com/track-post-views-without-a-plugin-using-post-meta/">https://www.isitwp.com/track-post-views-without-a-plugin-using-post-meta/</a></p>



<p>Are you looking for a way to track post views without a plugin using post meta? While there’s probably a plugin for this, we have created a quick code snippet that you can use to track post views without a plugin using post meta in WordPress.</p>



<p><strong>Instructions</strong>:</p>



<p>Add this code to your theme’s functions.php file:</p>



<pre class="wp-block-code"><code>function getPostViews($postID){
    $count_key = 'post_views_count';
    $count = get_post_meta($postID, $count_key, true);
    if($count==''){
        delete_post_meta($postID, $count_key);
        add_post_meta($postID, $count_key, '0');
        return "0 View";
    }
    return $count.' Views';
}
function setPostViews($postID) {
    $count_key = 'post_views_count';
    $count = get_post_meta($postID, $count_key, true);
    if($count==''){
        $count = 0;
        delete_post_meta($postID, $count_key);
        add_post_meta($postID, $count_key, '0');
    }else{
        $count++;
        update_post_meta($postID, $count_key, $count);
    }
}
 
// Remove issues with prefetching adding extra views
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0); </code></pre>



<p>Optionally add this code as well to a column in the WordPress admin that displays the post views:</p>



<pre class="wp-block-code"><code>// Add to a column in WP-Admin
add_filter('manage_posts_columns', 'posts_column_views');
add_action('manage_posts_custom_column', 'posts_custom_column_views',5,2);
function posts_column_views($defaults){
    $defaults['post_views'] = __('Views');
    return $defaults;
}
function posts_custom_column_views($column_name, $id){
    if($column_name === 'post_views'){
        echo getPostViews(get_the_ID());
    }
}</code></pre>



<p>This part of the tracking views code will set the post views. Just place this code below within the single.php file inside the WordPress Loop.</p>



<pre class="wp-block-code"><code>&lt;?php setPostViews(get_the_ID()); ?></code></pre>



<p><strong>Note about fragment caching:</strong> If you are using a caching plugin like W3 Total Cache, the method above to set views will not work as the <code>setPostViews()</code> function would never run. However, W3 Total Cache has a feature called fragment caching. Instead of the above, use the following so the <code>setPostViews()</code> will run just fine and will track all your post views even when you have caching enabled.</p>



<pre class="wp-block-code"><code>&lt;!-- mfunc setPostViews(get_the_ID()); -->&lt;!-- /mfunc --></code></pre>



<p>The code below is optional. Use this code if you would like to display the number of views within your posts. Place this code within the Loop.</p>



<pre class="wp-block-code"><code>&lt;?php echo getPostViews(get_the_ID());?></code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Customize WooCommerce Shipping Rates</title>
		<link>http://wp.djtedfunke.com/customize-woocommerce-shipping-rates/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Thu, 26 Sep 2019 15:19:17 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Woocommerce]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=229</guid>

					<description><![CDATA[]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-embed-wordpress wp-block-embed is-type-wp-embed is-provider-caleb-burks"><div class="wp-block-embed__wrapper">
<blockquote class="wp-embedded-content" data-secret="XTp4PiWO6m"><a href="https://calebburks.com/customize-woocommerce-shipping-rates/">Customize WooCommerce Shipping Rates</a></blockquote><iframe title="&#8220;Customize WooCommerce Shipping Rates&#8221; &#8212; Caleb Burks" class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="position: absolute; clip: rect(1px, 1px, 1px, 1px);" src="https://calebburks.com/customize-woocommerce-shipping-rates/embed/#?secret=XTp4PiWO6m" data-secret="XTp4PiWO6m" width="600" height="338" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div></figure>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>WooCommerce shipping fee that changes when condition is met</title>
		<link>http://wp.djtedfunke.com/woocommerce-shipping-fee-that-changes-when-condition-is-met/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Thu, 26 Sep 2019 15:18:23 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Woocommerce]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=227</guid>

					<description><![CDATA[https://reigelgallarde.me/programming/woocommerce-shipping-fee-changes-condition-met/]]></description>
										<content:encoded><![CDATA[
<p><a href="https://reigelgallarde.me/programming/woocommerce-shipping-fee-changes-condition-met/">https://reigelgallarde.me/programming/woocommerce-shipping-fee-changes-condition-met/</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>WooCommerce: Display Required Field Errors “Inline” @ Checkout</title>
		<link>http://wp.djtedfunke.com/woocommerce-display-required-field-errors-inline-checkout/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Thu, 26 Sep 2019 15:16:21 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Woocommerce]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=225</guid>

					<description><![CDATA[]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-embed-wordpress wp-block-embed is-type-wp-embed is-provider-business-bloomer"><div class="wp-block-embed__wrapper">
<blockquote class="wp-embedded-content" data-secret="HX59u9Tltg"><a href="https://businessbloomer.com/woocommerce-display-required-field-errors-inline-checkout/">WooCommerce: Display Required Field Errors &#8220;Inline&#8221; @ Checkout</a></blockquote><iframe title="&#8220;WooCommerce: Display Required Field Errors &#8220;Inline&#8221; @ Checkout&#8221; &#8212; Business Bloomer" class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="position: absolute; clip: rect(1px, 1px, 1px, 1px);" src="https://businessbloomer.com/woocommerce-display-required-field-errors-inline-checkout/embed/#?secret=HX59u9Tltg" data-secret="HX59u9Tltg" width="600" height="338" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div></figure>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>CSS link/button/loader effects</title>
		<link>http://wp.djtedfunke.com/css-link-button-loader-effects/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Thu, 26 Sep 2019 14:33:17 +0000</pubDate>
				<category><![CDATA[External]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=221</guid>

					<description><![CDATA[https://cssfx.dev/]]></description>
										<content:encoded><![CDATA[
<p><a href="https://cssfx.dev/">https://cssfx.dev/</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Woocommerce external blogs</title>
		<link>http://wp.djtedfunke.com/woocommerce-external-blogs/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Thu, 26 Sep 2019 14:28:50 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Woocommerce]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=219</guid>

					<description><![CDATA[https://rudrastyh.com/blog https://jeroensormani.com/blog/ https://wpglorify.com/]]></description>
										<content:encoded><![CDATA[
<ul><li><a href="https://rudrastyh.com/blog">https://rudrastyh.com/blog</a></li><li><a href="https://jeroensormani.com/blog/">https://jeroensormani.com/blog/</a></li><li><a href="https://wpglorify.com/">https://wpglorify.com/</a></li></ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Convert hex color to rgb or rgba using PHP</title>
		<link>http://wp.djtedfunke.com/convert-hex-color-to-rgb-or-rgba-using-php/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Thu, 26 Sep 2019 14:19:00 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=217</guid>

					<description><![CDATA[Usage example:]]></description>
										<content:encoded><![CDATA[
<pre class="wp-block-code"><code>/* Convert hexdec color string to rgb(a) string */
 
function hex2rgba($color, $opacity = false) {
 
	$default = 'rgb(0,0,0)';
 
	//Return default if no color provided
	if(empty($color))
          return $default; 
 
	//Sanitize $color if "#" is provided 
        if ($color[0] == '#' ) {
        	$color = substr( $color, 1 );
        }
 
        //Check if color has 6 or 3 characters and get values
        if (strlen($color) == 6) {
                $hex = array( $color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5] );
        } elseif ( strlen( $color ) == 3 ) {
                $hex = array( $color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2] );
        } else {
                return $default;
        }
 
        //Convert hexadec to rgb
        $rgb =  array_map('hexdec', $hex);
 
        //Check if opacity is set(rgba or rgb)
        if($opacity){
        	if(abs($opacity) > 1)
        		$opacity = 1.0;
        	$output = 'rgba('.implode(",",$rgb).','.$opacity.')';
        } else {
        	$output = 'rgb('.implode(",",$rgb).')';
        }
 
        //Return rgb(a) color string
        return $output;
}</code></pre>



<p>Usage example:</p>



<pre class="wp-block-code"><code>/* Here's a usage example how to use this function for dynamicaly created CSS */
 
$color = '#ffa226';
$rgb = hex2rgba($color);
$rgba = hex2rgba($color, 0.7);
 
/* CSS output */
 
echo '	
	div.example{
	 background: '.$rgb.';
	 color: '.$rgba.';
	}
';</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Object-fit IE Polyfill</title>
		<link>http://wp.djtedfunke.com/object-fit-ie-polyfill/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Sat, 21 Sep 2019 18:16:00 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[External]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=214</guid>

					<description><![CDATA[Neat trick for CSS object-fit fallback on IE: https://medium.com/@primozcigler/neat-trick-for-css-object-fit-fallback-on-edge-and-other-browsers-afbc53bbb2c3]]></description>
										<content:encoded><![CDATA[
<p>Neat trick for CSS object-fit fallback on IE:</p>



<p><a href="https://medium.com/@primozcigler/neat-trick-for-css-object-fit-fallback-on-edge-and-other-browsers-afbc53bbb2c3">https://medium.com/@primozcigler/neat-trick-for-css-object-fit-fallback-on-edge-and-other-browsers-afbc53bbb2c3</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Slick Slider Animated</title>
		<link>http://wp.djtedfunke.com/slick-slider-animated/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Sat, 21 Sep 2019 18:11:14 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[External]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[slick slider]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=211</guid>

					<description><![CDATA[Animated text elements on slick slider: https://codepen.io/alexandrebuffet/pen/zNpmpx https://codepen.io/joxxce/pen/WjGLyr]]></description>
										<content:encoded><![CDATA[
<p>Animated text elements on slick slider:</p>



<ol><li><a href="https://codepen.io/alexandrebuffet/pen/zNpmpx">https://codepen.io/alexandrebuffet/pen/zNpmpx</a></li><li><a href="https://codepen.io/joxxce/pen/WjGLyr">https://codepen.io/joxxce/pen/WjGLyr</a></li></ol>



<p></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>JS Librarys</title>
		<link>http://wp.djtedfunke.com/js-librarys/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Wed, 18 Sep 2019 19:48:34 +0000</pubDate>
				<category><![CDATA[External]]></category>
		<category><![CDATA[JavaScript]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=208</guid>

					<description><![CDATA[https://qrohlf.com/trianglify/]]></description>
										<content:encoded><![CDATA[
<p><a href="https://qrohlf.com/trianglify/">https://qrohlf.com/trianglify/</a></p>



<figure class="wp-block-image"><img loading="lazy" width="704" height="583" src="http://wp.djtedfunke.com/wp-content/uploads/2019/09/Screenshot-2019-09-18-at-21.47.44.png" alt="" class="wp-image-209" srcset="http://wp.djtedfunke.com/wp-content/uploads/2019/09/Screenshot-2019-09-18-at-21.47.44.png 704w, http://wp.djtedfunke.com/wp-content/uploads/2019/09/Screenshot-2019-09-18-at-21.47.44-300x248.png 300w" sizes="(max-width: 704px) 100vw, 704px" /></figure>



<hr class="wp-block-separator"/>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How To Modify Admin Post Lists In WordPress</title>
		<link>http://wp.djtedfunke.com/how-to-modify-admin-post-lists-in-wordpress/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Wed, 18 Sep 2019 19:42:22 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Admin]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=206</guid>

					<description><![CDATA[https://www.smashingmagazine.com/2013/12/modifying-admin-post-lists-in-wordpress/]]></description>
										<content:encoded><![CDATA[
<p><a href="https://www.smashingmagazine.com/2013/12/modifying-admin-post-lists-in-wordpress/">https://www.smashingmagazine.com/2013/12/modifying-admin-post-lists-in-wordpress/</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>VC &#8211; Disable row</title>
		<link>http://wp.djtedfunke.com/vc-disable-row/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Sun, 11 Aug 2019 18:38:58 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Visual Composer]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=201</guid>

					<description><![CDATA[Make disable row working in WPBakery &#8211; Visual Composer:]]></description>
										<content:encoded><![CDATA[
<p>Make disable row working in WPBakery &#8211; Visual Composer:</p>



<pre class="wp-block-code"><code>// Disable row
if ( 'yes' === $disable_element ) {
    if ( vc_is_page_editable() ) {
        $css_classes[] = 'vc_hidden-lg vc_hidden-xs vc_hidden-sm vc_hidden-md';
    } else {
        return '';
    }
}</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Slick slider &#8211; Equal Height</title>
		<link>http://wp.djtedfunke.com/slick-slider-equal-height/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Sun, 11 Aug 2019 18:36:44 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[slick slider]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=197</guid>

					<description><![CDATA[Equal height blocks on slick slider:]]></description>
										<content:encoded><![CDATA[
<p>Equal height blocks on slick slider:</p>



<pre class="wp-block-code"><code>.slick-track{
    display: flex;

    .slick-slide{
        display: flex;
        height: auto;
        align-items: center; //optional
        justify-content: center; //optional
    }
}</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SEO Friendly URL</title>
		<link>http://wp.djtedfunke.com/seo-friendly-url/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Mon, 10 Jun 2019 09:50:34 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[seo]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=193</guid>

					<description><![CDATA[Creating SEO friendly URLhttps://blog.ueffing.net/post/2016/03/14/creating-seo-friendly-url/]]></description>
										<content:encoded><![CDATA[
<p>Creating SEO friendly URL<br><a href="https://blog.ueffing.net/post/2016/03/14/creating-seo-friendly-url/">https://blog.ueffing.net/post/2016/03/14/creating-seo-friendly-url/</a></p>



<pre class="wp-block-code"><code>/**
 * prepares a string optimized for SEO
 * @param string $sString 
 * @return string $sString SEO optimized string
 */
function seofy ($sString = '')
{
    $sString = preg_replace ('/[^\pL\d_]+/u', '-', $sString);
    $sString = trim ($sString, "-");
    $sString = iconv ('utf-8', "us-ascii//TRANSLIT", $sString);
    $sString = strtolower ($sString);
    $sString = preg_replace ('/[^-a-z0-9_]+/', '', $sString);

    return $sString;
}

_____

echo seofy('Straßenfest in München');          // => strassenfest-in-muenchen
echo seofy('José Ignacio López de Arriortúa'); // => jose-ignacio-lopez-de-arriortua</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Cookie JS</title>
		<link>http://wp.djtedfunke.com/cookie-js/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Mon, 03 Jun 2019 11:03:01 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=186</guid>

					<description><![CDATA[Custom Cookie banner JS]]></description>
										<content:encoded><![CDATA[
<p>Custom Cookie banner JS</p>



<pre class="wp-block-code"><code>function cookieBanner() {

	var dropCookie = true;                      // false disables the Cookie, allowing you to style the banner
	var cookieDuration = 14;                    // Number of days before the cookie expires, and the banner reappears
	var cookieName = 'complianceCookie';        // Name of our cookie
	var cookieValue = 'on';                     // Value of cookie

	function showBanner(){
		$('#cookie-banner').show('slow');
		
		$('#cookie-banner .cookie-banner_close').on('click', function() {
			$('#cookie-banner').hide('slow');
			createCookie(cookieName,cookieValue, cookieDuration); // Create the cookie
		})
	}
	
	function createCookie(name,value,days) {
		if (days) {
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000)); 
			var expires = "; expires="+date.toGMTString(); 
		}
		else var expires = "";
		if(dropCookie) { 
			document.cookie = name+"="+value+expires+"; path=/"; 
		}
	}
	
	function checkCookie(name) {
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		for(var i=0;i &lt; ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
		return null;
	}
	
	window.onload = function(){
		if(checkCookie(cookieName) != cookieValue){
			showBanner(); 
		}
	}
}
</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>CSS Hover</title>
		<link>http://wp.djtedfunke.com/css-hover/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 09 Apr 2019 18:51:00 +0000</pubDate>
				<category><![CDATA[External]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=179</guid>

					<description><![CDATA[Circle Hover Effects:https://tympanus.net/Tutorials/CircleHoverEffects/index.html Box Caption Hover:https://tympanus.net/Tutorials/CaptionHoverEffects/index.html Image Effects:https://freefrontend.com/css-image-effects/]]></description>
										<content:encoded><![CDATA[
<p>Circle Hover Effects:<br><a href="https://tympanus.net/Tutorials/CircleHoverEffects/index.html">https://tympanus.net/Tutorials/CircleHoverEffects/index.html</a><br><br></p>



<p>Box Caption Hover:<br><a href="https://tympanus.net/Tutorials/CaptionHoverEffects/index.html">https://tympanus.net/Tutorials/CaptionHoverEffects/index.html</a><br><br></p>



<p>Image Effects:<br><a href="https://freefrontend.com/css-image-effects/">https://freefrontend.com/css-image-effects/</a><br></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Anchor link &#8211; Header offset</title>
		<link>http://wp.djtedfunke.com/anchor-link-header-offset/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Sat, 16 Feb 2019 15:19:34 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=168</guid>

					<description><![CDATA[Anchor Link Offset to Other Pages with Fixed Header Size:]]></description>
										<content:encoded><![CDATA[
<p>Anchor Link Offset to Other Pages with Fixed Header Size:</p>



<pre class="wp-block-code"><code>jQuery(document).ready(function($) {

  // set a variable for the anchor link which is the location.hash
  var anchorLink = $(window.location.hash);
    // test to see if the link is a anchor link, if not the length will have no value, this is done to avoid js errors on non anchor links
		if ( anchorLink.length ) {
      // set an element as the fixed entity, header in this case and get its height
			var offsetSize = $("header").innerHeight();
      // fire the animation from the top of the page to the anchor link offsetting by the fixed elements height, the number is the speed of the animation
			$("html, body").animate({scrollTop: anchorLink.offset().top - offsetSize }, 500);
    }

});</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>CSS Browser target</title>
		<link>http://wp.djtedfunke.com/css-browser-target/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Sat, 16 Feb 2019 15:18:21 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=166</guid>

					<description><![CDATA[Targeting browsers to style with CSS:]]></description>
										<content:encoded><![CDATA[
<p>Targeting browsers to style with CSS:</p>



<pre class="wp-block-code"><code>@supports (-ms-ime-align: auto) {
  /* Microsoft EdgeV13&amp;14 CSS styles go here */
  .edge1314 {
    background: green;
  }
  .edge1314::before {
    content: "Active: ";
  }
}
@supports (-ms-accelerator: true) {
  /* Microsoft EdgeV13 CSS styles go here */
  .edge13 {
    background: green;
  }
  .edge13::before {
    content: "Active: ";
  }
}
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
  /* IE10 &amp; IE11 CSS styles go here */
  .ie1011 {
    background: green;
  }
  .ie1011::before {
    content: "Active: ";
  }
}</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Slick Slider load first image</title>
		<link>http://wp.djtedfunke.com/__trashed/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Thu, 31 Jan 2019 14:55:59 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[slick slider]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=162</guid>

					<description><![CDATA[Display only first image of slick on page load]]></description>
										<content:encoded><![CDATA[
<p>Display only first image of slick on page load</p>



<pre class="wp-block-code"><code>.slick_slider {
    overflow: hidden;
    
    .slick_slider__element:nth-child(n+1) {
        display: none;
    }
    
    .slick-initialized,
    .slick_slider__element:first-child { 
        display: block;
    }
}</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Image JPEG Quality</title>
		<link>http://wp.djtedfunke.com/image-jpeg-quality/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Sun, 20 Jan 2019 11:15:38 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Image]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=159</guid>

					<description><![CDATA[Change quality compression of Images:]]></description>
										<content:encoded><![CDATA[
<p>Change quality compression of Images:</p>



<pre class="wp-block-code"><code>function change_jpeg_quality( $quality ) { 
   return 100; 
}
add_filter( 'jpeg_quality', 'change_jpeg_quality' );</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Google Analytics &#8211; GDPR</title>
		<link>http://wp.djtedfunke.com/google-analytics-gdpr/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Sat, 05 Jan 2019 13:40:01 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Google analytics]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=148</guid>

					<description><![CDATA[Adding Google Anyltics code and adding option to disable it:]]></description>
										<content:encoded><![CDATA[
<p>Adding Google Anyltics code and adding option to disable it:</p>



<pre class="wp-block-code"><code>   &lt;!-- Google Analytics -->
    &lt;script async src='//www.google-analytics.com/analytics.js'>&lt;/script>
    &lt;script>
    window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
    ga('create', 'UA-xxxxxx-x', 'auto');
    ga('set', 'anonymizeIp', true);
    ga('send', 'pageview');
    &lt;/script>
    &lt;!-- End Google Analytics -->


    //HTML LINK
    &lt;a class="ga-disable" href="#">Link&lt;/a>
    &lt;a href="javascript:gaOptout()">Link&lt;/a>


    // Set to the same value as the web property used on the site
    var gaProperty = 'UA-xxxxxx-x';
    // Disable tracking if the opt-out cookie exists.
    var disableStr = 'ga-disable-' + gaProperty;
    if (document.cookie.indexOf(disableStr + '=true') > -1) {
        window[disableStr] = true;
    }
    // Opt-out function
    function gaOptout() {
        document.cookie = disableStr + '=true; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/';
        window[disableStr] = true;
        alert('Das Tracking durch Google Analytics wurde in Ihrem Browser für diese Website deaktiviert.');
    }




    jQuery(document).ready(function($) {
        $(".ga-disable").click(function(event) {
            event.preventDefault();
            gaOptout();
        });
    });</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Explode text to repeater (ACF)</title>
		<link>http://wp.djtedfunke.com/explode-text-to-repeater-acf/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Sat, 05 Jan 2019 13:37:45 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[ACF]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=146</guid>

					<description><![CDATA[Explode text by &#8220;,&#8221; and add to fields (ACF repeater) -> VIVI.si recepti:]]></description>
										<content:encoded><![CDATA[
<p>Explode text by &#8220;,&#8221; and add to fields (ACF repeater) -> VIVI.si recepti: </p>



<pre class="wp-block-code"><code>    $('#explode_recepti').click(function(){

        var items = $('#explode_recepti_textarea').val().split(',').length;
        var itemsArray = $('#explode_recepti_textarea').val().split(',');

        for(i=0;i&lt;items;i++){
            $('.acf-field-54dbe3014c9ae .acf-actions .acf-button ').click();
        }

        $('.acf-field-54dbe3014c9ae .acf-table .acf-field-text input').each(function( index , element) {
            
            $(this).val(itemsArray[index]);
        });

    });</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Internal anchor smooth scroll</title>
		<link>http://wp.djtedfunke.com/internal-anchor-smooth-scroll/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Sat, 05 Jan 2019 13:35:51 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Menu]]></category>
		<category><![CDATA[scroll]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=144</guid>

					<description><![CDATA[Internal URL smooth scroll from menu &#8211; anchor link:]]></description>
										<content:encoded><![CDATA[
<p>Internal URL smooth scroll from menu &#8211; anchor link:</p>



<pre class="wp-block-code"><code>        $("a[href*=#]:not([href=#])").click(function() {
            var kliknjeno = $(this);

            var calapse_mobile = kliknjeno.parent().parent().parent().parent();

            if (calapse_mobile.hasClass('collapse')) {
                calapse_mobile.collapse('hide');
            }

            if (!kliknjeno.hasClass( "nohref" )) {
                if (location.pathname.replace(/^\//, "") == this.pathname.replace(/^\//, "") &amp;&amp; location.hostname == this.hostname) {
                    var a = $(this.hash);
                    if (a = a.length ? a : $("[name=" + this.hash.slice(1) + "]"), a.length) return $("html,body").animate({
                        scrollTop: a.offset().top - 30
                    }, 1000), !1
                }
            }

        })</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Menu Dropdown / Submenu</title>
		<link>http://wp.djtedfunke.com/menu-dropdown-submenu/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Sat, 05 Jan 2019 13:34:41 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Menu]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=142</guid>

					<description><![CDATA[Open Submenu:]]></description>
										<content:encoded><![CDATA[
<p>Open Submenu:</p>



<pre class="wp-block-code"><code>    $('ul.desktop_menu li.menu-item-has-children').hover(function() {
        $(this).find('.sub-menu').stop(true, true).delay(100).fadeIn(200);
    }, function() {
        $(this).find('.sub-menu').stop(true, true).delay(100).fadeOut(200);
    });


    //WPML switcher
    $('ul.wpml_switch li.dropdown').hover(function() {
        $(this).find('.dropdown-menu').stop(true, true).delay(100).fadeIn(200);
    }, function() {
        $(this).find('.dropdown-menu').stop(true, true).delay(100).fadeOut(200);
    });</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Sticky Header Scroll</title>
		<link>http://wp.djtedfunke.com/sticky-header-scroll/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Sat, 05 Jan 2019 13:33:51 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Header]]></category>
		<category><![CDATA[Sticky]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=140</guid>

					<description><![CDATA[Sticky Header on Scroll]]></description>
										<content:encoded><![CDATA[
<p>Sticky Header on Scroll</p>



<pre class="wp-block-code"><code>    var showHeaderAt = 300;

    var win = $(window);
    var body = $('body');

    var sticky_visible = false;

    win.on('scroll', function(){

        if(win.scrollTop() > showHeaderAt) {

            if (sticky_visible == false) {
                body.addClass('header-stuck');
                setTimeout(function() {
                    body.addClass('fixed_active');
                }, 100);
                sticky_visible = true;
            }
        }
        else if (sticky_visible == true) {
            body.removeClass('fixed_active');
            body.removeClass('header-stuck');
            sticky_visible = false;
        }

    });</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>To Top Button</title>
		<link>http://wp.djtedfunke.com/to-top-button/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Sat, 05 Jan 2019 13:33:06 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[scroll]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=138</guid>

					<description><![CDATA[Scroll to top Button]]></description>
										<content:encoded><![CDATA[
<p>Scroll to top Button</p>



<pre class="wp-block-code"><code>    if ($('#back-to-top').length) {
        var scrollTrigger = 300, // px
            backToTop = function () {
                var scrollTop = $(window).scrollTop();
                if (scrollTop > scrollTrigger) {
                    $('#back-to-top').addClass('show');
                } else {
                    $('#back-to-top').removeClass('show');
                }
            };
        backToTop();
        $(window).on('scroll', function () {
            backToTop();
        });
        $('#back-to-top').on('click', function (e) {
            e.preventDefault();
            $('html,body').animate({
                scrollTop: 0
            }, 700);
        });
    }</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Check if is Internet Explorer</title>
		<link>http://wp.djtedfunke.com/check-if-is-internet-explorer/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Sat, 05 Jan 2019 13:32:12 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[IE]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=136</guid>

					<description><![CDATA[Checking if is Internet Explorer and run some function:]]></description>
										<content:encoded><![CDATA[
<p>Checking if is Internet Explorer and run some function:</p>



<pre class="wp-block-code"><code>    var ua = window.navigator.userAgent;
    var msie = ua.indexOf("MSIE ");

    var logo_img = $('.logoslider .single-clients img');

    if (navigator.appName == 'Microsoft Internet Explorer' ||  !!(navigator.userAgent.match(/Trident/) || navigator.userAgent.match(/rv:11/)) || (typeof $.browser !== "undefined" &amp;&amp; $.browser.msie == 1)) {

        set_height_ie();

        $(window).resize(function() {
            set_height_ie();
        });

        function set_height_ie() {
            logo_img_sirina = logo_img.width();
            logo_img.height(logo_img_sirina);
        }
    } </code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Google Maps API key enqueue</title>
		<link>http://wp.djtedfunke.com/google-maps-api-key-enqueue/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Sat, 05 Jan 2019 13:29:49 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[google maps]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=134</guid>

					<description><![CDATA[Google maps API key &#8211; Developer key:]]></description>
										<content:encoded><![CDATA[
<p>Google maps API key &#8211; Developer key:</p>



<pre class="wp-block-code"><code>wp_enqueue_script( 'google_js', 'https://maps.googleapis.com/maps/api/js?v=3.exp&amp;key= AIzaSyDieZ7uAY4DPdT3Z4fp4KtykHl6dWryYdw', array('jquery'), '');
</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Replace SVG to inline</title>
		<link>http://wp.djtedfunke.com/replace-svg-to-inline/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 22:14:09 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Image]]></category>
		<category><![CDATA[svg]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=130</guid>

					<description><![CDATA[Replace image SVG to inline SVG]]></description>
										<content:encoded><![CDATA[
<p>Replace image SVG to inline SVG</p>



<pre class="wp-block-code"><code>    $('img.svg').each(function(){
        var $img = jQuery(this);
        var imgID = $img.attr('id');
        var imgClass = $img.attr('class');
        var imgURL = $img.attr('src');

        jQuery.get(imgURL, function(data) {
            // Get the SVG tag, ignore the rest
            var $svg = jQuery(data).find('svg');

            // Add replaced image's ID to the new SVG
            if(typeof imgID !== 'undefined') {
                $svg = $svg.attr('id', imgID);
            }
            // Add replaced image's classes to the new SVG
            if(typeof imgClass !== 'undefined') {
                $svg = $svg.attr('class', imgClass+' replaced-svg');
            }

            // Remove any invalid XML tags as per http://validator.w3.org
            $svg = $svg.removeAttr('xmlns:a');

            // Check if the viewport is set, if the viewport is not set the SVG wont't scale.
            if(!$svg.attr('viewBox') &amp;&amp; $svg.attr('height') &amp;&amp; $svg.attr('width')) {
                $svg.attr('viewBox', '0 0 ' + $svg.attr('height') + ' ' + $svg.attr('width'))
            }

            // Replace image with new SVG
            $img.replaceWith($svg);

        }, 'xml');
    });</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Google Analytics &#8211; tracking</title>
		<link>http://wp.djtedfunke.com/google-analytics-tracking-2/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 22:11:54 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Google analytics]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=128</guid>

					<description><![CDATA[Include the Google Analytics Tracking Code &#8211; WP Functions]]></description>
										<content:encoded><![CDATA[
<p>Include the Google Analytics Tracking Code &#8211; WP Functions</p>



<pre class="wp-block-code"><code>add_action('wp_head', 'wpb_add_googleanalytics');
function wpb_add_googleanalytics() { ?>
    &lt;script type="text/javascript">
        (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
        (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
        m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
        })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

        ga('create', 'UA-166254-45', 'auto');
        ga('send', 'pageview');
    &lt;/script>
&lt;?php }</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Google analytics &#8211; tracking</title>
		<link>http://wp.djtedfunke.com/google-analytics-tracking/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 22:11:17 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Google analytics]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=126</guid>

					<description><![CDATA[Include the Google Analytics Tracking Code (ga.js) &#8211; HEADER]]></description>
										<content:encoded><![CDATA[
<p>Include the Google Analytics Tracking Code (ga.js) &#8211; HEADER</p>



<pre class="wp-block-code"><code>&lt;script async src='https://www.googletagmanager.com/gtag/js?id=UA-40742215-1'>&lt;/script>
&lt;script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){
        dataLayer.push(arguments);
    }
    gtag('js', new Date());
    gtag('config', 'UA-000000-1', { 'anonymize_ip': true });
&lt;/script></code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Htaccess: redirects date</title>
		<link>http://wp.djtedfunke.com/htaccess-redirects-date/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 21:53:59 +0000</pubDate>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[redirect]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=123</guid>

					<description><![CDATA[ADDING Permanent redirections for blog posts without date url prefix:]]></description>
										<content:encoded><![CDATA[
<p>ADDING Permanent redirections for blog posts without date url prefix: </p>



<pre class="wp-block-code"><code>RedirectMatch 301 /([0-9]+)/([0-9]+)/([0-9]+)/(.*)$ https://koerbler.com/blog/$4</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Default gallery link</title>
		<link>http://wp.djtedfunke.com/default-gallery-link/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 21:52:41 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[gallery]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=121</guid>

					<description><![CDATA[Set default gallery link to media file / popup:]]></description>
										<content:encoded><![CDATA[
<p>Set default gallery link to media file / popup:</p>



<pre class="wp-block-code"><code>add_filter( 'shortcode_atts_gallery',
    function( $out ){
        $out['link'] = 'file'; 
        return $out;
    }
);</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Lightbox attribute</title>
		<link>http://wp.djtedfunke.com/lightbox-attribute/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 21:51:54 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Image]]></category>
		<category><![CDATA[Lightbox]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=119</guid>

					<description><![CDATA[Adds lightbox attribute for image popup:]]></description>
										<content:encoded><![CDATA[
<p>Adds lightbox attribute for image popup:</p>



<pre class="wp-block-code"><code>function add_lightbox_rel($content) {
    global $post;
    $pattern = "/&lt;a(.*?)href=('|\")(.*?).(bmp|gif|jpeg|jpg|png)('|\")(.*?)>/i";
    $replacement = '&lt;a$1href=$2$3.$4$5 rel="lightbox" $6>';
    $content = preg_replace($pattern, $replacement, $content);
    return $content;
}
add_filter("the_content", "add_lightbox_rel");
add_filter("acf_the_content", "add_lightbox_rel");

function add_gallery_rel($attachment_link) {
    global $post;
    $attachment_link = str_replace("&lt;a", "&lt;a rel=\"lightbox\"", $attachment_link);
    return $attachment_link;
}
add_filter("wp_get_attachment_link", "add_gallery_rel");</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Unregister post type</title>
		<link>http://wp.djtedfunke.com/unregister-post-type/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 21:51:05 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Post type]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=117</guid>

					<description><![CDATA[Unregister standard post type and taxonomies:]]></description>
										<content:encoded><![CDATA[
<p>Unregister standard post type and taxonomies:</p>



<pre class="wp-block-code"><code>function ryanbenhase_unregister_tags() {
    unregister_taxonomy_for_object_type( 'post_tag', 'post' );
    unregister_taxonomy_for_object_type( 'category', 'post' );
    unregister_post_type( 'post' );
}
add_action( 'init', 'ryanbenhase_unregister_tags' );</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Woocommerce &#8211; Checkbox checkout</title>
		<link>http://wp.djtedfunke.com/woocommerce-checkbox-checkout/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 21:49:06 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Woocommerce]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=114</guid>

					<description><![CDATA[Add privacy policy checkbox checkout:]]></description>
										<content:encoded><![CDATA[
<p>Add privacy policy checkbox checkout:</p>



<pre class="wp-block-code"><code lang="php" class="language-php">add_action( 'woocommerce_review_order_before_payment', 'woo_add_checkout_privacy_policy', 9 );
   
function woo_add_checkout_privacy_policy() {
  
    woocommerce_form_field( 'privacy_policy', array(
        'type'          => 'checkbox',
        'class'         => array('form-row terms wc-terms-and-conditions'),
        'label_class'   => array('woocommerce-form__label woocommerce-form__label-for-checkbox checkbox'),
        'input_class'   => array('woocommerce-form__input woocommerce-form__input-checkbox input-checkbox'),
        'required'      => true,
        'label'         => __( 'Mit deiner Bestellung erklärst du dich mit unseren Allgemeinen &lt;a href="/agb/" target="_blank">Geschäftsbedingungen Widerrufsbestimmungen&lt;/a> sowie &lt;a href="/datenschutz/" target="_blank">Datenschutzbestimmungen&lt;/a> einverstanden.', 'error' )
    )); 
      
}
// Show notice if customer does not tick
add_action( 'woocommerce_checkout_process', 'woo_not_approved_privacy' );
  
function woo_not_approved_privacy() {
    if ( ! (int) isset( $_POST['privacy_policy'] ) ) {
        wc_add_notice( __( 'Die Zustimmung zu unseren Datenschutz und Geschäftsbedingungen (AGB) ist erforderlich.' ), 'error' );
    }
}</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Redirection header</title>
		<link>http://wp.djtedfunke.com/redirection-header/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 21:47:00 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[redirect]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=112</guid>

					<description><![CDATA[Redirect to homepage (e.g. 404):]]></description>
										<content:encoded><![CDATA[
<p>Redirect to homepage (e.g. 404):</p>



<pre class="wp-block-code"><code>header("HTTP/1.1 301 Moved Permanently");
header("Location: ".get_bloginfo('url'));
exit();</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>MCE editor</title>
		<link>http://wp.djtedfunke.com/mce-editor/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 21:46:14 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[editor]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=110</guid>

					<description><![CDATA[Adding sub/sup to standard MCE editor:]]></description>
										<content:encoded><![CDATA[
<p>Adding sub/sup to standard MCE editor:</p>



<pre class="wp-block-code"><code>function my_mce_buttons_2($buttons) {   
    /**
     * Add in a core button that's disabled by default
     */
    $buttons[] = 'superscript';
    $buttons[] = 'subscript';

    return $buttons;
}
add_filter('mce_buttons_2', 'my_mce_buttons_2');</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>WP-AJAX JS VARIABLE</title>
		<link>http://wp.djtedfunke.com/wp-ajax-js-variable/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 21:45:24 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[ajax]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=108</guid>

					<description><![CDATA[Make wp-ajax url variable global:]]></description>
										<content:encoded><![CDATA[
<p>Make wp-ajax url variable global:</p>



<pre class="wp-block-code"><code>function myplugin_ajaxurl() {
    echo '&lt;script>
            var ajaxurl = "' . admin_url('admin-ajax.php') . '";
            var homeurl = "' . get_site_url() . '";
        &lt;/script>';
}
add_action('wp_head', 'myplugin_ajaxurl');</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>WP version</title>
		<link>http://wp.djtedfunke.com/wp-version/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 21:44:08 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=106</guid>

					<description><![CDATA[Hide WP version:]]></description>
										<content:encoded><![CDATA[
<p>Hide WP version:</p>



<pre class="wp-block-code"><code>function remove_version() {
    return '';
}
add_filter('the_generator', 'remove_version');</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Slow Yoast</title>
		<link>http://wp.djtedfunke.com/slow-yoast/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 21:43:35 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Yoast]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=104</guid>

					<description><![CDATA[If Yoast SEO is slow add this to kill the shortcode parsing]]></description>
										<content:encoded><![CDATA[
<p>If Yoast SEO is slow add this to kill the shortcode parsing</p>



<pre class="wp-block-code"><code>add_action( 'wp_ajax_wpseo_filter_shortcodes', function(){
    wp_die( wp_json_encode( array() ) );
}, 1 );</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Heder error</title>
		<link>http://wp.djtedfunke.com/heder-error/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 21:42:43 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=102</guid>

					<description><![CDATA[get_header() Fatal error PHP (boti dostopajo do index.php).Dodamo v index.php namesto get_header():]]></description>
										<content:encoded><![CDATA[
<p>get_header() Fatal error PHP (boti dostopajo do index.php).<br>Dodamo v index.php namesto get_header():</p>



<pre class="wp-block-code"><code>if (function_exists('get_header')) {
    get_header();
} else {
    die();
}</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>ACF admin columns</title>
		<link>http://wp.djtedfunke.com/acf-admin-columns/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 21:38:53 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[ACF]]></category>
		<category><![CDATA[Admin]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=100</guid>

					<description><![CDATA[Custom admin column from ACF field:]]></description>
										<content:encoded><![CDATA[
<p>Custom admin column from ACF field:</p>



<pre class="wp-block-code"><code>function my_page_columns($columns) {
    $columns = array(
        'cb'        => '&lt;input type="checkbox" />',
        'title'     => 'Title',
        'datum'      =>  'Datum dogodka',
        'date'      =>  'Datum objave',
    );
    return $columns;
}

function my_custom_columns($column) {
    global $post;

    if ($column == 'datum') {
        echo get_field( "datum", $post->ID );
    } else {
         echo '';
    }

}
add_action("manage_dogodki_posts_custom_column", "my_custom_columns");
add_filter("manage_dogodki_posts_columns", "my_page_columns");</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Dashboard box</title>
		<link>http://wp.djtedfunke.com/dashboard-box/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 21:38:00 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Admin]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=98</guid>

					<description><![CDATA[Custom info box to WP dashboard:]]></description>
										<content:encoded><![CDATA[
<p>Custom info box to WP dashboard:</p>



<pre class="wp-block-code"><code>add_action('wp_dashboard_setup', 'my_custom_dashboard_widgets');
 
function my_custom_dashboard_widgets() {
    global $wp_meta_boxes;

    wp_add_dashboard_widget('custom_help_widget', 'AM Creative Agency', 'custom_dashboard_help');
}

function custom_dashboard_help() {
    echo '&lt;div style="border:2px solid #ac8d54; background-color: rgba(172, 141, 84, 0.1); padding: 20px 20px 10px 20px; text-align: center;">';
    echo '&lt;a href="http://creativeagency.am" target="_blank">';
    echo '&lt;img src="http://creativeagency.am/wp-content/uploads/2016/05/am_logo_512.png" width="200px;" style="">';
    echo '&lt;/a>';
    echo '&lt;p>Lepo pozdravljeni v sistemu za urejanje vaše spletne strani.&lt;/p>';
    echo '&lt;p>Za pomoč pri upravljanju z vsebino nas lahko kontaktirate na &lt;a href="mailto:info@creativeagency.am">info@creativeagency.am&lt;/a>&lt;/p>';
    echo '&lt;p>Ekipa ';
    echo '&lt;a href="http://creativeagency.am" target="_blank">';
    echo 'AM Creative Agency&lt;/a>';
    echo '&lt;/p>';
    echo '&lt;/div>';
}</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Video Container</title>
		<link>http://wp.djtedfunke.com/video-container/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 21:37:06 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[video]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=94</guid>

					<description><![CDATA[Add responsive container to embeds. Add this to your theme’s functions.php: And next up, we need to add the CSS that makes it responsive to&#8230;]]></description>
										<content:encoded><![CDATA[
<p>Add responsive container to embeds. Add this to your theme’s functions.php:</p>



<pre class="wp-block-code"><code>function alx_embed_html( $html ) {
    return '&lt;div class="video-container">' . $html . '&lt;/div>';
}
add_filter( 'embed_oembed_html', 'alx_embed_html', 10, 3 );
add_filter( 'video_embed_html', 'alx_embed_html' ); // Jetpack</code></pre>



<p>And next up, we need to add the CSS that makes it responsive to our style.css:</p>



<pre class="wp-block-code"><code>.video-container { 
  position: relative; 
  padding-bottom: 56.25%; 
  height: 0; 
  overflow: hidden; 
}

.video-container iframe, 
.video-container object, 
.video-container embed, 
.video-container video { 
  position: absolute; 
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%; 
}</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Default Avatar</title>
		<link>http://wp.djtedfunke.com/default-avatar/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 21:33:11 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Avatar]]></category>
		<category><![CDATA[User]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=92</guid>

					<description><![CDATA[Add default user Avatar:]]></description>
										<content:encoded><![CDATA[
<p>Add default user Avatar:</p>



<pre class="wp-block-code"><code>function customgravatar ($avatar_defaults) {
    $myavatar = get_home_url('Template_directory') . '/images/mycustomgravatar.jpg';
    $avatar_defaults[$myavatar] = "My Custom Logo";
    return $avatar_defaults;
}
add_filter( 'avatar_defaults', 'customgravatar' );</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Rev. Slider Meta box</title>
		<link>http://wp.djtedfunke.com/rev-slider-meta-box/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 21:31:46 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[revolution slider]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=89</guid>

					<description><![CDATA[Remove meta boxes for revolution slider:]]></description>
										<content:encoded><![CDATA[
<p>Remove meta boxes for revolution slider:</p>



<pre class="wp-block-code"><code>if ( is_admin() ) {

    function remove_revolution_slider_meta_boxes() {
        remove_meta_box( 'mymetabox_revslider_0', 'page', 'normal' );
        remove_meta_box( 'mymetabox_revslider_0', 'post', 'normal' );
        remove_meta_box( 'mymetabox_revslider_0', 'YOUR_CUSTOM_POST_TYPE', 'normal' );
    }

    add_action( 'do_meta_boxes', 'remove_revolution_slider_meta_boxes' );
}</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Redirect cookie</title>
		<link>http://wp.djtedfunke.com/redirect-cookie/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 21:30:59 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[cookie]]></category>
		<category><![CDATA[redirect]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=87</guid>

					<description><![CDATA[Redirect if cookie is set]]></description>
										<content:encoded><![CDATA[
<p>Redirect if cookie is set</p>



<pre class="wp-block-code"><code>function my_cookie_redirect() {

  if(isset($_POST['confirm'])){
    $cookie_value = "true";
    setcookie( "AgeAgreed", $cookie_value, 30 * DAYS_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN );

    $confirmano = true;
    wp_redirect(get_bloginfo('url'));
    exit;
  }

  if (!isset($_COOKIE['AgeAgreed']) || $confirmano == true)  {
    global $post;
    $enter_id = icl_object_id(3954, 'page', false);

    if ($post->ID != $enter_id) {
      wp_redirect( get_permalink($enter_id));
      exit;
    }
  }

}
add_action('template_redirect','my_cookie_redirect',0);</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Redirect post type</title>
		<link>http://wp.djtedfunke.com/redirect-post-type/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 21:30:16 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[redirect]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=85</guid>

					<description><![CDATA[Redirects 301 if post type:]]></description>
										<content:encoded><![CDATA[
<p>Redirects 301 if post type:</p>



<pre class="wp-block-code"><code>function post_redirect() {
    global $wp_query;

    if ( is_archive('member') || is_singular('member') ) :
        $url   = get_bloginfo('url');

        wp_redirect( esc_url_raw( $url.'/about-ebla/' ), 301 );
        exit();
    endif;
}
add_action ( 'template_redirect', 'post_redirect', 1);</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SVG support</title>
		<link>http://wp.djtedfunke.com/svg-support/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 21:29:14 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[svg]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=83</guid>

					<description><![CDATA[Adding SVG format: Additional fix:]]></description>
										<content:encoded><![CDATA[
<p>Adding SVG format:</p>



<pre class="wp-block-code"><code>function svg_mime_types( $mimes ) {
    $mimes['svg'] = 'image/svg+xml';
    return $mimes;
}
add_filter( 'upload_mimes', 'svg_mime_types' );</code></pre>



<p>Additional fix:</p>



<pre class="wp-block-code"><code>function fix_mime_type_svg( $data = null, $file = null, $filename = null, $mimes = null ) {
    $ext = isset( $data['ext'] ) ? $data['ext'] : '';
    if ( strlen( $ext ) &lt; 1 ) {
        $exploded = explode( '.', $filename );
        $ext      = strtolower( end( $exploded ) );
    }
    if ( $ext === 'svg' ) {
        $data['type'] = 'image/svg+xml';
        $data['ext']  = 'svg';
    } elseif ( $ext === 'svgz' ) {
        $data['type'] = 'image/svg+xml';
        $data['ext']  = 'svgz';
    }

    return $data;
}

add_filter( 'wp_check_filetype_and_ext', 'fix_mime_type_svg', 75, 4 );</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Excerpt length</title>
		<link>http://wp.djtedfunke.com/excerpt-length/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 21:28:19 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=81</guid>

					<description><![CDATA[Additional options:&#8211; http://smallenvelop.com/limit-post-excerpt-length-in-wordpress/]]></description>
										<content:encoded><![CDATA[
<p></p>



<pre class="wp-block-code"><code>echo substr(get_the_excerpt(), 0,200)."…";</code></pre>



<p>Additional options:<br>&#8211;  <a href="http://smallenvelop.com/limit-post-excerpt-length-in-wordpress/">http://smallenvelop.com/limit-post-excerpt-length-in-wordpress/</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Renaming category</title>
		<link>http://wp.djtedfunke.com/renaming-category/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 21:26:26 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=79</guid>

					<description><![CDATA[Renaming standard post category:]]></description>
										<content:encoded><![CDATA[
<p>Renaming standard post category:</p>



<pre class="wp-block-code"><code>function revcon_change_cat_object() {
    global $wp_taxonomies;
    $labels = &amp;$wp_taxonomies['category']->labels;
    $labels->name = 'Kategorie';
    $labels->singular_name = 'Kategorie';
    $labels->add_new = 'Add Kategorie';
    $labels->add_new_item = 'Add Kategorie';
    $labels->edit_item = 'Edit Kategorie';
    $labels->new_item = 'Kategorie';
    $labels->view_item = 'View Kategorie';
    $labels->search_items = 'Search Kategorien';
    $labels->not_found = 'No Kategorie found';
    $labels->not_found_in_trash = 'No Kategorie found in Trash';
    $labels->all_items = 'Alle Kategorien';
    $labels->menu_name = 'Kategorie';
    $labels->name_admin_bar = 'Kategorie';
}
add_action( 'init', 'revcon_change_cat_object' );</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Renaming Post</title>
		<link>http://wp.djtedfunke.com/renaming-post/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 21:25:43 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=77</guid>

					<description><![CDATA[Renamin standart post post_type:]]></description>
										<content:encoded><![CDATA[
<p>Renamin standart post post_type:</p>



<pre class="wp-block-code"><code>
function revcon_change_post_label() {
    global $menu;
    global $submenu;
    $menu[5][0] = 'Novice';
    $submenu['edit.php'][5][0] = 'Novice';
    $submenu['edit.php'][10][0] = 'Dodaj novico';
}
function revcon_change_post_object() {
    global $wp_post_types;
    $labels = &amp;$wp_post_types['post']->labels;
    $labels->name = 'Novice';
    $labels->singular_name = 'Novice';
    $labels->add_new = 'Dodaj Novico';
    $labels->add_new_item = 'Dodaj Novico';
    $labels->edit_item = 'Uredi novico';
    $labels->new_item = 'Novica';
    $labels->view_item = 'Poglej novico';
    $labels->search_items = 'Išči novice';
    $labels->not_found = 'Ni najdenih novic';
    $labels->not_found_in_trash = 'Ni novic v smeteh';
    $labels->all_items = 'Vse novice';
    $labels->menu_name = 'Novice';
    $labels->name_admin_bar = 'Novice';
}
 
add_action( 'admin_menu', 'revcon_change_post_label' );
add_action( 'init', 'revcon_change_post_object' );

//EN NEWS
function revcon_change_post_label() {
    global $menu;
    global $submenu;
    $menu[5][0] = 'News';
    $submenu['edit.php'][5][0] = 'News';
    $submenu['edit.php'][10][0] = 'Add News';
}
function revcon_change_post_object() {
    global $wp_post_types;
    $labels = &amp;$wp_post_types['post']->labels;
    $labels->name = 'News';
    $labels->singular_name = 'News';
    $labels->add_new = 'Add News';
    $labels->add_new_item = 'Add News';
    $labels->edit_item = 'Edit News';
    $labels->new_item = 'News';
    $labels->view_item = 'View News';
    $labels->search_items = 'Search News';
    $labels->not_found = 'No found News';
    $labels->not_found_in_trash = 'No News in trash';
    $labels->all_items = 'All News';
    $labels->menu_name = 'News';
    $labels->name_admin_bar = 'News';
}
 
add_action( 'admin_menu', 'revcon_change_post_label' );
add_action( 'init', 'revcon_change_post_object' );

</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Disable Admin bar</title>
		<link>http://wp.djtedfunke.com/disable-admin-bar/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 20:58:24 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Admin]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=75</guid>

					<description><![CDATA[Disabling admin bar on frontend]]></description>
										<content:encoded><![CDATA[
<p>Disabling admin bar on frontend</p>



<pre class="wp-block-code"><code lang="php" class="language-php">/* Disable Admin Bar for All Users Except Administrators Using Code */
<code><em>function</em> remove_admin_bar() {
    if (!current_user_can('administrator') &amp;&amp; !is_admin()) {
        show_admin_bar(false);
    }
}
add_action('after_setup_theme', 'remove_admin_bar');</code>


<code>/* Disable WordPress Admin Bar for all users */</code>
<code>add_filter( 'show_admin_bar', '__return_false'</code> <code>);</code></code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Search &#8211; Only post types</title>
		<link>http://wp.djtedfunke.com/search-only-post-types/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 20:53:10 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[search]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=73</guid>

					<description><![CDATA[Enable search only with post types:]]></description>
										<content:encoded><![CDATA[
<p>Enable search only with post types:</p>



<pre class="wp-block-code"><code>function mySearchFilter($query) {
    $post_type = 'page';
    if($query->is_main_query()){
        if ($query->is_search) {
        $query->set('post_type', $post_type);
        }
    }
};
add_action('pre_get_posts','mySearchFilter');</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Disable search</title>
		<link>http://wp.djtedfunke.com/disable-search/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 20:14:55 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[search]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=69</guid>

					<description><![CDATA[// Check deprecated create_function]]></description>
										<content:encoded><![CDATA[
<pre class="wp-block-code"><code>function disable_search( $query, $error = true ) {
  if ( is_search() ) {
    $query->is_search = false;
    $query->query_vars[s] = false;
    $query->query[s] = false;
    // to error
    if ( $error == true )
    $query->is_404 = true;
  }
}

add_action( 'parse_query', 'disable_search' );
// add_filter( 'get_search_form', create_function( '$a', "return null;" ) );</code></pre>



<p>// Check deprecated create_function</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>ACF choices dynamic (revolution slider)</title>
		<link>http://wp.djtedfunke.com/acf-choices-dynamic-revolution-slider/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 20:12:37 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[ACF]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=66</guid>

					<description><![CDATA[Get ACF choices dynamic &#8211; Revolution slider:]]></description>
										<content:encoded><![CDATA[
<p>Get ACF choices dynamic &#8211; Revolution slider:</p>



<pre class="wp-block-code"><code>function acf_load_color_field_choices( $field ) {
    // reset choices
    $field['choices'] = array();
    // get a list of all available sliders
	$my_sliders = new RevSlider();
	// grab the "alias" names of the sliders
	$my_slider_array = $my_sliders->getAllSliderAliases();
	foreach ($my_slider_array as &amp;$value) {
	    $field['choices'][ $value ] = $value;
	}

    return $field;
}

add_filter('acf/load_field/name=revolution_slider_potep', 'acf_load_color_field_choices');</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>ACF settings page</title>
		<link>http://wp.djtedfunke.com/acf-settings-page/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 20:11:02 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[ACF]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=64</guid>

					<description><![CDATA[Adding ACF option admin page]]></description>
										<content:encoded><![CDATA[
<p>Adding ACF option admin page</p>



<pre class="wp-block-code"><code>if( function_exists('acf_add_options_page') ) {
    acf_add_options_page(array(
        'page_title'    => 'Page Settings',
        'menu_title'    => 'Page Settings',
        'menu_slug'     => 'theme-general-settings',
        'capability'    => 'edit_posts',
        'redirect'      => false, //true redirects to the first child!!!
        'position' => 35,
    ));
    
    acf_add_options_sub_page(array(
        'page_title'    => 'Footer',
        'menu_title'    => 'Footer',
        'parent_slug'   => 'theme-general-settings',
    ));     
}</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Disable mail notification</title>
		<link>http://wp.djtedfunke.com/disable-mail-notification/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 20:09:53 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[email]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=62</guid>

					<description><![CDATA[Stop sending admin emails for WP update]]></description>
										<content:encoded><![CDATA[
<p>Stop sending admin emails for WP update</p>



<pre class="wp-block-code"><code>function wpb_stop_update_emails( $send, $type, $core_update, $result ) {
	if ( ! empty( $type ) &amp;&amp; $type == 'success' ) {
		return false;
	}
	return true;
}
add_filter( 'auto_core_update_send_email', 'wpb_stop_auto_update_emails', 10, 4 );</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>WP Login Style</title>
		<link>http://wp.djtedfunke.com/wp-login-style/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 20:06:20 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Admin]]></category>
		<category><![CDATA[Login]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=57</guid>

					<description><![CDATA[How to style a WP Login:]]></description>
										<content:encoded><![CDATA[
<p>How to style a WP Login:</p>



<pre class="wp-block-code"><code>
function my_login_logo() { 

    // wp_enqueue_style( 'admin-css', get_template_directory_uri().'/admin.css' );
    ?>
    &lt;style>
        body {
            background: #ffffff !important;

            /*background image start*/
            background: url("&lt;?php echo get_site_url(); ?>/wp-content/uploads/...") no-repeat center center fixed !important;
            background-size: cover !important;
            -moz-background-size: cover !important;
            -o-background-size: cover !important;
            -webkit-background-size: cover;
            position: fixed;
            top: 0;
            left: 0;
            z-index: 10;
            overflow: hidden;
            width: 100%;
            height: 100%;
            /*background image end*/
            }
            #login_error{
                border-left:4px solid #dd3d36 !important;
            }
            .login .message{
                border-left:4px solid #2ea2cc !important;
            }
            .login form {
                margin-top: 20px;
                margin-left: 0;
                padding: 26px 24px 46px;
                font-weight: 400;
                overflow: hidden;
                background: #0098db !important;
                -webkit-box-shadow: none !important;
                box-shadow: none !important;
                ;
            }
            input#wp-submit {
                background: #ffffff !important;
                border-color: #dddddd !important;
                -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,0.15) !important;
                box-shadow: inset 0 1px 0 rgba(255,255,255,0.15) !important;
                color: #0098db !important;
            }
            #login h1 a {
                background-image: url("&lt;?php echo get_site_url(); ?>/wp-content/uploads/2017/12/activ-logo.svg");
                background-size: cover !important;
                background-position: center top;
                background-repeat: no-repeat;
                color: #999;
                height: 130px !important;
                font-size: 20px;
                font-weight: 400;
                line-height: 1.3em;
                margin: 0 auto 20px;
                padding: 0;
                text-decoration: none;
                width: 321px !important;
                max-width: 320px;
                text-indent: -9999px;
                outline: 0;
                overflow: hidden;
                display: block;
            }
            label[for=user_login], label[for=user_pass], label[for=rememberme] {
                color: #ffffff !important;
            }
            .login #nav {
                margin: 24px 0 0;
                display: none;
            }
            #backtoblog {
                margin: 16px 0 0;
                padding: 0 24px;
                ;
            }
            p#nav > a {
                padding: 0 0 0 24px;
                color: #d8d8d8 !important;
            }
            p#nav > a:hover {
                padding: 0 0 0 24px;
                color: #bababa !important;
            }
            #backtoblog a {
                color: #d8d8d8 !important;
            }
            #backtoblog a:hover {
                color: #bababa !important;
            }
            input[type=text]:focus, 
            input[type=search]:focus, 
            input[type=radio]:focus, 
            input[type=tel]:focus, 
            input[type=time]:focus, 
            input[type=url]:focus, 
            input[type=week]:focus, 
            input[type=password]:focus, 
            input[type=checkbox]:focus, 
            input[type=color]:focus, 
            input[type=date]:focus, 
            input[type=datetime]:focus, 
            input[type=datetime-local]:focus, 
            input[type=email]:focus, 
            input[type=month]:focus, 
            input[type=number]:focus, 
            select:focus, 
            textarea:focus {
                    border-color: #b51923 !important;
                    -webkit-box-shadow: 0 0 2px #b51923 !important;
                    box-shadow: 0 0 2px #b51923 !important;
            }

            .wp-core-ui .button-primary {
                background: #b51923;
                border-color: #b51923;
                -webkit-box-shadow: 0 1px 0 #b51923;
                box-shadow: 0 1px 0 #b51923;
                color: #fff;
                text-decoration: none;
                text-shadow: none !important;
            }
    &lt;/style>
&lt;?php }
add_action( 'login_enqueue_scripts', 'my_login_logo' );


// LOGO URL
add_filter( 'login_headerurl', 'custom_loginlogo_url' );
function custom_loginlogo_url($url) {
    return get_site_url();
}</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>jQuery Document ready</title>
		<link>http://wp.djtedfunke.com/javascript/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 19:49:03 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=52</guid>

					<description><![CDATA[jQuery Document ready:]]></description>
										<content:encoded><![CDATA[
<p>jQuery Document ready:</p>



<pre class="wp-block-code"><code>jQuery(document).ready(function($) {

});</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>CSS</title>
		<link>http://wp.djtedfunke.com/css/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 19:48:47 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=50</guid>

					<description><![CDATA[Css]]></description>
										<content:encoded><![CDATA[
<p>Css</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Enqueue scripts/styles</title>
		<link>http://wp.djtedfunke.com/enqueue-scripts-styles/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 13:00:22 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=46</guid>

					<description><![CDATA[Initial enqueue theme scripts/styles:]]></description>
										<content:encoded><![CDATA[
<p>Initial enqueue theme scripts/styles:</p>



<pre class="wp-block-code"><code>function enqueue_scripts() {   

    wp_enqueue_style( 'flexslider-css', get_stylesheet_directory_uri().'/js/flexslider/flexslider.css' );
    wp_enqueue_script('parodontologija_script', get_stylesheet_directory_uri() . '/js/scripts.js', '1.0.0', true);

}
add_action('wp_enqueue_scripts', 'enqueue_scripts');</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Image Sizes</title>
		<link>http://wp.djtedfunke.com/image-sizes/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Tue, 01 Jan 2019 12:55:56 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=41</guid>

					<description><![CDATA[Register image thumbnails: Backend editor dropdown thumbnail select:]]></description>
										<content:encoded><![CDATA[
<p>Register image thumbnails:</p>



<pre class="wp-block-code"><code>function images_setup() {    
    add_image_size( 'gallery-thumb', 805, 434, true);
}    
add_action('after_setup_theme', 'images_setup');</code></pre>



<p>Backend editor dropdown thumbnail select:</p>



<pre class="wp-block-code"><code>function my_custom_sizes( $sizes ) {
    return array_merge( $sizes, array(
        'gallery-thumb' => __('Gallery Main'),
        ) );
    }
add_filter( 'image_size_names_choose', 'my_custom_sizes' );</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>PHP Debug</title>
		<link>http://wp.djtedfunke.com/debug-config/</link>
					<comments>http://wp.djtedfunke.com/debug-config/#respond</comments>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Wed, 26 Dec 2018 23:15:39 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=1</guid>

					<description><![CDATA[Debug config for config.php:]]></description>
										<content:encoded><![CDATA[
<p>Debug config for config.php:</p>



<pre class="wp-block-code"><code>if ( isset( $_GET['debug'] ) ) {
      define( 'WP_DEBUG', true );
} else {
    define('WP_DEBUG', false);
}</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>http://wp.djtedfunke.com/debug-config/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>User ID condition</title>
		<link>http://wp.djtedfunke.com/user-id-condition/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Mon, 31 Dec 2018 16:35:23 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Admin]]></category>
		<category><![CDATA[User]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=8</guid>

					<description><![CDATA[User ID condition]]></description>
										<content:encoded><![CDATA[
<p>User ID condition</p>



<pre class="wp-block-code"><code>$user_id = get_current_user_id();
if ($user_id == 2) {
    #CODE
}</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Admin Menu &#8211; Edit</title>
		<link>http://wp.djtedfunke.com/admin-menu-edit/</link>
		
		<dc:creator><![CDATA[tadej]]></dc:creator>
		<pubDate>Mon, 31 Dec 2018 16:51:38 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Admin]]></category>
		<guid isPermaLink="false">http://wp.djtedfunke.com/?p=10</guid>

					<description><![CDATA[Admin menu elements: Hide submenu elements]]></description>
										<content:encoded><![CDATA[
<p>Admin menu elements:</p>



<pre class="wp-block-code"><code>function remove_menus(){
  // remove_menu_page( 'index.php' );                  //Dashboard
  remove_menu_page( 'edit.php' );                   //Posts
  // remove_menu_page( 'upload.php' );                 //Media
  // remove_menu_page( 'edit.php?post_type=page' );    //Pages
  remove_menu_page( 'edit-comments.php' );          //Comments
  // remove_menu_page( 'themes.php' );                 //Appearance
  // remove_menu_page( 'plugins.php' );                //Plugins
  // remove_menu_page( 'users.php' );                  //Users
  // remove_menu_page( 'tools.php' );                  //Tools
  // remove_menu_page( 'options-general.php' );        //Settings
}
add_action( 'admin_menu', 'remove_menus' );

//WP Welcome Panel dashboard
remove_action('welcome_panel', 'wp_welcome_panel');

//ACF DISABLE
add_filter('acf/settings/show_admin', '__return_false');</code></pre>



<p>Hide submenu elements</p>



<pre class="wp-block-code"><code>function my_remove_sub_menus() {
    remove_submenu_page('edit.php', 'edit-tags.php?taxonomy=category');
    remove_submenu_page('edit.php', 'edit-tags.php?taxonomy=post_tag');
}
add_action('admin_menu', 'my_remove_sub_menus');</code></pre>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
