How To Conditionally Enqueue Scripts In WordPress

Original Source: http://feedproxy.google.com/~r/1stwebdesigner/~3/NVraCcmIMLU/

There are situations that may arise where you want to load a JavaScript file only on a certain page or pages instead of loading it on every page of the website, primarily because you only want it to run on that page and don’t need it to load on pages where it is not running. Most WordPress themes enqueue (load) their necessary scripts on all pages already, but what if you want to conditionally enqueue scripts or a script instead? This quick tutorial will show you how to do that – to check if you are on a certain page or pages and, if so, load the corresponding script file.

UNLIMITED DOWNLOADS: 500,000+ WordPress & Design Assets

Sign up for Envato Elements and get unlimited downloads starting at only $16.50 per month!

DOWNLOAD NOW

 

WordPress has an abundance of conditional tags built in (see details here). Utilizing these to match the conditions you’re looking for, you can wrap the enqueuing of your script so that it only loads when the condition is met. For instance, if you only wanted the script to run on a page with the slug of ‘mypage’, you would use the conditional tag if(is_page(‘mypage’)) { load that script! } to conditionally enqueue your script only on that page.

Of course, there are a multitude of other conditional tags you can use, found at the link above. Some more common uses may be:

is_single()  – When a single post of any post type (except attachment and page post types) is being displayed, narrowed down by using the post ID, title, slug, or an array of a combination of any of the three.
is_front_page() – When the main blog page is being displayed and the ‘Settings > Reading ->Front page displays’ is set to “Your latest posts”, or when ‘Settings > Reading ->Front page displays’ is set to “A static page” and the “Front Page” value is the current Page being displayed. (Confusing? Click here for more explanation.)
is_home() – This one gets a bit more tricky, but when used correctly it will display your blog posts page. (See here.)
is_category() – When the archive page of a specific category or group of categories is being displayed, narrowed down by using the category ID, name, slug, or an array of a combination of any of the three, plus a few more conditions can be designated.

So let’s move on to how to use these tags to conditionally enqueue scripts in WordPress. Simply open your theme’s functions.php file and add the following code at the bottom.

add_action(‘wp_enqueue_scripts’, ‘firstwd_enqueue’);
function firstwd_enqueue() {
if (is_page(‘mypage’)) {
wp_enqueue_script(‘script-name’, get_template_directory_uri().’/path-to-script-name.js’, array( ‘jquery’ ), ”, true);
}
}

You will need to make sure to change ‘mypage’ to the slug of your page, ‘script-name’ to whatever you want to use as a unique name of the script, and ‘/path-to-name-of-script’ to match the url to the script within your theme’s directory (often something like ‘/assets/js/name-of-script.js’).

Again, refer to the WordPress Codex for all of the variations of tags that you can use to conditionally enqueue scripts in WordPress. be sure to check out our other WordPress tutorials for more quick snippets like this along with more in-depth articles as well.


Monthly Portfolio Inspiration – May 2020

Original Source: http://feedproxy.google.com/~r/abduzeedo/~3/L1h7UUZ47Yo/monthly-portfolio-inspiration-may-2020

Monthly Portfolio Inspiration – May 2020
Monthly Portfolio Inspiration - May 2020

tobiasMay 05, 2020

Hi! I’m Tobias van Schneider. I’m the co-founder of Semplice, a portfolio tool by designers for designers. We’re teaming up with Abduzeedo to share inspiring design portfolios each month. Here we’ll curate the best online portfolios from graphic designers, photographers, product managers, design studios, visual artists and more – all created from scratch using Semplice.

Web design

Andrew Footit

See portfolio →

Henrik & Sofia

See portfolio →

Ken Bam

See portfolio →

Gambade

See portfolio →

Mary Catherine Pflug

See portfolio →

Hello Dave

See portfolio →

Lennert Antonissen

See portfolio →

Zac Ong

See portfolio →

Florian Stumpe

See portfolio →

Stephie Muller

See portfolio →


How To Become A Freelance Graphic Designer If You Are A Student

Original Source: http://feedproxy.google.com/~r/Designrfix/~3/Z1ANAWLMXpo/how-to-become-a-freelance-graphic-designer-if-you-are-a-student

