Do you want to list your upcoming scheduled posts in WordPress?
Showing a list of future scheduled posts to your users can generate a buzz around your content and encourage visitors to return to your website. This can help you improve user interaction and engagement on your blog posts.
In this article, we will show you how to easily display future upcoming posts in WordPress, step by step.
Why Display Future Upcoming Posts in WordPress?
If you have been running a WordPress blog for a while, then you will know that publishing posts at a certain time can get more people to read them.
However, you can’t just sit around and wait for the right time to hit the publish button. That’s why WordPress has a built-in scheduling feature that lets you schedule posts to be published later.
Once you have scheduled the posts on your site, it is also a good idea to show a list of these upcoming articles to create hype around them and increase engagement on your blog.
Displaying future scheduled posts can be especially effective for content like serialized stories, product launches, or event announcements.
It may encourage users to discuss upcoming topics in the comments section, sign up for your newsletter, or even pre-register for events.
Having said that, let’s see how to easily list upcoming scheduled posts in WordPress.
How to Show a List of Scheduled Upcoming Posts in WordPress
You can easily show a list of scheduled upcoming posts on your WordPress site by adding custom code to your theme’s functions.php file. However, making even the smallest error while typing the code can break your site and make it inaccessible.
That is why we recommend always adding custom code using WPCode. It is the best WordPress code snippets plugin on the market that makes it safe and easy to add code to your website.
First, you need to install and activate the WPCode plugin. For detailed instructions, you can see our beginner’s guide on how to install a WordPress plugin.
Note: WPCode has a free plan that you can use for this tutorial. However, upgrading to the pro plan will give you access to more features like a cloud library for code snippets, a CSS snippet option, advanced conditional logic, and more.
Upon activation, visit the Code Snippets » + Add Snippet page from the WordPress dashboard and click the ‘Use Snippet’ button under the ‘Add Your Custom Code (New Snippet)’ option.
This will take you to the ‘Create Custom Snippet’ page, where you can start by adding a name for your code snippet. The name is only for your identification and can be anything you like.
After that, choose ‘PHP Snippet’ as the Code Type from the dropdown menu on the right.
Next, you need to copy and paste the following custom code into the ‘Code Preview’ box:
function wpb_upcoming_posts() {
// The query to fetch future posts
$the_query = new WP_Query(array(
'post_status' => 'future',
'posts_per_page' => 3,
'orderby' => 'date',
'order' => 'ASC'
));
// The loop to display posts
if ( $the_query->have_posts() ) {
echo '<ul>';
while ( $the_query->have_posts() ) {
$the_query->the_post();
$output .= '<li>' . get_the_title() .' ('. get_the_time('d-M-Y') . ')</li>';
}
echo '</ul>';
} else {
// Show this when no future posts are found
$output .= '<p>No posts planned yet.</p>';
}
// Reset post data
wp_reset_postdata();
// Return output
return $output;
}
// Add shortcode
add_shortcode('upcoming_posts', 'wpb_upcoming_posts');
// Enable shortcode execution inside text widgets
add_filter('widget_text', 'do_shortcode');
After that, scroll down to the ‘Insertion’ section and choose the ‘Auto Insert’ mode.
Keep in mind that you will still have to add a shortcode to show a list of upcoming posts on your WordPress website.
Finally, scroll back to the top of the page to toggle the ‘Inactive’ switch to ‘Active’.
Once you do that, simply click the ‘Save Snippet’ button to store your settings.
Display a List of Scheduled Upcoming Posts in the Sidebar of a Classic Theme
To display a list of upcoming posts in the WordPress sidebar, visit the Appearance » Widgets page from the WordPress dashboard. Keep in mind that this option will only be available if you are using a classic (non-block) theme.
Here, you need to click the add block ‘+’ button in the top left corner of the screen to open the block menu.
From here, drag and drop the Shortcode block into the sidebar section. After that, add the following shortcode into the block:
[upcoming_posts]
Next, click the ‘Update’ button at the top to store your settings.
Now, you can visit your WordPress site to view the list of upcoming scheduled posts in action.
Display a List of Scheduled Upcoming Posts in the Full Site Editor
If you are using a block-based theme, then the Widgets menu tab won’t be available for you. In that case, you need to visit the Appearance » Editor page from the WordPress dashboard.
Once the editor opens up, click on ‘Pages’ and then simply choose a page where you want to add the shortcode from the options on the left.
The page of your choice will now be launched in the full site editor. Here, you must click the add block ‘+’ button to open the block menu and add the Shortcode block to the page.
After that, just add the following shortcode into the block:
[upcoming_posts]
Finally, click the ‘Save’ button at the top to store your settings.
Now, simply visit your WordPress site to view the list of scheduled upcoming posts.
Bonus: How to Display Recent Posts in WordPress
Apart from displaying upcoming posts, you may also want to show a list of recently published posts on your WordPress site.
Doing this can help introduce visitors to new content and encourage them to explore your website more.
You can easily display a list of recent posts in WordPress using the Latest Posts block in the Gutenberg editor.
After that, you can further customize this block by adding post excerpts, author name, publication date, or featured image.
With the decline of industry and post-colonial exploitation, Europe should aim to become a global leader in the tech and service industry. But as the EU increasingly complicates the process for startups to thrive, the economic outlook appears bleak.
If you've missed recent AI news, Claude Opus now outperforms GPT-4 in most areas, making it the preferred tool for performance-focused users, many of whom are canceling their OpenAI subscriptions.
However, thats only good news if you are not located in Europe. Due to European Union (EU) regulations, Anthropics Claude 3 is inaccessible within its jurisdictions. This is only a minor example of how the EU inadvertently stifles innovation and jeopardizes its own economic future. This article examines the EU's absurd approach to the digital age, the challenges innovative companies face within its borders, and the necessary changes to prevent the loss of economic stability.
A Bad Place for Start-Ups
One thing the big 5 of tech (Google, Apple, Facebook, Amazon, and Microsoft) have in common? Their American roots. But not only the biggest players in tech are US-based companies. The list of unicornsstartups valued over $1 billionshows that the US is home to 656 out of 1229 global unicorns, or 53%. China follows with 168, or 14%. Germany, France, Spain, the Netherlands, and all other EU countries combined account for just 8.8%, or 108 unicorns.
All 27 EU countries together only represent 8.8% of startups valued over $1 billion
Can you name one European tech company that has brought forth significant innovation in the last decade? Nokias heyday is long past, and Europe has since lost its innovative edge. Once the heartland of the industrial revolution and global industry, Europe has outsourced its manufacturing sectors long ago. Today, only a fraction of Europeans actually produce anything. German car manufacturers are losing ground to Chinese competitors, and all of them put together value far less than Tesla. Not to mention centuries of post-colonialismfinally coming to an end, which will deprive certain European countries of resources that were never actually theirs, yet they felt entitled to and became used to them. E.g. there is not a single gold mine in France, yet the country boasts the worlds fourth largest gold reserves.
Teslas gross revenue vs. other car producers | Source: Hedonova
With no industry, no substantial progress in the tech sector, and growing resistance to post-colonial exploitation, the European economy has lost its pillars. If Europe doesn't redefine itself and fill the vacuum left behind with innovation, it may lose whatever is left of it's economic significance within our lifespan. As someone who has been operating various businesses out of various European countries for 10+ years, I can provide some hints on where the problems lie and how Europe could become a better breeding ground for startups.
Over-Regulation and Suffocating Taxes
Let's look at the central problems:
1) Over-regulation. The EU is predominantly a service economy, and innovation must be the driver of such an economy. Regulation hampers innovation. Entrepreneurs in Europe require a significant amount of time to keep up with new regulations, implementing them, etc. Good tax advisors and lawyers are a must, even for small or one-person companies. Not to mention the loss caused by tight restrictions e.g., due to limited insights because of the GDPR, or a loss of time/progress because of limited access to tech such as Claude. EU legislation such as the new AI Act restricts the deployment of innovative tech for personal and business use across Europe. Absurdly, the same representatives who voted for this legislation, on the pretext of protecting Europe from the dangers of AI, also voted to give themselves dystopian rights e.g., mass-surveillance with real-time facial recognition. This should leave citizens enraged, but for some reason, the heavily subsidized European media hardly mentions such issues, and interest groups find it difficult to raise attention.
2) Tax burden. Income taxes and mandatory social insurance account for half of most people's income in most EU countries. On top of that, VAT rates of 17-27% apply to most purchases. Entrepreneurs are additionally burdened with numerous other fees and taxes, ranging from additional wage costs to tourism tax. All counted together, the total tax burden is shamefully high and makes it extremely difficult for new companies to grow past a certain point. While I believe that the social contract is what makes Europe great, we are facing a situation in which fewer and fewer tax-paying individuals sustain an ever greater tax-fueled apparatus. Some might say the system is factually already broken, and it is only a question of time until the rest of it crumbles under the strain of the inverted age pyramid. Worst of all, much of the tax money is not even used to pay for pensions, education, or social services. A substantial part of the cake is wasted on non-transparent subsidies, crooked government bids, and other forms of cronyism. Otherwise, Europe wouldnt face a poverty rate above 20%.
Combined, the high tax burden, inefficient use of tax money, and an endless forest of new regulations make it much more difficult to successfully operate a company from inside the EU. Hence, for startup founders, especially in the tech sector, Europe is unappealing, and anyone who does their research will go to the US, Hong Kong, Singapore, or elsewhere to start their company.
Europe Has Many Advantages and Must Use Them
These developments make me wish the EU would go back to regulating the bend of bananas and stay out of the innovation sector. However, beyond all cynicism, it is clear Europe has managed to build a system that also has many favorable aspects such as strong workers rights, modern and accessible health care, and great infrastructure. These elements are no obstacles to innovation per se. The question is whether we need a plethora of bureaucrats in Brussels who regulate industries they dont understand, grasp power with dystopian surveillance tech, and squander our taxes.
My recommendation to EU institutions would be to shift their focus towards reducing bureaucratic barriers and strengthening economic ties between member states. And, for heaven's sake, ensure transparency regarding the exact allocation of every tax Euro! This approach would help create a more hospitable environment for startups and individuals alike. As it stands, Europe is moving in the wrong direction and failure to recognize this issue puts the economic future of the entire Union at stake.
Have you ever wondered why some apps feel like a natural extension of your mind, while others leave you scratching your head? The answer is UX design. It’s all about crafting something that feels tailor-made for you, without you even realizing it’s there. Let’s explore some of the top principles at play in great UX […]
How do product teams conduct user research today? How do they leverage user insights to make confident decisions and drive business growth? And what role does AI play? To learn more about the current state of user research and uncover the trends that will shape the user research landscape in 2024 and beyond, Maze surveyed over 1,200 product professionals between December 2023 and January 2024.
The Future of User Research Report summarized the data into three key trends that provide precious insights into an industry undergoing significant changes. Let’s take a closer look at the main findings from the report.
Trend 1: The Demand For User Research Is Growing
62% of respondents who took the Future of User Research survey said the demand for user research has increased in the past 12 months. Industry trends like continuous product discovery and research democratization could be contributing to this growth, along with recent layoffs and reorganizations in the tech industry.
Emma Craig, Head of UX Research at Miro, sees one reason for this increase in the uncertain times we’re living in. Under pressure to beat the competition, she sensed a “shift towards more risk-averse attitudes, where organizations feel they need to ‘get it right’ the first time.” By conducting user research, organizations can mitigate risk and clarify the strategy of their business or product.
Research Is About Learning
As the Future of User Research report found out, organizations are leveraging research to make decisions across the entire product development lifecycle. The main consumers of research are design (86%) and product (83%) teams, but it’s also marketing, executive teams, engineering, data, customer support, and sales who rely on the results from user research to inform their decision-making.
As Roberta Dombrowski, Research Partner at Maze, points out:
“At its core, research is about learning. We learn to ensure that we’re building products and services that meet the needs of our customers. The more we invest in growing our research practices and team, the higher our likelihood of meeting these needs.”
Benefits And Challenges Of Conducting User Research
As it turns out, the effort of conducting user research on a regular basis pays off. 85% of respondents said that user research improved their product’s usability, 58% saw an increase in customer satisfaction, and 44% in customer engagement.
Connecting research insights to business outcomes remains a key challenge, though. While awareness for measuring research impact is growing (73% of respondents track the impact of their research), 41% reported they find it challenging to translate research insights into measurable business outcomes. Other significant challenges teams face are time and bandwidth constraints (62%) and recruiting the right participants (60%).
Growing A Research Mindset
With the demand for user research growing, product teams need to find ways to expand their research initiatives. 75% of the respondents in the Maze survey are planning to scale research in the next year by increasing the number of research studies, leveraging AI tools, and providing training to promote research democratization.
Janelle Ward, Founder of Janelle Ward Insights, sees great potential in growing research practices, as an organization will grow a research mindset in tandem. She shares:
“Not only will external benefits like competitive advantage come into play, but employees inside the organization will also better understand how and why important business decisions are made, resulting in more transparency from leadership and a happier and more thriving work culture for everyone.”
Trend 2: Research Democratization Empowers Stronger Decision-Making
Research democratization involves empowering different teams to run research and get access to the insights they need to make confident decisions. The Future of User Research Report shows that in addition to researchers, product designers (61%), product managers (38%), and marketers (17%) conduct user research at their companies to inform their decision-making.
Teams with a democratized research culture reported a greater impact on decision-making. They are 2× more likely to report that user research influences strategic decisions, 1.8× more likely to state that it impacts product decisions, and 1.5× more likely to express that it inspires new product opportunities.
The User Researcher’s New Role
Now, if more people are conducting user research in an organization, does this mark the end of the user researcher role? Not at all. Scaling research through democratization doesn’t mean anyone can do any type of research. You’ll need the proper checks and balances to allow everyone to participate in research responsibly and effectively. The role is shifting from a purely technical to an educational role where user researchers become responsible for guiding the organization in its learning and curiosity.
To guarantee data quality and accuracy, user researchers can train partners on research methods and best practices and give them hands-on experience before they start their own research projects. This can involve having them shadow a researcher during a project, holding mock interviews, or leading collaborative analysis workshops.
Democratizing user research also means that UX researchers can open up time to focus on more complex research initiatives. While tactical research, such as usability testing, can be delegated to designers and product managers, UX researchers can conduct foundational studies to inform the product and business strategy.
User Research Tools And Techniques
It’s also interesting to see which tools and techniques product teams use to gather user insights. Maze (46%), Hotjar (26%), and UserTesting (24%) are the most widely used user research tools. When it comes to user research methods, product teams mostly turn to user interviews (89%), usability testing (85%), surveys (82%), and concept testing (56%).
According to Morgan Mullen, Lead UX Researcher at User Interviews, a factor to consider is the type of projects teams conduct. Most teams don’t change their information architecture regularly, which requires tree testing or card sorting. But they’re likely launching new features often, making usability testing a more popular research method.
Trend 3: New Technology Allows Product Teams To Significantly Scale Research
AI is reshaping how we work in countless ways, and user research is no exception. According to the Future of User Research Report, 44% of product teams are already using AI tools to run research and an additional 41% say they would like to adopt AI tools in the future.
ChatGPT is the most widely-used AI tool for conducting research (82%), followed by Miro AI (20%), Notion AI (18%), and Gemini (15%). The most commonly used research tools with AI features are Maze AI (15%), UserTesting AI (9%), and Hotjar AI (5%).
The Strengths Of AI
The tactical aspect of research is where AI truly shines. More than 60% of respondents use AI to analyze user research data, 54% for transcription, 48% for generating research questions, and 45% for synthesis and reporting. By outsourcing these tasks to artificial intelligence, respondents reported that their team efficiency improved (56%) and turnaround time for research projects decreased (50%) — freeing up more time to focus on the human and strategic side of research (35%).
The Irreplaceable Value Of Research
While AI is great at tackling time-consuming, tactical tasks, it is not a replacement for a skilled researcher. As Kate Pazoles, Head of Flex User Research at Twilio, points out, we can think of AI as an assistant. The value lies in connecting the dots and uncovering insights with a level of nuance that only UX researchers possess.
Jonathan Widawski, co-founder and CEO at Maze, sums up the growing role that AI plays in user research as follows:
“AI will be able to support the entire research process, from data collection to analysis. With automation powering most of the tactical aspects, a company’s ability to build products fast is no longer a differentiating factor. The key now lies in a company’s ability to build the right product — and research is the power behind all of this.”
Looking Ahead
With teams adopting a democratized user research culture and AI tools on the rise, the user researcher’s role is shifting towards that of a strategic partner for the organization.
Instead of gatekeeping their knowledge, user researchers can become facilitators and educate different teams on how to engage with customers and use those insights to make better decisions. By doing so, they help ensure research quality and accuracy conducted by non-researchers, while opening up time to focus on more complex, strategic research. Adopting a research mindset also helps teams value user research more and foster a happier, thriving work culture. A win-win for the organization, its employees, and customers.
At WPBeginner, we have been on both sides of affiliate marketing as affiliate marketers and as businesses running affiliate programs.
With over a decade of expertise, we have encountered all types of affiliate marketing scams and frauds.
While most folks in the affiliate business are honest, hardworking people, there are always people trying to make a quick buck at the expense of others.
Here, we’ll discuss some of the top affiliate marketing scams and how to avoid them. We’ll talk about it from both perspectives as a business owner and as an affiliate marketer.
How Do Affiliate Marketing Scams Affect Businesses?
Affiliate marketing scams try to steal from businesses by pretending to be affiliate marketers. Similarly, they may also defraud unsuspecting affiliate marketers by pretending to be a legitimate business.
Thousands of people make money online with affiliate marketing. It is a lucrative industry worth over $17 billion (Source).
Due to the low barrier of entry, good payouts, and higher returns on invested time and resources, it attracts many businesses and marketers.
However, this success also attracts many bad actors who want to profit by scamming and defrauding affiliate marketers and businesses running affiliate programs.
For these reasons, affiliate marketers and businesses may struggle to distinguish between legitimate opportunities and scams:
Financial loss – Affiliate marketing scams may use deceptive practices to hijack ads, change payment terms, or block payments, causing financial loss to marketers.
Reputational Damage – Some scammers create fake websites, advertisements, and landing pages pretending to be from a legitimate business. This causes harm to the business’s reputation.
Legal Damages – Some affiliate marketing scams may promote illegal products or fraudulent activities. This can lead to legal consequences and damage the affiliate’s personal and professional standing.
Increased Skepticism – Due to encountering scams, affiliate marketers may become more skeptical and hesitant to join new programs or promote certain products. This can limit their opportunities for legitimate partnerships and revenue generation. Similarly, businesses may find it difficult to trust affiliate marketers if they have been deceived by fraudulent actors in the industry.
However, this can be mitigated by carefully researching an affiliate program’s terms and conditions. Before signing up, you can also look for the common shady tactics scammers use.
Here are some of the most common affiliate marketing scams you should avoid.
Common Affiliate Marketing Scams Targeting Affiliate Marketers
Scammers often target affiliate marketers to promote illegal or dubious products with little to no payout in return.
Here are some of the most common scams targeted at affiliate marketers.
1. Get Rich Quick Schemes
Get-rich-quick schemes are perhaps the industry’s most common and longest-running affiliate marketing scam.
They promise affiliate marketers a much higher commission for promoting their products with dubious promises and big claims about earning potential.
These scams can be harder to identify. Many niches in the affiliate industry offer higher incentives, and it is not uncommon to make big claims even by legitimate businesses.
These scams differ because they often sell questionable products with little to no value. These programs have their terms and conditions set up so that they end up paying nothing to the affiliate marketers.
How to Identify This Scam:
These businesses often make big promises of incredibly high earning potential. They are often selling dubious products with little to no value. Their affiliate program is not transparent, and terms and conditions are often vague or have hidden clauses to avoid any payment.
2. Fake Products
Another common scam targeting affiliate marketers is fake products. These scammers would sell a cheap (and often illegally obtained) copy of a legitimate product by a recognized brand.
However, often, they don’t even deliver the cheap copy and just steal money from the customers.
Another variation of this scam involves digital products. After customers have paid up, there is no product to download or access, and the company’s customer support is non-existent.
On the other end of things, these scammers will also simply refuse to issue any payment to the affiliate marketers, meaning they get money for nothing.
How to Identify This Scam:
Fake products are often shown by copying an existing brand or business. Their pricing would be lower than the actual products to lure customers into believing they are getting a cheaper deal. Do your research about the product, search for real reviews, or dig into background information of the business.
3. Pyramid Schemes and Multi-level Marketing Programs
Pyramid schemes or they’re modern name, multi-level marketing (MLM) are scams dating back to pre-internet days. It is still effectively used to target innocent people.
They target affiliate marketers by asking them to recruit investors into often imaginary, fake, or shoddy products. Marketers are promised a commission on each new sign-up that their recruits or people they bring in make.
Eventually, it becomes impossible to find new recruits, and the whole scheme fails. These scammers then go ahead and launch the scheme with different names.
Even if there is a real product being sold, a MLM company floods the market with affiliates, meaning no one makes any meaningful money and saturates the market.
How to Identify This Scam:
These scams often ask you to promote a fake business or product like a get-rich-quick scheme, dietary supplements, or cheaply made fake products. You will be promised higher payouts when people you bring in recruit more people. You may also be asked to deposit a joining fee, which they may label as an investment.
4. Pay to Join Affiliate Programs
Another common scam is to ask for you to pay a fee to join an affiliate program. These pay-to-join programs will claim that they run an exclusive affiliate partnership program, and in order to ensure that only serious marketers join their program, they need you to make a small payment.
Such programs will pretend to sell high-value items and promise to offer unrealistically high commissions.
All genuine affiliate programs are free to join. It is possible that some affiliate programs may require you to demonstrate product knowledge or industry expertise, but they would never ask you to pay them in order to promote their products.
How to Identify This Scam:
The most obvious sign of this scam is that they will ask you to make a payment. Some may even want you to pay with Bitcoin so the transaction can’t be reversed or traced back. If you are asked to make any payment just to join an affiliate program, then it is most likely a scam.
5. Fake Gurus and Influencers
Another popular scam is when you are asked to promote a fake guru or social media influencer. These fake influencers or self-claimed gurus often pretend to be experts in something and typically sell courses and 1-on-1 training sessions.
You may be asked to bring in unsuspecting customers and will be promised a lucrative commission when they sign up for the course, follow the influencer on social media, or join an email list.
These scammers would then sell customers useless courses with little to no value. They would refuse to pay affiliate marketers by not recognizing any leads or conversions they bring.
On the other hand, there are legitimate experts in various industries selling online courses and mentorship programs. This makes it harder for affiliate marketers to distinguish between legitimate businesses and scammers.
How to Identify This Scam:
These scammers usually have no track record of their supposed expertise. Their testimonials would sound phony and unverifiable. They would use pushy tactics to make sales, and most of their followers on social media profiles would be bot accounts.
6. Phishing Scams
Another way scammers target affiliate marketers is by using phishing tactics to steal sensitive information.
They create fake websites or emails that appear to be from legitimate affiliate programs, tricking affiliates into providing login credentials or personal information.
Besides fake websites and emails, scammers may also target affiliate marketers on social media websites and messaging apps. They may use brand images of popular affiliate platforms to deceive victims into believing that they are talking to an official account.
How to Identify This Scam:
Ensure that you are visiting a legitimate website. If you are unsure, then close your browser window and try to reach the actual website manually. Any email account asking you to visit a website should be sifted through. Don’t provide any login information to any fake website.
Common Affiliate Marketing Scams Targeting Businesses
If you are a business running an affiliate program to generate more sales, then you may be targeted by scammers in a number of ways.
Here are some of those common scams to look out for:
1. Fraudulent Transactions
Scammers may target a business by generating fake sales using stolen credit cards, dummy payment accounts, and other fraudulent techniques.
Once a sale is generated, they are qualified for commission. However, your business may pay a refund or chargeback on the fake transaction.
More sophisticated scammers may even attempt to manipulate your conversion tracking data to credit them for more sales.
How to Identify This Scam:
The easiest way to detect this scam is by monitoring your refund and chargeback requests. However, this could be due to customers being genuinely unsatisfied with their purchase.
You can look for patterns to detect fraudulent activities causing higher refunds. Compare the refund rates of suspected affiliates with other affiliates to detect suspicious activity.
2. Cookie Stuffing
This is a sophisticated affiliate marketing scam targeting businesses that run an affiliate program.
Here is how it works, the scammers use phishing tactics, malware, and popups to install cookies with their affiliate tracking IDs on unsuspecting users. After that, when users visit the website and make a purchase, these marketers earn a commission.
These cookies are often set never to expire unless a user deletes all cookies in their browser. The user would have never interacted with the affiliates’ content and wouldn’t even be referred by their URL.
How to Identify This Scam:
This sort of scam is harder to identify. However, depending on your affiliate management program, it may automatically detect fraudulent activities. You also need to monitor your conversions in Google Analytics to find suspicious URLs and activities.
Many affiliate programs only allow marketers to send traffic from a pre-approved list of websites, and any conversions not originating from their approved websites are discredited.
3. Google Ad Keyword Hijacking
Another problematic affiliate scam that affects businesses is Google Ad Keyword Hijacking.
Basically, the scammers sign up for an affiliate program and run Google ads on brand keywords or keywords where your business may already be advertising.
This increases your cost to bid on those keywords, and you end up paying additional commission to a source of traffic that you could have acquired yourself by running the ads.
An even more problematic situation arises when these scammers first redirect the users to their websites before sending them to yours. This makes it harder for you to detect fraudulent activity for a longer period of time.
How to Identify This Scam:
Monitor your top keywords for PPC ads on Google. The easiest way to do this is by using a search marketing tool like Semrush.
Another way to identify this scam is to monitor your website traffic and look for unusually high-traffic sources. You can also carefully monitor affiliate activity to look out for unusually high conversions, sudden jumps in referral traffic, and other signs of suspicious activity.
4. Fake Leads
Fake leads can be a problematic affiliate scam for businesses paying affiliate marketers to bring in leads.
Scammers can generate fake leads using sophisticated techniques like stolen user data, unverified leads bought from third-party sources, or simply paying someone to create fake user accounts.
More sophisticated scammers may even send bot traffic from their legitimate-looking websites. These bots then fill in forms with fake user data to submit a lead.
How to Identify This Scam:
One way to thwart fake leads is by requiring customers to double opt-in. Another way to detect quality leads is by reaching out to customers.
If more leads appear to be non-existent, you can dig deeper and find the affiliate accounts sending those leads.
Look for your affiliate reports to find patterns like a website sending a specific number of leads per day could be a sign of fake leads.
5. Click Frauds
Businesses running pay-per-click affiliate programs are vulnerable to click fraud. Scammers can use a wide variety of techniques to generate fake clicks and traffic.
Some of these techniques use automated bots to click on links. These bots may use IP spoofing and appear as legitimate traffic in your analytics or affiliate marketing reports.
Other scammers may use click farms, where scammers pay pennies to click farms where actual humans click on links as part of their job. These click farms may use hacked computers worldwide to generate those clicks.
How to Identify This Scam:
Monitoring your Google Analytics reports can help you look for signs of click fraud. You can look for suspicious traffic sources, traffic coming from random places, low conversion rates than the industry average.
Keep track of IP addresses to look for signs of click fraud. Your affiliate management software may also provide tools to detect and prevent click fraud.
6. URL Hijacking
Another common scam targeting businesses is when an affiliate partner registers similar domain names or misspelled URLs.
For instance, if a business’s website is a stargardeningtools.com, the scammers may register stargardiningtools.com or similar domains.
This scam is also called domain squatting. It can be easily tracked by looking at referral domains in Google Analytics. However, some of these affiliates may set up dubious redirects to ensure that the squatted domain doesn’t appear as a referral domain.
How to Identify This Scam:
You can track most such tactics by regularly monitoring the referral domains in Google Analytics. Also looking for traffic sources that look suspicious can be helpful. Sometimes, these traffic sources may not have any content promoting your products and services.
Avoiding Affiliate Marketing Scams Tips and Tricks
Following are some handy tips that will help you avoid common affiliate marketing scams both as a marketer and as a business.
1. Join Reputable Affiliate Platforms
Join the top affiliate networks and platforms to work with top businesses, best products, and legitimate affiliate marketers.
Platforms like ShareASale, Impact, and Amazon offer a large number of products and businesses to promote. They also help businesses partner up with the best marketers, handle payouts, and prevent fraud.
However, these programs cost money and may reduce the profitability of your business.
Luckily, there are platforms like AffiliateWP. It is the best affiliate tracking and management software that runs on top of WordPress.
AffiliateWP comes with easy affiliate management, advanced fraud detection, easy payouts, and no middleman fees.
Another excellent alternative is EasyAffiliate. Similar to AffiliateWP, it runs on top of WordPress and allows you to manage and run your own affiliate program.
2. Monitor Your Website Traffic
Whether you are an affiliate marketer or an affiliate manager, monitoring your website traffic regularly helps you detect and prevent fraud and scams.
The easiest way to do this is by installing MonsterInsights. It is the best Google Analytics plugin for WordPress and helps you easily track your website traffic.
MonsterInsights has features like eCommerce tracking, conversion tracking, outbound link tracking, and more. Plus, it helps you easily see where your traffic is coming from and what those users do while visiting your site.
3. Use Better Link Management Tools
As an affiliate marketer, you will need tools to manage all your affiliate links easily. This helps you insert links easily and increase your earnings, but it will also help you track link performance and detect your clicks.
ThristyAffiliates helps you detect broken affiliate links, track link clicks, set up redirects, and cloak affiliate links.
Another excellent alternative is PrettyLinks. It is a link management tool for WordPress. It allows you to shorten affiliate links, cloak links, manage all your links, and easily insert them in your website.
The following are some of the most commonly asked questions about affiliate marketing scams by our users.
1. Is affiliate marketing risky?
Affiliate marketing is just as risky as other type of marketing strategies. Due to the increasing number of fraudulent activities and scams, it may give an impression of being risky. However, most of these affiliate marketing scams can be easily avoided. Affiliate marketing still provides excellent opportunities for publishers to make money online and businesses to promote their products and services.
2. Is affiliate marketing similar to pyramid schemes?
No, affiliate marketing is not similar to pyramid schemes. Unlike pyramid schemes, affiliate programs are free to join, and affiliate marketers are paid to bring in customers. However, some pyramid schemes may present themselves as an affiliate program in order to appear legitimate.
3. Is it possible to avoid affiliate marketing scams altogether?
Yes, it is possible to avoid affiliate marketing scams by joining reputable affiliate platforms and carefully selecting affiliate marketers, products, and businesses that you work with.
We hope this article helps you avoid common affiliate marketing scams. You may also want to explore these low online business ideas or take a look at these additional ways to make money online.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
HTMX and WordPress might not seem like a good match, especially when there's a reliance on PHP and React in some places.
However, the lightweight JavaScript library lets you create dynamic, interactive web pages without the need for complex front-end frameworks. Whenever you require glitch-free functionality, HTMX could be the answer.
Backups are the most important security step and are often the most neglected by website owners.
Manually backing up a WordPress database is a quick and easy way to download all your WordPress data. It is not a complete WordPress website backup, but it is handy for recovering a WordPress site.
In this article, we will show you how to back up a WordPress database manually.
Here is a quick overview of the topics we will cover in this tutorial:
When and Why Make a WordPress Database Backup Manually?
You should always install and set up a WordPress backup system for your site. This allows you to restore your site should something go wrong.
There are several situations when you may need to manually back up a database.
For instance, you could be making some big changes to your WordPress website and just to be on the safe side, you want to have a database backup.
If you have access to the admin area of your website, then you can use a plugin to make an on-demand database backup (We will show you how and which plugin to use later in this article).
On the other hand, in some instances, you may not have access to the admin area of your WordPress website.
Note: There is also a free version of Duplicator, which can be used to create database backups. We recommend upgrading to the paid version because it offers more features.
Upon activation, you need to go to the Duplicator Pro » Packages page and click on the ‘Create New’ button.
On the next screen, Duplicator allows you to choose what you want to include in the backup.
Select ‘Database Only’ and then click on the ‘Next’ button.
Duplicator will now scan your WordPress site and database.
After that, it will show you the scan results. There may be a notice next to the Database section informing you that you are creating a database-only package.
Click on the ‘Build’ button to continue.
Duplicator will now prepare your database backup in the background and show you the progress.
Once finished, you will be able to download the backup files. We recommend downloading both Archive and Installer files. This will allow you to restore your website more easily.
2. Backing Up WordPress Database Manually Using phpMyAdmin
For this method, we will be using phpMyAdmin. It is an open-source software that allows you to manage your MySQL database using a web-based interface.
For the sake of this article, we will show you screenshots from Bluehost. However, the basic procedure is the same for most hosting providers.
First, you need to log in to your WordPress hosting control panel and click on the ‘Settings’ button under your website.
Under your website settings, scroll down to the Quick Links section.
Next, click on the ‘phpMyAdmin’ button to continue.
This will launch the phpMyAdmin app in a new browser tab.
From here, click to select your WordPress database from the left column and then click on the ‘Export’ button at the top.
You will be asked to select the export method.
Next, you need to select ‘Custom’, as it will give you more options to explore.
Once you choose the Custom option, it will show all your tables in your WordPress database as selected.
Sometimes, WordPress plugins add their own tables to your database. If there are any tables that you would like to exclude from export, then you can deselect them. If you are unsure, it is better to keep them all selected.
You now need to scroll down to the ‘Output’ section.
By default, phpMyAdmin will show you the output of the export process as text.
You need to change that by selecting the ‘Save output to a file’ option.
For compression, you must select the zipped or gzipped option.
Now, you need to scroll down to the bottom of the page and click on the ‘Go’ button. phpMyAdmin will now send you the database export as a zip or gzip file.
That’s all. You have successfully made a manual WordPress database backup.
3. Creating a Manual WordPress Database Backup From cPanel
Most good WordPress hosting companies also offer easy ways to download on-demand backups. Here is how to make a manual WordPress database backup from your hosting dashboard.
For the sake of this tutorial, we will show you screenshots of Bluehost. However, the basic procedure is quite similar for other hosts.
First, log in to your hosting account dashboard and click on the ‘Settings’ button under your website.
On the next screen, you need to switch to the ‘Advanced’ tab.
From here, simply scroll down to the cPanel section and click the ‘Manage’ button.
This will launch the cPanel interface in a new browser tab.
From here, just scroll down to the files section and click on the ‘Backup’ button.
On the backups page, scroll down to the partial backups section.
From here, you need to click on your database name to download your database backup file.
You can also download the backup of your WordPress files from this page if you need to.
Restoring a WordPress Database Backup
Once you have downloaded the WordPress database backup, you can continue fixing your hacked WordPress site or make any other changes you need to.
In many cases, you probably won’t need to restore your website from the backup.
But in case you do, we have a detailed step-by-step guide on restoring WordPress from backup. It covers all common WordPress backup options including restoring from a database backup.
Set Up a Proper Automated Backup System for the Future
You can make WordPress database backups manually, but keep in mind that this is not an alternative to a proper backup solution for your WordPress site.
There are situations when you may not have access to your WordPress database. For example, this can happen if your hosting company suspends your account or loses your website data.
Another possible scenario is when some hacker injects malicious code into your WordPress database. Cleaning an infected database will be a lot more difficult.
That’s why we suggest using a proper backup plugin to store your WordPress database backups on the cloud automatically.
We recommend using Duplicator. It automatically creates and stores your backups on a cloud storage service like Google Drive, Dropbox, OneDrive, and more.
Recently, our users have asked our thoughts on the best video conferencing software for small businesses.
With many teams working remotely, having a video conferencing solution is essential for firms. It allows you to communicate with team members and clients over video from all around the world.
In this article, we will show you the best video conferencing software so you can pick the right solution for your website.
How to Choose the Best Video Conferencing Software
Video conferencing software helps improve business communication by allowing participants to connect via video. Whether you have a fully remote team or have client dealings from around the world, a video chatting solution is essential for meetings in today’s world.
When choosing a video chat solution for your business or WordPress site, there are multiple things to look for. Plus, the size of your team and your budget also play a key role in picking the right software for your business.
Here are some key factors to look for when choosing a video conferencing solution:
Video and Audio Quality – One of the most important things to look for is the reliability and quality of video and audio during meetings.
Ease of Use – Another important factor to consider is how easy it is to connect to meetings, schedule meetings, integrate it with a calendar, share call links, and more. The right software should be beginner-friendly and should not have a huge learning curve.
Number of Participants Allowed – Many platforms have a limit on how many members can join a video conference. You should look for a solution that allows a maximum number of participants.
Video Recording & Additional Features – The right video conference solution should go beyond offering basic features of video calling. For instance, look for video recording options, collaborative features like whiteboards, screen sharing, mobile apps, and more.
That said, let’s look at some of the best video conferencing software you can pick for your business.
RingCentral is the best video conferencing software in the market. The VoIP phone service offers powerful features that let you connect teams and clients via video without any interruption.
You get features like video call scheduling, secure meeting hosting, screen sharing, whiteboard, breakout rooms, meeting recordings, and more. RingCentral supports up to 200 participants in a single meeting and lets you expand the capacity even further with addons.
Other than that, the video conferencing software offers advanced meeting insights, live transcription, AI-powered noise reduction, presentation mode, webinars, and more.
One of the standout features of RingCentral is that it easily integrates with third-party tools like Slack, Microsoft 365, Google Workspace (G Suite), and more. You even get apps for iOS and Android, so your team can attend video calls on the go.
Pros:
Powerful video conferencing features
Up to 200 meeting participants
Seamless integrations
Apps for desktop, mobile, and tablet
Powerful real-time analytics
AI-powered noise reduction
Join calls without installing software or creating an account
Cons:
Lacks social media integration
Why We Recommend RingCentral: If you’re a small to medium sized business that’s looking for a video conferencing solution, then we highly recommend RingCentral. It is packed with features and makes it very easy to set up video conferencing for your business.
Pricing: RingCentral prices start from $20 per month per user, and you can invite up to 100 participants.
Nextiva is a popular business phone service that offers a video conferencing feature. It is a cloud-based platform that helps businesses of all sizes solve their phone needs.
With Nextiva, you get desktop and mobile apps, so your team members can connect remotely from anywhere. It also provides high-quality video and audio during meetings.
Other features offered by Nextiva include screen sharing, file sharing, whiteboard, live streaming, and webinar support.
Besides that, Nextiva also provides a toll-free number, dedicated apps for different devices, call forwarding, live chat, CRM, call analytics, advanced interactive voice response (IVR), internet FAX, and more.
Note: We use Nextiva at WPBeginner for our business phone service. In our experience, Nextiva is the best small business phone system in the market from both features and pricing points of view.
Why We Recommend Nextiva: We highly recommend Nextiva to small businesses that need an enterprise-level business phone service with a video conferencing feature at affordable prices.
Pricing: Nextiva prices start from $14.95 per user per month.
It is an excellent solution for small businesses and teams that need a video conferencing solution. You can use a Google account to create a free video conference and invite up to 100 participants for up to 60 minutes at no cost.
The best part about using Google Meet is that you get to use it with other Google products. For instance, it easily integrates with Google Calendar, Sheets, Docs, and more. You can also use a professional business email address and cloud storage.
Google Meet offers high-quality video calls, noise cancellation features, live captions, presentation mode, whiteboard, and secure encrypted calls.
Pros:
Invite up to 100 participants for free
Simple and easy to use
Seamless Google Workspace integration
Professional email address
Encrypted video calling
Cons:
Lacks VoIP business phone features
No transcription feature
Difficult to integrate with third-party tools outside of Google
Why We Recommend Google Meet: We believe Google Meet is the perfect video conferencing solution for new startups and small teams. It offers a free version that lets you invite up to 100 participants and works smoothly with other Google Workspace apps.
Pricing: Google Meet is a free solution. However, it also offers premium plans starting from $6 per user per month.
Zoom is one of the most popular video conferencing software in the world. You can easily set up an online conference call or meetings, as the software is beginner-friendly to use.
The best part about Zoom is that it supports up to 100 participants and unlimited 1 on 1 meetings in the free plan. However, you’re restricted to only 40 minutes of video conferencing time in the free version.
Besides that, Zoom offers apps for different operating systems and devices. This allows cross platform compatibility and gives flexibility to team members and clients to easily join meetings from any device.
Zoom also offers other features like 2-factor authenticated meetings, screen sharing, whiteboards, live polls, video annotations, and more.
Supports up to 100 participants in the free version
Cons:
Free plan limited to 40 minutes meeting duration
Premium plans can be expensive for small businesses
Why We Recommend Zoom: If you’re a small business or a remote team that’s looking for a cost-effective video conferencing solution, then we highly recommend Zoom. Its free version has all the basic features for video conferencing and supports 100 attendees.
Pricing: Zoom is a free video conferencing software. However, its premium plans start from $149.90 per year per user.
Microsoft Teams is another popular video conferencing software and is a great alternative to Google Meet.
It is perfect for enterprises, small businesses, educational institutes, and personal users who are already in the Microsoft ecosystem.
You get all the standard video conferencing software features with Microsoft Teams. For instance, it offers screen sharing, call recording, group chat during video calls, and more.
Why We Recommend Microsoft Teams: If you’re already using Office 365 and other Microsoft products, then we highly recommend Microsoft Teams. It supports up to 10,000 members in a single meeting and offers great features.
Pricing: Microsoft Teams prices start from $4 per month per user and supports up to 300 participants per meeting.
GoToMeeting is the next video conferencing software on our list. It offers great features and is versatile software for businesses of all sizes.
For starters, you get mobile apps for iOS and Android devices. They are very easy to use and allow clients and team members to take video calls from anywhere.
Besides that, the software offers screen sharing, meeting drawing tools, customizable backgrounds, and presenter controls. You also get cloud storage to save recordings and meeting transcription. GoToMeeting easily integrates with other tools like Slack, Outlook, and Salesforce.
Pros:
Easy and versatile software
Screen sharing and video recording feature
Meeting transcription
Cloud storage
Integrates with other tools
Cons:
No free version to try the software
Why We Recommend GoToMeeting: GoToMeeting is great for companies looking for a video conferencing solution that is mobile-friendly. It offers dedicated apps that are beginner-friendly to use.
Pricing: GoToMeeting prices start from $12 per user per month and supports up to 150 participants.
It offers HD video calling, call scheduling, a desktop app, conference calls, call analytics and queuing, call recording, and more.
One of the benefits of using Ooma Meetings is that it easily integrates with Google and Microsoft Office 365, Salesforce, and other tools. Another unique feature of Ooma Meetings is that 2 or more people can share their screen at the same time.
Pros:
High-quality video conferencing
Simultaneous screen sharing
Video call recording
Voicemail transcription
Seamless CRM integration
Toll-free number
Cons:
Lacks video conferencing collaborative features
Why We Recommend Ooma Meetings: If you require multiple people to present at the same time and share their screens, then Ooma Meetings is the perfect solution.
Pricing: Ooma Meetings is available in the Ooma Office Pro plan, which will cost you $24.95 per month.
Skype is one of the most popular video chatting software in the industry. The best part is that it is completely free to use.
With dedicated apps for mobile and desktops, Skype is extremely versatile and easy to use. In the free version, you can invite up to 50 participants for a video call.
Skype also offers basic features like call recording and live subtitles, smart messaging, screen sharing, and more. However, it doesn’t offer more collaborative features like other video conferencing software.
Pros:
HD video calling
Call recording and live subtitles
Screen sharing feature
Private conversations
Dedicated apps for all devices
Cons:
Lacks a lot of collaborative features
Why We Recommend Skype: If you are looking for a free solution to connect your team and clients via video, then Skype is an excellent solution.
Pricing: Skype is a free video conferencing software. It also offers premium plans that start from $5 per month.
Which is the Best Video Conferencing Software?
After reviewing and testing multiple video conferencing software, we believe that RingCentral is the best solution for all types of businesses.
It offers powerful features and supports up to 200 participants in a single video call. Plus, it is very easy to use and set up. You get dedicated apps for all devices and other features like AI-powered noise reduction, analytics, and integrations.
As an honorable mention, you can also check out Nextiva. It is a popular business phone service that also offers a video conferencing feature.
On the other hand, if you’re looking for a free option, then Google Meet is perfect. You can invite up to 100 people in the free version for a video call.
In my previous article, I explained how I developed a simple chatbot using LangChain and Chat-GPT that can answer queries related to Paris Olympics ticket prices.
However, one major drawback with that chatbot is that it can only generate a single response based on user queries. It can not answer follow-up questions. In short, the chatbot has no memory where it can store previous conversations and answer questions based on the information in the past conversation.
In this article, I will explain how to add memory to this chatbot and execute conversations where the chatbot can respond to queries considering the past conversation.
So, let's begin without further ado.
Installing and Importing Required Libraries
The following script installs the required libraries for this article.
from langchain_openai import ChatOpenAI
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.output_parsers import StrOutputParser
from langchain_community.document_loaders import PyPDFLoader
from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain_openai import OpenAIEmbeddings
from langchain_community.vectorstores import FAISS
from langchain.chains.combine_documents import create_stuff_documents_chain
from langchain.chains import create_retrieval_chain
from langchain_core.documents import Document
from langchain.chains import create_history_aware_retriever
from langchain_core.prompts import MessagesPlaceholder
from langchain_core.messages import HumanMessage, AIMessage
import os
Paris Olympics Chatbot for Generating a Single Response
Let me briefly review how we developed a chatbot capable of generating a single response and its associated problems.
The following script creates an object of the ChatOpenAI llm with the GPT-4 model, a model that powers Chat-GPT.
openai_key = os.environ.get('OPENAI_KEY2')
llm = ChatOpenAI(
openai_api_key = openai_key ,
model = 'gpt-4',
temperature = 0.5
)
Next, we import and load the official PDF containing the Paris Olympics ticket information.
We then split our PDF document and create embeddings for the different chunks of information in the PDF document. We store the embeddings in a vector database.
Subsequently, we create a ChatPromptTemplate object that accepts our input query and context information extracted from the PDF document. We create a documents_chain chain that passes the input prompt to our LLM model.
from langchain.chains.combine_documents import create_stuff_documents_chain
prompt = ChatPromptTemplate.from_template("""Answer the following question based only on the provided context:
Question: {input}
Context: {context}
"""
)
document_chain = create_stuff_documents_chain(llm, prompt)
Next, we create our vector database retriever, which retrieves information from the vector database based on the input query.
Finally, we create our retrieval_chain that accepts the retriever and document_chain as parameters and returns the final response from an LLM.
Let's ask a query about the lowest-priced tickets for tennis games.
query = "What is the lowest ticket price for tennis games?"
generate_response(query)
Output:
The lowest ticket price for tennis games is 30.
The model responded correctly.
Let's now ask for a follow-up query. The following query clearly conveys that we want to get information about the lowest-priced tickets for volleyball games.
However, since the chatbot does not have any memory to store past conversations, it treats the following query as a new standalone query. The response is different from what we aim for.
query = "And for beach volleyball?"
generate_response(query)
Output:
Beach Volleyball is played by two teams of two players each. They face off in the best of three sets on a sand court that is 16m long and 8m wide. The net is at the same height as indoor volleyball (2.24m for women and 2.43m for men). The game is contested by playing two sets to 21 points, and teams must win at least two points more than their opponents to win the set. If needed, the third set is played to 15 points. The matches take place at the Eiffel Tower Stadium in Paris.
Let's pass another query.
query = "And what is the category of this ticket?"
generate_response(query)
Output:
The context does not provide specific information on the category of the ticket.
The time model refuses to return any information.
If you have conversed with Chat-GPT, you would have noticed that it responds to follow-up questions. In the next section, you will see how to add memory to your chatbot to track past conversations.
Adding Memory to Paris Olympics Chatbot
We will create two chat templates and three chains.
The first chat template will accept user input queries and the message history and return the matching documents from our vector database. The template will have a MessagesPlaceholder attribute to store our previous chat.
We will also define history_retriever_chain, which takes the chat template we defined earlier and returns the matched document.
The following script defines our first template and chain.
prompt = ChatPromptTemplate.from_messages([
MessagesPlaceholder(variable_name="chat_history"),
("user", "{input}"),
("user", "Given the above conversation, generate a search query to look up in order to get information relevant to the conversation")
])
history_retriever_chain = create_history_aware_retriever(llm, retriever, prompt)
You can test the above chain using the following script. The chat_history list will contain HumanMessage and AIMessage objects corresponding to user queries and chatbot responses.
Next, while invoking the history_retriever_chain object, we pass the user input and the chat history.
In the response, you will see the matched documents returned by the retriever. As an example, I have only printed the first document. If you look carefully, you will see the ticket prices for the beach volleyball games. We will pass this information on to our next chain, which will return the final response.
chat_history = [
HumanMessage(content="What is the lowest ticket price for tennis games?"),
AIMessage(content="The lowest ticket price for tennis games is 30.")
]
result = history_retriever_chain.invoke({
"chat_history": chat_history,
"input": "And for Beach Volleyball?"
})
result[0]
Output:
Let's now define our second prompt template and chain. This prompt template will receive user input and message history from the user and context information from the history_retriever_chain chain. We will also define the corresponding document chain that invokes a response to this prompt.
prompt = ChatPromptTemplate.from_messages([
("system", "Answer the user's questions based on the below context:\n\n{context}"),
MessagesPlaceholder(variable_name="chat_history"),
("user", "{input}")
])
document_chain = create_stuff_documents_chain(llm, prompt)
Finally, we will sequentially chain the history_retriever_chain, and the document_chain together to create our final create_retrieval_chain.
We will pass the chat history and user input to this retrieval_chain, which first fetches the context information using the chat history from the history_retriever_chain. Next, the context retrieved from the history_retriever_chain, along with the user input and chat history, will be passed to the document_chain to generate the final response.
Since we already have some messages in the chat history, we can test our retrieval_chain using the following script.
retrieval_chain = create_retrieval_chain(history_retriever_chain, document_chain)
result = retrieval_chain.invoke({
"chat_history": chat_history,
"input": "And for Beach Volleyball?"
})
print(result['answer'])
Output:
The lowest ticket price for Beach Volleyball games is 24.
In the above output, you can see that Chat-GPT successfully generated a response to a follow-up question.
Putting it All Together - A Command Line Chatbot
To create a simple command-line chatbot, we will instantiate an empty list to store our past conversations.
Next, we define the generate_response_with_memory() function that accepts the user query as an input parameter and invokes the retrieval_chain to generate a model response.
Inside the generate_response_with_memory() function, we create HumanMessage and AIMessage objects using the user queries and chatbot responses and add them to the chat_history list.
Finally, we can execute a while loop that asks users to enter queries as console inputs. If the input contains the string bye, we empty the chat_history list, print a goodbye message and quit the loop.
Otherwise, the query is passed to the generate_response_with_memory() function to generate a chatbot response.
Here is the script and a sample output.
print("=======================================================================")
print("Welcome to Paris Olympics Ticket Information Chatbot. Enter your query")
print("=======================================================================")
query = ""
while query != "bye":
query = input("\033[1m User >>:\033[0m")
if query == "bye":
chat_history = []
print("\033[1m Chatbot>>:\033[0m Thank you for your messages, have a good day!")
break
response = generate_response_with_memory(query)
print(f"\033[1m Chatbot>>:\033[0m {response}")
Output:
Conclusion
A conversational chatbot keeps track of the past conversation. In this article, you saw how to create a Paris Olympics ticket information chatbot that answers user queries and follow-up questions using LangChain and Chat-GPT. You can use the same approach to develop conversational chatbots for other problems.
Feel free to leave your feedback in the comments.
I enjoyed Lee Robinson’s take on How I’m Writing CSS in 2024. Rather than jump right into tools and syntax, it starts with the user:
What does a great experience look like loading stylesheets when visiting a website?
Stylesheets should load as fast as possible (small file sizes)
Stylesheets should not re-download unless changed (proper caching headers)
The page content should have minimal or no layout shift
Fonts should load as fast as possible and minimize layout shift
Agreed! Number 3, and to some degree 4, are almost more in the JavaScript bucket than CSS, but it’s a good starter list. I’d add “The page styles shouldn’t interfere with default accessibility”.
Then, after those, the developer experience is considered:
How can the DX of the styling tools we use help us create a better UX?
Prune unused styles, minify, and compress CSS for smaller file sizes
Generate hashed file names to enable safe, immutable caching
Bundle CSS files together to make fewer network requests
Prevent naming collisions to avoid visual regressions
What about to help us write more maintainable, enjoyable CSS?
Easy to delete styles when deleting corresponding UI code
Easy to adhere to a design system or set of themes
Editor feedback with TypeScript support, autocompletion, and linting
Receive tooling feedback in-editor to prevent errors (type checking, linting)
I like how the DX concerns are about making things easier that the UX demands. I want all that stuff! Although I admit I still bristle at the idea of dealing with unused styles. It’s very hard to properly detect unused styles and I worry about tools making those decisions.
Lee’s ultimate recommendations are CSS Modules, Tailwind, or StyleX (or just vanilla CSS on simple stuff), and I feel like those feel fair based on his own journey and accomplish the things he laid out. I’m a fan of the CSS Modules approach myself. It’s largely vanilla CSS, but with great scoping built in, it couples to components nicely, and is so well established it’s everywhere you need it.
Sure, it’s just a three column layout, but the different columns have all sorts of different constraints. The first is in a fixed position, the main content has a maximum width but is otherwise fluid as well as contains nested grids. There is a maximum width overall too, with the third column involving absolute positioning. That’s without getting into the (five!) major breakpoints and footer complexities. If you’re into nerding out on CSS layout, Ahmad tackles it literally five different ways, ultimately landing on a nice CSS grid powered technique. He called it easy to implement, but looking at the column declarations I think it only looks easy to someone who was on his fifth iteration. 🤣. And that’s only half the article.
To think that Ahmad’s tackling of a complex layout, in the end, only boiled down to a few lines of CSS is rather incredible. CSS is certainly more powerful. But is it easier? Geoff Graham thinks yeah, it is a little easier to write actually, in some ways.
To name a few, grouping styles is easier, centering is easier, translation needs are easier, and spacing is easier. Geoff names more. And by easier, really truly easier in all ways. Less and more direct code that is easier to reason about and does what it says.
Roman Komarov outlines The Shrinkwrap Problem, which is maybe a little niche but certainly a very interesting layout situation. The deal is that if content wraps, the element essentially takes up all available width. Not that strange, but when you look at how a wrapped title looks with text-wrap: balance;, for example, it looks a little weird. A header might only take up half the space visually, yet still take up all the available space.
Roman goes really deep on this, with solutions that involve even new tech like anchor positioning which is an awfully weird thing to invoke just for this, but hey, needs are needs. Just when you think this is all far too much for such a niche thing, Roman gets to the use-cases which are actually pretty basic and straightforward. Things like chat bubbles where full-width bubbles would look awkward. Or decorations on either side of a header.
Have you ever repeatedly tapped on a button only for the page to zoom in unexpectedly? Rewind and fast-forward buttons in an audio player for example. This unwanted side effect can be removed with touch-action.
There are four others in there that are all in the decent-chance-you-hadn’t-thought-of-it category.
Are you wondering how to highlight new posts for returning visitors in WordPress?
Showing off the posts that were newly published on your website is one way to keep your readers updated and make sure they don’t miss out on your latest content.
In this step-by-step guide, we will show you how to highlight new posts for returning visitors in WordPress.
Why Highlight New Posts on Your WordPress Site?
Highlighting new posts on your WordPress site helps returning visitors easily discover your new content. This way, they won’t miss out on any fresh information or updates you’ve added to your blog.
Labeling new posts improves the user experience on your WordPress website. When a returning visitor reaches your website, they can easily spot which posts they haven’t read yet, saving them a lot of time and increasing your pageviews.
A good user experience on your site not only keeps visitors happy but also helps with SEO. When your site is easy to use, it improves your search engine rankings and increases the likelihood of visitors finding your content.
With that in mind, let’s see how you can highlight new posts for returning visitors in WordPress.
We will show you two methods: one with a WordPress plugin and the other with code. You can jump to a specific method using the quick links below:
Method 1: Highlight New WordPress Posts With a WordPress Plugin
This first method uses the Mark New Posts plugin. We recommend it for complete beginners because it’s very simple. This plugin will add a label to show which blog posts your site visitors haven’t seen yet.
Firstly, you need to install and activate the Mark New Posts plugin. If you need guidance, see our step-by-step guide on how to install a WordPress plugin.
After that, go to Settings » Mark New Posts from the WordPress admin area. You will now see the plugin’s settings page.
What you want to do now is select where to display the ‘New’ label. You can select After post title, Before post title, or Before and after post title.
We find that adding the label after the post title will look like a notification and grab users’ attention the most, so that’s what we’ve chosen.
Next, you need to choose what the marker looks like in the Marker type setting. The options include “New” text, “New” text legacy, Orange circle, Flag, Picture, or None.
Be sure to explore each option to see which one looks best with your website design.
Another setting you can configure is the background color for the new post’s title. If you enable this, then when a reader visits a new post, they will see that the post title section has a background color. We didn’t find this setting necessary, so we disabled it.
In the ‘Consider a post as read’ setting, you can choose when to turn off the new post label: after it was opened, after it was displayed in the list, or after any web page of the blog was opened.
We suggest going with ‘after it was opened.’ This means that if a visitor hasn’t read several posts and opens one, then the new post label for the other articles won’t disappear.
Next, you can select how many days the post should stay highlighted as new, show all existing posts as new to new visitors, and disable the new label for custom post types.
The last two settings are pretty advanced.
One is to ‘Allow outside the post list,’ which means you can highlight posts outside of the loop, like in widget-ready sidebar areas. Be cautious about enabling this setting, as it may create unwanted WordPress errors.
The other is ‘Use JavaScript for showing markers’, which is only recommended if the plugin is not compatible with the theme or other plugins being used on your blog. In most cases, you will want to keep this setting disabled.
Once you are done configuring the plugin settings, just click ‘Save.’
And that’s it! Go ahead and visit your website in incognito mode to see if the new labels for recent posts are live.
Here’s what it looks like on our demo website:
Method 2: Highlight New Posts by Adding Custom Code
Are you unhappy with the new post label options given by the previous plugin? If so, then you can highlight new posts using custom code instead.
For beginners, this method may seem intimidating. But don’t worry because we will use the WPCode plugin to safely insert code snippets in WordPress without breaking your website.
WPCode also makes it easy to manage multiple custom code snippets, which will be handy in our case since we will be using more than one.
Note: While there is a free version of WPCode, we will use WPCode Pro because it allows you to insert the code snippets into the proper locations for this tutorial.
The first thing you need to do is install WPCode in WordPress. For setup instructions, go ahead and check out our article on how to install a WordPress plugin.
Next, go to Code Snippets » + Add Snippet from your WordPress dashboard. After that, select ‘Add Your Custom Code (New Snippet)’ and click the ‘Use snippet’ button.
Now, let’s add a title to your code snippet so that it’s easier to find it later on if needed. For this, you can name it something like ‘WordPress Last Visit Title Modifier.’
Then, select ‘PHP Snippet’ in the Code Type dropdown.
After that, you can copy and paste the code snippet below:
// Define a function to modify post titles based on the last visit
function wpb_lastvisit_the_title($title, $id) {
// Check if not in the loop, a singular page, or a page post type; if true, return the original title
if (!in_the_loop() || is_singular() || get_post_type($id) == 'page') return $title;
// Check if no 'lastvisit' cookie is set or if it is empty; if true, set the cookie with the current timestamp
if (!isset($_COOKIE['lastvisit']) || $_COOKIE['lastvisit'] == '') {
$current = current_time('timestamp', 1);
setcookie('lastvisit', $current, time() + 60 * 60 * 24 * 7, COOKIEPATH, COOKIE_DOMAIN);
}
// Retrieve the 'lastvisit' cookie value
$lastvisit = $_COOKIE['lastvisit'];
// Get the publish date of the post (in Unix timestamp format)
$publish_date = get_post_time('U', true, $id);
// If the post was published after the last visit, append a new span to the title
if ($publish_date > $lastvisit) $title .= '<span class="new-article">New</span>';
// Return the modified or original title
return $title;
}
// Add a filter to apply the 'wpb_lastvisit_the_title' function to 'the_title' hook with priority 10 and 2 parameters
add_filter('the_title', 'wpb_lastvisit_the_title', 10, 2);
What this snippet does is modify WordPress post titles based on a user’s last visit.
It checks if the page is a blog post or not, and if not, then it will display the original title as is. But if it is a blog post, then the title will be modified.
Then, the snippet ensures the lastvisit cookie exists. If it doesn’t, then the code creates it and sets it to the current time. The function then compares this lastvisit time with the post’s publish date and adds a ‘New’ label to the title if the post is newer than the last visit.
Once you have inserted the code snippet, just scroll down and select ‘Auto Insert’ for the Insert Method.
Other than that, make sure to choose ‘Frontend only’ for the Location. This means the code will only run on the part of your WordPress blog that visitors interact with and not in your admin panel or other places.
With that done, you can make the code ‘Active’ and click ‘Save Snippet.’
Now, repeat the step to add a new custom code snippet. This time, the code will style the ‘New’ label that is added to recent post titles based on the last visit of a user.
So, you can name it something like ‘Post Title New Label Style’ and the Code Type should be ‘CSS Snippet.’
You can then copy and paste the following lines of code into the Code Preview box:
/* CSS to style the "New" label in blog post titles */
.new-article {
background-color: #4CAF50; /* Green background color */
color: #ffffff; /* White text color */
padding: 2px 5px; /* Padding around the label */
margin-left: 5px; /* Adjust the margin to your preference */
border-radius: 3px; /* Rounded corners for the label */
font-size: 12px; /* Adjust the font size to your preference */
}
This code snippet essentially customizes the ‘New’ post label using a custom background color, text color, padding, margin, border radius, and font size.
Feel free to adjust these elements to your preferences as you go along. Just make sure to use hex color codes or RGB values for the background and text colors.
In the Insertion section, select ‘Site Wide Header’ as the Location. After that, make the code ‘Active’ and click ‘Save Snippet.’
And that’s it! To see if the code works, you can publish a new blog post and visit your website in incognito mode.
If the code is successful, then you should see a ‘New’ label next to your recent post titles.
Bonus Tip: Help Users Discover Relevant Content With Internal Links
Besides highlighting new posts for your returning visitors, there are many other ways to keep your readers engaged.
Ideally, you want visitors to check out not just one but three or more blog posts in one sitting. This shows that they are enjoying your content and are taking part in the community you are building.
However, sometimes, it can be hard for readers to find content that’s relevant to their interests. That’s where internal linking comes in.
Internal links are links that direct users to other pages or posts on your website.
If you are not sure which internal links to use in a blog post, then All in One SEO (AIOSEO) has a link assistant feature that can give you some ideas.
Kubernetes, the open-source platform for automating deployment, scaling, and management of containerized applications, has revolutionized the IT industry. However, like all innovative technology, it continuously seeks enhancements to improve efficiency, usability, and functionality. One such area promising potential improvements is Generative AI. This sophisticated technology can generate new data that shares the same characteristics as the original data, such as images, music, text, or code. As we delve into the possibilities, we realize the potential improvements in Kubernetes as part of Generative AI.
How Can Generative AI Enhance Kubernetes?
1. Automated Configuration and Deployment
Generative AI can automate the configuration and deployment of applications in Kubernetes. By learning from historical deployment patterns and configurations, generative models can predict the optimum configuration for a new application. Generative AI can also help to scale applications automatically based on traffic patterns, reducing the need for manual intervention.
In the rapidly changing world of artificial intelligence, it has evolved far more than just predictions based on data analysis. It is now emerging with limitless potential for generating creative content and problem-solving models. With generative AI models such as ChatGPT in place, chatbots are presenting improvements in language recognition abilities. According to the Market Research Report, the global Generative AI market is poised for exponential growth, expected to surge from USD 8.65 billion in 2022 to USD 188.62 billion by 2032, with a staggering CAGR of 36.10% during the forecast period of 2023-2032. The dominance of the North American region in the market in 2022 underscores the widespread adoption and recognition of the potential of Generative AI.
Why Is RAG Important?
Every industry hopes to evolve AI implementation, such as Generative AI, which can exploit big data to bring meaningful insights and solutions or provide more customization and automation to capitalize on AI potential. However, Generative AI leveraging neural network architectures and large language models (LLMs) helps businesses to improve with the limitation of producing content or analysis that may be factually wrong given the scope of data fed to the developed model, also known as “hallucinations” or providing outdated information.
Documentation plays a crucial role in any project, serving as a compass for development teams, and as a good way for the new joiners to know how the project is done. More often than not, documentation becomes a task that is either indefinitely postponed or completed once and never updated, leaving it outdated and potentially counterproductive.
An effective strategy for developers is to leverage a tool seamlessly integrated into their IDE. This eliminates friction caused by the need to switch between different tools, ensuring convenience, ease of use, and the ability to effortlessly update documentation. An excellent way to approach it is with C4 PlantUML — a powerful tool that allows developers to generate comprehensive system architecture documentation with just a few lines of code, making the documentation process not only efficient but also an integral part of the development workflow.
Many modern websites give users the power to set a site-specific color scheme preference. A basic implementation is straightforward with JavaScript: listen for when a user changes a checkbox or clicks a button, toggle a class (or attribute) on the <body> element in response, and write the styles for that class to override design with a different color scheme.
CSS’s new :has() pseudo-class, supported by major browsers since December 2023, opens many doors for front-end developers. I’m especially excited about leveraging it to modify UI in response to user interaction without JavaScript. Where previously we have used JavaScript to toggle classes or attributes (or to set styles directly), we can now pair :has() selectors with HTML’s native interactive elements.
Supporting a color scheme preference, like “Dark Mode,” is a great use case. We can use a <select> element anywhere that toggles color schemes based on the selected <option> — no JavaScript needed, save for a sprinkle to save the user’s choice, which we’ll get to further in.
Respecting System Preferences
First, we’ll support a user’s system-wide color scheme preferences by adopting a “Light Mode”-first approach. In other words, we start with a light color scheme by default and swap it out for a dark color scheme for users who prefer it.
The prefers-color-scheme media feature detects the user’s system preference. Wrap “dark” styles in a prefers-color-scheme: dark media query.
Next, set the color-scheme property to match the preferred color scheme. Setting color-scheme: dark switches the browser into its built-in dark mode, which includes a black default background, white default text, “dark” styles for scrollbars, and other elements that are difficult to target with CSS, and more. I’m using CSS variables to hint that the value is dynamic — and because I like the browser developer tools experience — but plain color-scheme: light and color-scheme: dark would work fine.
:root {
/* light styles here */
color-scheme: var(--color-scheme, light);
/* system preference is "dark" */
@media (prefers-color-scheme: dark) {
--color-scheme: dark;
/* any additional dark styles here */
}
}
Giving Users Control
Now, to support overriding the system preference, let users choose between light (default) and dark color schemes at the page level.
HTML has native elements for handling user interactions. Using one of those controls, rather than, say, a <div> nest, improves the chances that assistive tech users will have a good experience. I’ll use a <select> menu with options for “system,” “light,” and “dark.” A group of <input type="radio"> would work, too, if you wanted the options right on the surface instead of a dropdown menu.
Before CSS gained :has(), responding to the user’s selected <option> required JavaScript, for example, setting an event listener on the <select> to toggle a class or attribute on <html> or <body>.
But now that we have :has(), we can now do this with CSS alone! You’ll save spending any of your performance budget on a dark mode script, plus the control will work even for users who have disabled JavaScript. And any “no-JS” folks on the project will be satisfied.
What we need is a selector that applies to the page when it :has() a select menu with a particular [value]:checked. Let’s translate that into CSS:
:root:has(select option[value="dark"]:checked)
We’re defaulting to a light color scheme, so it’s enough to account for two possible dark color scheme scenarios:
The page-level color preference is “system,” and the system-level preference is “dark.”
The page-level color preference is “dark”.
The first one is a page-preference-aware iteration of our prefers-color-scheme: dark case. A “dark” system-level preference is no longer enough to warrant dark styles; we need a “dark” system-level preference and a “follow the system-level preference” at the page-level preference. We’ll wrap the prefers-color-scheme media query dark scheme styles with the :has() selector we just wrote:
:root {
/* light styles here */
color-scheme: var(--color-scheme, light);
/* page preference is "system", and system preference is "dark" */
@media (prefers-color-scheme: dark) {
&:has(#color-scheme option[value="system"]:checked) {
--color-scheme: dark;
/* any additional dark styles, again */
}
}
}
Notice that I’m using CSS Nesting in that last snippet. Baseline 2023 has it pegged as “Newly available across major browsers” which means support is good, but at the time of writing, support on Android browsers not included in Baseline’s core browser set is limited. You can get the same result without nesting.
:root {
/* light styles */
color-scheme: var(--color-scheme, light);
/* page preference is "dark" */
&:has(#color-scheme option[value="dark"]:checked) {
--color-scheme: dark;
/* any additional dark styles */
}
}
For the second dark mode scenario, we’ll use nearly the exact same :has() selector as we did for the first scenario, this time checking whether the “dark” option — rather than the “system” option — is selected:
:root {
/* light styles */
color-scheme: var(--color-scheme, light);
/* page preference is "dark" */
&:has(#color-scheme option[value="dark"]:checked) {
--color-scheme: dark;
/* any additional dark styles */
}
/* page preference is "system", and system preference is "dark" */
@media (prefers-color-scheme: dark) {
&:has(#color-scheme option[value="system"]:checked) {
--color-scheme: dark;
/* any additional dark styles, again */
}
}
}
Now the page’s styles respond to both changes in users’ system settings and user interaction with the page’s color preference UI — all with CSS!
But the colors change instantly. Let’s smooth the transition.
Respecting Motion Preferences
Instantaneous style changes can feel inelegant in some cases, and this is one of them. So, let’s apply a CSS transition on the :root to “ease” the switch between color schemes. (Transition styles at the :root will cascade down to the rest of the page, which may necessitate adding transition: none or other transition overrides.)
Note that the CSS color-scheme property does not support transitions.
:root {
transition-duration: 200ms;
transition-property: /* properties changed by your light/dark styles */;
}
Not all users will consider the addition of a transition a welcome improvement. Querying the prefers-reduced-motion media feature allows us to account for a user’s motion preferences. If the value is set to reduce, then we remove the transition-duration to eliminate unwanted motion.
:root {
transition-duration: 200ms;
transition-property: /* properties changed by your light/dark styles */;
@media screen and (prefers-reduced-motion: reduce) {
transition-duration: none;
}
}
Transitions can also produce poor user experiences on devices that render changes slowly, for example, ones with e-ink screens. We can extend our “no motion condition” media query to account for that with the update media feature. If its value is slow, then we remove the transition-duration.
:root {
transition-duration: 200ms;
transition-property: /* properties changed by your light/dark styles */;
@media screen and (prefers-reduced-motion: reduce), (update: slow) {
transition-duration: 0s;
}
}
Let’s try out what we have so far in the following demo. Notice that, to work around color-scheme’s lack of transition support, I’ve explicitly styled the properties that should transition during theme changes.
Not bad! But what happens if the user refreshes the pages or navigates to another page? The reload effectively wipes out the user’s form selection, forcing the user to re-make the selection. That may be acceptable in some contexts, but it’s likely to go against user expectations. Let’s bring in JavaScript for a touch of progressive enhancement in the form of…
Persistence
Here’s a vanilla JavaScript implementation. It’s a naive starting point — the functions and variables aren’t encapsulated but are instead properties on window. You’ll want to adapt this in a way that fits your site’s conventions, framework, library, and so on.
When the user changes the color scheme from the <select> menu, we’ll store the selected <option> value in a new localStorage item called "preferredColorScheme". On subsequent page loads, we’ll check localStorage for the "preferredColorScheme" item. If it exists, and if its value corresponds to one of the form control options, we restore the user’s preference by programmatically updating the menu selection.
/*
* If a color scheme preference was previously stored,
* select the corresponding option in the color scheme preference UI
* unless it is already selected.
*/
function restoreColorSchemePreference() {
const colorScheme = localStorage.getItem(colorSchemeStorageItemName);
if (!colorScheme) {
// There is no stored preference to restore
return;
}
const option = colorSchemeSelectorEl.querySelector([value=${colorScheme}]);
if (!option) {
// The stored preference has no corresponding option in the UI.
localStorage.removeItem(colorSchemeStorageItemName);
return;
}
if (option.selected) { // The stored preference's corresponding menu option is already selected
return;
}
option.selected = true;
}
/*
* Store an event target's value in localStorage under colorSchemeStorageItemName
*/
function storeColorSchemePreference({ target }) {
const colorScheme = target.querySelector(":checked").value;
localStorage.setItem(colorSchemeStorageItemName, colorScheme);
}
// The name under which the user's color scheme preference will be stored.
const colorSchemeStorageItemName = "preferredColorScheme";
// The color scheme preference front-end UI.
const colorSchemeSelectorEl = document.querySelector("#color-scheme");
if (colorSchemeSelectorEl) {
restoreColorSchemePreference();
// When the user changes their color scheme preference via the UI,
// store the new preference.
colorSchemeSelectorEl.addEventListener("input", storeColorSchemePreference);
}
Let’s try that out. Open this demo (perhaps in a new window), use the menu to change the color scheme, and then refresh the page to see your preference persist:
If your system color scheme preference is “light” and you set the demo’s color scheme to “dark,” you may get the light mode styles for a moment immediately after reloading the page before the dark mode styles kick in. That’s because CodePen loads its own JavaScript before the demo’s scripts. That is out of my control, but you can take care to improve this persistence on your projects.
Persistence Performance Considerations
Where things can get tricky is restoring the user’s preference immediately after the page loads. If the color scheme preference in localStorage is different from the user’s system-level color scheme preference, it’s possible the user will see the system preference color scheme before the page-level preference is restored. (Users who have selected the “System” option will never get that flash; neither will those whose system settings match their selected option in the form control.)
If your implementation is showing a “flash of inaccurate color theme”, where is the problem happening? Generally speaking, the earlier the scripts appear on the page, the lower the risk. The “best option” for you will depend on your specific stack, of course.
What About Browsers That Don’t Support :has()?
All major browsers support :has() today Lean into modern platforms if you can. But if you do need to consider legacy browsers, like Internet Explorer, there are two directions you can go: either hide or remove the color scheme picker for those browsers or make heavier use of JavaScript.
If you consider color scheme support itself a progressive enhancement, you can entirely hide the selection UI in browsers that don’t support :has():
@supports not selector(:has(body)) {
@media (prefers-color-scheme: dark) {
:root {
/* dark styles here */
}
}
#color-scheme {
display: none;
}
}
Otherwise, you’ll need to rely on a JavaScript solution not only for persistence but for the core functionality. Go back to that traditional event listener toggling a class or attribute.
The CSS-Tricks “Complete Guide to Dark Mode” details several alternative approaches that you might consider as well when working on the legacy side of things.
Go (aka Golang) came to life at Google in 2009. It was designed by a few big names:
Robert Griesemer, who had a large hand in the development of the Java Virtual Machine.
Rob Pike, who holds the U.S. patent for windowing UI systems as well as helped build the Plan 9 operating system at Bell Labs. (In fact, the mascots for Plan 9 and for Golang are remarkably similar because Pike’s wife, Renée French, is a renowned illustrator.)
Ken Thompson, who designed and implemented a little thing called Unix.
In this article, we’ll demonstrate how simple it is to build a RESTful web service in Go. Then, we’ll demonstrate how to deploy this application with Heroku. But before we embark on this journey, let’s talk briefly about why you might want to use Go.