Description: As college students prefer part-time jobs combined with studies, freelancing becomes a great way of making money, and the graphic designer profession can be a good start. Freelance jobs for students: how to become a graphic designer In college, all students are looking to earn extra money, and the most flexible and convenient way […]

The post How To Become A Freelance Graphic Designer If You Are A Student appeared first on designrfix.com.

Collective #604

Original Source: http://feedproxy.google.com/~r/tympanus/~3/Jmit6F7tys8/


Inspirational Website of the Week: Edoardo Smerilli

We are total suckers for these wonderful interactions and distortions! Our pick this week.

Get inspired


The Open Web is Dying

Some very important thoughts by Tony Perez: “The open web is changing dramatically, and not for anything that resembles openness, and the world seems to be ok with it.”

Read it


Our Sponsor
Become a Divi expert and get your own business going

Learn how to develop websites with the most popular WordPress theme in the world and secure your success as a freelancer.

Start learning now


Immersive Section Transition Effect in CSS and JavaScript

Claudia Romano shows how to create an immersive transition effect between sections on a webpage.

Check it out


Are you using SVG favicons yet? A guide for modern browsers.

Antoine Boulanger explains why and how to use SVG favicons.

Read it


What is a resilient website?

An episode of “A Question of Code” with Jeremy Keith where he talks about the concept of “resilient” websites.

Check it out


Trails

A simple geometrical trail to attach to your Three.js object. By Arnaud Svart.

Check it out


The Hero Generator

A very helpful hero section generator made by Sarah Drasner.

Check it out


Rust and Node.js: A match made in heaven

Anshul Goyal explains how you can use Rust to build a native add-on for Node.js.

Read it


Your dark mode toggle is broken

Kilian Valkhof on how most sites do not implement dark mode toggles correctly.

Read it


The 4 Key Steps to Art Direction

Marcus Brown shares his approach to art direction, making iconic striking visual experiences, and the importance of typography and color, at Awwwards Conference Amsterdam.

Watch it


What I wish I knew about React

Ire Aderinokun shares some facts about React she wishes she knew before.

Read it


Faking 3D Elements with CSS

Bradley Taunt shows how to make an element look like a 3D object with some CSS trickery.

Check it out


The CSS “content” property accepts alternative text

Stefan Judis shows how the CSS ‘content’ property allows a way to provide an alternative text.

Check it out


Box Line Text

Box Line Text is a minimalistic virtual whiteboarding tool without visible UI for a clean screencasting experience.

Check it out


Balancing Moods

Great demo by Chris Gannon.

Check it out


Favorite JavaScript single line of code

Favorite JavaScript utilities in just a single line of code.

Check it out


Responsive CSS Grid – Books

Andy Barefoot made this cool book grid demo.

Check it out


Insomnia

A collaborative API design tool for designing and managing OpenAPI specs.

Check it out


Real-World Effectiveness of Brotli

Harry Roberts ananlysis of how effective Brotli, which can be used over Gzip, really is.

Read it


Password Reveal

A fun password reveal effect by Mikael Ainalem.

Check it out


Who can get my blood?

A visualizer demo for blood group compatibility.

Check it out


NONYMOUS

A supercool web experience of an anonymous marketing company.

Check it out


From Our Blog
Morphing Gooey Text Hover Effect

Three gooey morphing hover effects using SVG filters for menu links based on a demo by Graham Pyne.

Check it out

Collective #604 was written by Pedro Botelho and published on Codrops.

How to Contribute to Open Source TypeScript Projects

Original Source: https://www.sitepoint.com/open-source-typescript/?utm_source=rss

If you think of the ideas of open source applied to information in an encyclopedia, you get to Wikipedia – lots and lots of small contributions that bubble up to something that’s meaningful. – Matt Mullenweg

One of my favorite aspects of open source is the fact that anyone can contribute! It’s like “productive volunteering” (if you’ll humor me). It’s a fantastic way to build something bigger than you, give back to the community, and level up your skills.

In this article, we’re going to talk about practical ways for you to get involved in open source TypeScript projects. We’ll first cover assessing your level then jump into how you can find opportunities.

Assessing Your Level

Before you get started contributing to open source, you want to find your comfort level. Where are you at skill-wise? What level of complexity are you wanting to solve? How much time do you want to spend? These are important questions to consider before diving in. This information will guide us during the process of finding opportunities.

To simplify things, we will create three levels:

Level 1
Level 2
Level 3

In each level, we will provide a description and an example contribution for someone at that level. Let’s take a look.

Level 1: New to TypeScript

The first level in our three-level TypeScript skills assessment is for those who are “new to TypeScript.” You might find yourself here if any of this description resonates with you:

You are new to TypeScript. You feel comfortable enough with JavaScript that you decided to give TypeScript a try. You have looked at the docs briefly. Maybe you’ve gone through a tutorial or two and. Maybe you’ve watched a video about TypeScript on YouTube. “Beginner” feels accurate when labeling your TypeScript skills.

Below are a few examples of things you might contribute to while you are at this level:

updates to documentation

open-source libraries
TypeScript Handbook or website
creating links to the TypeScript playground for examples

Level 2: Comfortable with TypeScript

The next level in our system is where I imagine most people self-categorize. Read the description and see if this relates to how you are currently feeling:

You’ve used TypeScript in a few projects. You feel comfortable with TypeScript and understand how to fix general type errors. You’re not an expert when it comes to understanding issues, but you sure know how to find the answer. Maybe you’ve written a handful of interfaces or type aliases. You know a decent number of TypeScript tricks or tips. The compiler isn’t your bestie, but you consider yourselves acquaintances.

At this level, you might feel comfortable contributing in the following ways:

fixing bugs

fixing a type error
making a switch statement exhaustive

adding small features

converting any to the correct type

updating docs with new examples, templates, etc.

contributing to a cheatsheet

Level 3: Ready for TypeScript Challenges

The last level we’ll have is for people who feel quite comfortable with TypeScript and are ready for a challenge! Take a glance at the description below and see if that’s how you would describe your level:

Continue reading
How to Contribute to Open Source TypeScript Projects
on SitePoint.

Branding & Visual Identity for Automotive MediaVentions

Original Source: http://feedproxy.google.com/~r/abduzeedo/~3/UFliPyND6cg/branding-visual-identity-automotive-mediaventions

Branding & Visual Identity for Automotive MediaVentions
Branding & Visual Identity for Automotive MediaVentions

abduzeedoMay 01, 2020

Total Design, Adam Lane and Edwin van Praet shared an incredible branding and visual identity project for Automotive MediaVentions (AMV), a new unique collaboration between DPG Media and Mediahuis, the two biggest Dutch media companies.

Automotive MediaVentions enables car companies to reach Dutch car buyers faster and more efficiently. By combining the strong consumer brands Gaspedaal.nl, AutoTrack and Autowereld.nl to the available data of the two biggest media houses in the Netherlands, Automotive MediaVentions knows how to make the right offer to the right buyer at the right place and time. Automotive MediaVentions is a dynamic brand that accelerates business for its clients in the Dutch automotive industry.

We visualized the movement and acceleration in an animated logo that refers to the automotive industry, the running of an engine, the profile of a car tire. Driven by data, Automotive MediaVentions is always on the move and gives direction to the wishes and requirements of its customers.

Based on the dynamic motion of the Automotive MediaVentions logo we also created a series of typographic animations, helping to guide users through complex material and helping them move forward.

Branding & Visual Identity

Facts

Client: Automotive MediaVentions
Project: Brand, Identity, Motion
Agency: Total Design
Credits

Creative Directors: Edwin van Praet, Martijn van den Brakel
Designers: Adam Lane, Edwin van Praet
Motion Graphics: Adam Lane
Strategy Directors: Eric van den Wildenberg, Martijn Arts
Client Manager: Romée van Lotringen
Desktoppublishing: Arjen Firet
Awards

European Design Awards, Bronze  2020, 
Branding, Motion Logo

For more information visit: http://totaldesign.com


10 Apps For Longer Battery Life on Your Android Phone

Original Source: https://www.hongkiat.com/blog/android-app-save-battery/

You’re using your smartphone for almost everything these days. Though it’s quite convinient, but it does takes a toll on your phone’s battery life. Your phone’s battery life…

Visit hongkiat.com for full content.

Captivating Pixel Art Scenes

Original Source: http://feedproxy.google.com/~r/abduzeedo/~3/S26J6EHZ_oc/captivating-pixel-art-scenes

Captivating Pixel Art Scenes
Captivating Pixel Art Scenes

AoiroStudioApr 30, 2020

When I was surfing on Twitter today, I stumbled across this ‘tweet’ shared by our good friend James White who was reminiscing the early days of ‘design internet’ and how everything used to be about the pixels and the little details. We became so standardized in our principles that we tend to forget what the ‘internet’ used to be. Inspired by this moment of nostalgia, I decided to feature the work of Pixel Jeff, a pixel art who has been making magic for more than 10 years. I have put down a series of movie scenes or simple scenes that you might have come close with. It’s nostalgic, so let us all walk down the memory lane. Thank you Pixel Jeff.

A special kind of nostalgia for those who were there. pic.twitter.com/X9VYjs61OV

— James White (@Signalnoise) April 30, 2020

About Pixel Jeff

Pixel Jeff has been creating pixel art since 2013, specialized in illustrations and motion. You should definitely follow more of his works on his Behance profile.

Personal Site
Behance


10 Programming Habits Developers Should Adopt

Original Source: https://www.hongkiat.com/blog/developer-habits/

These outcomes can bring down our confidence but in fact, they can be solved with proper development practices. Here are 10 worthy habits to invest in to write cleaner and smarter code with less…

Visit hongkiat.com for full content.

Email Personalization: Your Secret To Better Engagement

Original Source: https://www.webdesignerdepot.com/2020/04/email-personalization-your-secret-to-better-engagement/

One of the struggles that marketers face is how to send the right message at exactly the right time to target people in a way that will appeal to them. To solve the problem, businesses need to get themselves acquainted with new technologies and the power of personalization.

In the past few years, digital marketing as we know it has undergone numerous changes, distinguishing itself from the traditional marketing of the past.

With new technologies on the rise, marketing has become easier and smarter, enabling businesses to achieve more than they did. More specifically, the use of AI and machine learning has allowed businesses to refine their marketing campaigns, placing the customer at the center of their operations.

As a channel, email has proven itself…to have the best ROI

However, how can you capture a customer’s attention without being physically there to engage with them and show them that your business is the right place to spend their time and money? One of your best allies to show consumers that you aren’t a faceless brand is none other than email marketing.

As a channel, email has proven itself not only to be convenient for modern consumers, but also to have the best ROI; $55 for every $1 you spend on it.

Your mail campaigns are indeed efficient lead nurturing tools, but everything will be in vain if you don’t target your audience with highly personalized messages.

Why Do Businesses Need Personalization?

Modern consumers receive hundreds of promotional emails on a daily basis. However, some of them end up in their trash without being read. Why?

Well, with the rise of scams, the majority of consumers have trained themselves to identify fake messages and fraudulent content.

As a result, emails that look spammy, impersonal and irrelevant — even if that wasn’t your intention — will eventually end up in users’ trash folders.

This will harm your email deliverability and give you a bad send reputation that will prevent you from reaching your subscribers’ inbox.

To ensure that your email campaigns get the desired open and click-through rates, you have to make sure that your messages are tailored to your subscribers’ needs. That’s where personalization comes in.

Personalized content will show your recipients that your message is unique and not part of a one-size-fits-all email campaign.

Of course, you can’t send every single campaign manually. To save time, marketing automation has enabled businesses to automate the process and deliver numerous campaigns automatically without cutting down on personalization.

To do so, you need a platform to provide you with valuable, real-time insights and powerful personalization tools. If you still haven’t chosen one, you can try one of the available free email marketing services to get an idea of how email personalization works.

Personalization will help your audience see the value of your message, primarily because it will be addressed to them.

Consequently, tailored content will help you get more engagement, build a loyal audience who will anticipate your content, and turn them from subscribers into satisfied customers. As email marketing statistics show, personalization is so powerful that it can increase your open rate even by 29%.

What About Hyper-Personalization?

A simple first name in your emails might be effective, but as marketing evolves, it won’t be enough to attract your subscribers’ attention.

For that, businesses have tried to discover new ways to get their audience to click on their incentives and promote their business development. According to a survey by SmarterHQ 72% of consumers say they now only engage with marketing tailored to their interests.

72% of consumers say they now only engage with marketing tailored to their interests

This consumer tendency has created a new form of personalization called hyper-personalization.

Hyper-personalization leverages data to provide more personalized suggestions and messages that will be tailored to each customer’s needs.

Through this advanced form of personalization, you can improve customer experience and drive your prospects and leads a step further down your marketing and sales funnels.

To make hyper-personalization possible, you need to leverage the power of AI and data. But before you do that, you need to know how to collect customer data and then leverage it through AI and machine learning.

Collecting Customer Data

Your first step to personalizing your marketing is to decide what kind of data you need to collect, and why you need it. Especially after GDPR regulations came to existence and consumers’ rising concerns about data privacy.

Here’s an example from Bulgari’s website, informing visitors about their privacy policy in a fully transparent manner:

This cookie policy is right there, complete with everything one would need to know when viewing a brand’s website, even before signing up.

It will make your prospects feel safe right off the bat since the website not only acknowledges its use of cookies but also gives the prospect an opportunity to review why this happens.

There is, of course, no set of rules regarding the data you may need from a prospect. It could be anything.

Now that you’ve made your privacy policy clear it’s time to start collecting your visitors’ information. In this case, Bulgari has created an efficient form to capture its visitors’ emails and at the same time collect valuable information that will improve their newsletter open and click rate:

Segmenting Your Subscribers

Adding the right input fields into your forms will give your new subscribers an idea of what you’ll do with their information.

Bulgari’s form is a great example that includes all the right fields to collect insight into its audience’s preferences.

After your prospects click on your CTA and join your mailing list, you can start segmenting each subscriber based on their interests and preferences.

Segmentation is one of the most efficient practices to personalize your email content and deliver tailored content that will convert your audience into loyal customers.

For instance, demographic segmentation will help you come up with unique campaigns for your female and male subscribers. Then, you can use their individual data to further personalize the email content based on their interests.

Segmenting your audience, though, is only the beginning to achieve hyper-personalization.

Leveraging the power of AI will help you deliver personalized product recommendations in the form of amazing email campaigns that will convince your audience to click-through and buy more.

How To Use Customer Data The Right Way

The first thing you need to know is how AI enables hyper-personalization. Essentially, it’s how you can fully leverage data to improve your marketing activities.

Machines learn in the same way humans do. By feeding data into the machine and adding more and more scenarios, you’re teaching the platform to distinguish between scenarios and find patterns in a quicker and more accurate manner.

More importantly, the machine is taught to connect past “purchases” and come up with suggestions for a marketing team.

Essentially, the more data the machine can go through, the more scenarios it can come up with and the more prospects it can connect to. This will lead to the creation of a unique buyer persona that will be more accurate than the traditional buyer personas created by marketers.

In the end, the personas you create through AI will be able to provide tailor-made solutions and appeal to the general sentiment of each segment of your audience.

Now that you’ve created your personas and know which segment of your list is interested in which of your products, you can use your promotional content more effectively.

Here’s an example from Matalan that uses a customer’s previous purchase data to come up with a personalized cross-sell email:

With a hyper-personalized email, you’ll be able to target your audience with more accuracy.

The use of data will help you craft more messages that will be personalized and tailor-made. So, when you apply them to the AI-generated user persona you will step up your customer lifecycle marketing efforts effectively.

Takeaway

If you use AI and data correctly, you’ll be able to provide one-on-one content down the line, seeing as AI is able to track and trace the kind of content individuals are most interested in, through social media data, engagement data, and so on.

This will help marketers to create amazing content that will be both valuable and engaging for your new prospects.

What’s more, personalization will enable marketing teams to create something that will feel natural, incentivizing your audience to click on your CTAs and move a step further down your marketing funnel.

Source

p img {display:inline-block; margin-right:10px;}
.alignleft {float:left;}
p.showcase {clear:both;}
body#browserfriendly p, body#podcast p, div#emailbody p{margin:0;}