Just another news updates, blogging tips, life lessons, inspiration, career strategy and entertainment blog.

Friday, March 10, 2017

Pass the Mac-n-Cheese, Please: Why Comfort Food Works

Comfort Food


Sometimes it’s a bowl of ice cream after a bad breakup. Other times, it’s a plate of spaghetti made from your mom’s tried-and-true recipe. And occasionally it’s leftover hash-brown casserole eaten straight out of a Tupperware container at your best friend’s parents’ house as you both recover from the holidays. (True story.)

 

Making the Brain Happy

Comfort food takes on many forms, depending on the situation and the person. While some meals are often classified as comforting, such as pasta and stews, comfort food is a product of our personal experiences with certain dishes. But are there reasons beyond these personal associations why we reach for some foods—particularly of the high-calorie variety—over others in times of turmoil?

In a 2005 Ball State University study published in the journal Nutrition Research, a survey of 272 college students showed that while 80 percent of them thought they ate healthfully most of the time, only 33 percent did when anxious about something. Interestingly, those who were stressed also tended to turn toward the same kinds of foods. There’s no question that mood and eating habits are connected, but there must be some reason why food variety decreases when stress levels increase.

We humans have a complicated relationship with food. It’s necessary for survival, but our connection extends far beyond basic necessity. We turn to food as a means of celebration, as a treatment for loneliness, as an outlet for frustration and sadness, and so forth. This wouldn’t be a problem if fruits and vegetables provided the same kind of escape, but nope—eating high-energy food is what makes us feel better, and it’s not just psychological. Chemical processes in our brain actually reward us for eating things like ice cream and carb-heavy casseroles. Foods like these really do make us happier, albeit briefly.

There’s also evidence that calorically dense foods can stop chronic stress in its tracks. In a 2003 study conducted at the University of California, San Francisco, researchers messed with rats’ stress systems so that they constantly felt frazzled. Not surprisingly, the stressed-out rats opted for high-sugar and high-fat foods. (Rats—they’re just like us!) But what was surprising was the calming effect that eating such foods had on them. After the rats chowed down, their bodies stopped mass-producing stress hormones and instead released pleasure-inducing hormones, such as serotonin.

 

A Few Factors Behind Comfort Food

If less healthy foods potentially ease our bodies out of stress mode, that could help explain what makes us crave macaroni and cheese over salad during those times. But why some people call mac and cheese comfort food while others prefer chocolate and potato chips is another matter.

What we think of as comfort food usually comes from the positive experiences we have with it as kids, such as chicken noodle soup to feel better or ice cream for a good report card. But one study found that other factors, such as gender and age, can also come into play. Research at the University of Illinois in 2003, the results of which were published in the journal Physiology and Behavior, found that men and women crave different things when frazzled. Men went for hearty meals, like casseroles, steaks, and soup, while women chose snack foods, such as chocolate and ice cream. Age also had an effect: younger people considered snack foods more comforting than older people did.

 

Hey, It’s Not So Bad for Us

Comfort food gets a bad rap because it’s most often associated with junk foods that offer little nutritional benefit, like cookies and french fries (mmm …). But according to the University of Illinois study, 40 percent of the seemingly unhealthy dishes people claimed were comforting—including chocolate and macaroni and cheese—offer some nutrients and are therefore beneficial in moderation. For instance, dark chocolate contains powerful antioxidants and cheese is a great source of calcium and protein.

Plus, not every food we associate with happier, calmer moods is necessarily unhealthy. We also derive comfort from things simply because they’re warm. A 2008 study published in Science found that being physically warm can make people feel friendlier toward others and put them in more optimistic moods. So even though a meal of tea and toast isn’t as calorically rich as a milkshake and a burger, it can still fall under the same comfort-food label because the warming effect it has on our insides extends to our moods, too.

 

Comfort Food = Guilty Pleasure?

The thing about comfort foods is that they aren’t limited to sad or anxious moments. While their familiarity might be part of what makes them so enjoyable, one 2009 study suggests that’s not always what we’re looking for in stressful times. Over the course of five different experiments at the University of South Carolina, people undergoing significant life changes were more likely to choose unfamiliar products when given a choice. This shakes up the notion that people automatically want stability in transformative times; on the contrary, it’s possible that we’re even more open to something new. But when participants were asked to really think about their choices, they did eschew the unfamiliar for what they knew.

Comfort foods that are high in calories or especially warm really do elevate our mood, but that doesn’t happen only when we’re upset, which is why comfort foods are always appealing. I think Kate Hopkins, the Accidental Hedonist blogger, had it right with her explanation of comfort food: “[It’s] a food you enjoy, but you believe you need to qualify it as somehow worthwhile.” We might need an excuse like comfort to justify eating copious amounts of Doritos or cake, but they taste good regardless of how we feel beforehand. Even so, their positive physiological effects certainly make them that much more enticing during times of stress. I don’t know about you, but the fact that eating a big plate of carbs can actually do something good for me is comfort in and of itself.
Share:

Monday, March 6, 2017

Per Post Scripts & Styles of Javascript or CSS on a WordPress Blog

Per Post Scripts & Styles


If you’ve ever tried to post a tutorial or demonstration of Javascript or CSS on a WordPress blog, you’ve inevitably faced the challenge of figuring out how to load the scripts and styles for just that post.


The easy way is to add the styles to your main stylesheet and add the Javascript code to your main Javascript file (if you have one), but that’s not really a very nice thing to do to your viewers, especially if your post specific code ends is rather large. Visitors end up downloading code they’ll likely never visit, and every time you want to a new post, those files will have to be recached.

A better way would be to only load post-specific Javascript and CSS when you’re looking at that particular post. Unfortunately, WordPress doesn’t provide a built-in way to do this.

I’ve seen a few plugins that do this, but all of them are pretty hackish and don’t have nearly enough customization options. So after much frustration with the existing plugins, I decided to write my own.
Allow me to introduce Per Post Scripts & Styles. You can download the plugin hosted on WordPress.org or follow the source on Github.

 

Why it’s better

  • Dynamic URLs with %SITE_URL% and %THEME_URL% variables
  • Script dependency support as well as script duplication checking
  • The option to load scripts in either the header and footer
  • Attach scripts to posts, pages, and custom post types
  • Load attached scripts and styles not just on that post’s page, but on the home page or any other page where that post is displayed.

Perhaps the worst thing about the existing plugins is they force you to hard code your script and style URLs. Not only is this bad practice, but it’s particularly inconvenient if (like me) you do most of your development locally, and then upload to your server. Obviously if I attach http://localhost:8888/javscript/some-file.js to a post, that’s not going to work when it to my production server. This also applies to anytime you need to switch to URLs. Per Post Scripts & Styles allows you to use variables like %SITE_URL% and %THEME_URL% making this issue much easier to manage.

Another big problem with the existing plugins is they simply collect your URLs and plop them out in the header. This goes against WordPress best practices for two very compelling reasons: (1) no duplication checking and (2) no dependency checking. Imagine if you wanted to include a that required jQuery to run. You could list jQuery as one of the scripts to attach, but what if another plugin is already loading jQuery? Now you’ll be loading it twice!

Per Post Scripts & Styles takes care of all these issues for you. A meta box is added to every post, page, or custom post type you choose, and all you have to do is specify which the URLs should be loaded. The plugin takes care of the rest.

 

Documentation

Edit Post Screen

In the edit post screen there is a meta box below the post content box titled “Per Post Scripts & Styles”. Simply enter the URLs of any Javascript or CSS files that you want to load in the appropriate box.

Instructions
  • When entering the URLs, you may use the variables %SITE_URL% and %THEME_URL% for greater flexibility, e.g. %SITE_URL%/scripts/this-post-script.js
  • To have multiple scripts, put each on on its own line.
  • If your script has one or more dependencies, add them as a comma separated list in braces at the end of the URL, e.g. %SITE_URL%/scripts/code.js{jquery,json2}. Here is a list of possible dependencies that ship with WordPress.
Header Scripts
List script URLs to be enqueued in the header.
 
Footer Scripts
List script URLs to be enqueued in the footer. (The footer is often the best place to put Javascript files because it doesn’t slow the loading of the other HTML content.)
 
Styles
List stylesheet URLs.
 
Extras
Hardcode Javascript or CSS here. It will be outputted right before the </header> tag. Make sure to properly use the <script> and <style> tags. Note: while this is primarily used for Javascript and CSS, the contents of this box is dumped at the end of the header on the page. Anything extra you want to put in the header when this specific post is loaded can go here.

 

Settings Page

Allow Per Post Scripts & Styles For The Following Post Types:
 
Choose one or more of the post types to allow attaching specific scripts and styles to. If you have custom post types, they will appear in this list as well.
Only Load Scripts & Styles When
 
Most of the time you will want to select single post pages only. The only exception is if you’re displaying the full content (not just the excerpt) of a post on another page. This blog, for example, is using the second option because it displays the full content of some posts on the home page. Keep in mind, however, that selecting all pages will add a considerable amount of overhead to each page load since it will have to query the database for every post loaded on every page. Only use this if absolutely necessary.
Share:

How to Replace Changed URL in Wordpress Posts

How to Replace Changed URL


If you transferred your Wordpress site to a new domain or changed your current Wordpress URL, you'll probably find a bunch of references to the old site URL that need to be updated. Wordpress stores the site URL, links in images, and links in posts and pages as full URLs. When you change your URL, Wordpress does not automatically update old links. This post tells you how to update all of these links without having to manually edit each and every post.

This post doesn't explain how to transfer a Wordpress site. You can read some more details about moving Wordpress here. Typically when completing a test site and moving to a production server, I'll do a full MySQL dump using mysqldump --add-droptable via command-line, then transfer all files and process the SQL on the new server.

Copying your WP installation to a new server does not replace URL references automatically, so after any transfer you end up with a bunch of broken links. Not good! Fortunately there are a few easy SQL commands you can run to update your posts, pages and site URL.

Replace the references to olddomain.com and newdomain.com in the SQL code below with your actual URLs. Then you can run each query via phpMyAdmin or command-line, whatever your preference.

Always make a backup before doing bulk changes to your Wordpress database!

Step One: Replace URL in config

1
2
3
UPDATE wp_options
SET option_value = replace(option_value, 'http://www.olddomain.com', 'http://www.newdomain.com')
WHERE option_name = 'home' OR option_name = 'siteurl';

Step Two: Replace URL guid in WP posts

1
2
UPDATE wp_posts
SET guid = replace(guid, 'http://www.olddomain.com','http://www.newdomain.com');

Step Three: Replace links in WP post content

1
2
UPDATE wp_posts
SET post_content = replace(post_content, 'http://www.olddomain.com', 'http://www.newdomain.com');

Now you can just browse to your new site and test everything out. If everything went well, the SQL commands should have fixed all references to the old links in your Wordpress posts and site config.
Share:

Saturday, March 4, 2017

Getting the Most from WordPress Post Thumbnail

WordPress Post Thumbnail


The majority of page on the Internet includes an image; blogs are no exception.  More and more blogs are introducing newspaper style layouts with a large image at the top of each article.

Previously in WordPress the methods to display these was clunky, either having to upload and paste the URL into a custom field or using a php script to interrogate the content to find the first image.

WordPress 2.9 and above have bought a nice and easy solution to this problem with the introduction of post thumbnail.

Post thumbnail adds an additional meta box to your posts and pages allowing your editors to upload their own images completely separate to the content. It also has the ability to automatically crop your images to the correct size ensuring nothing ever looks out of align on your website.

Implementing Post Thumbnail

To enabled Post Thumbnail simple paste the following into your functions.php. I have also included the code to enable Post Thumbnail in just pages or posts.

if(function_exists('add_theme_support')) {
 add_theme_support('post-thumbnails');
 // add_theme_support('post-thumbnails', array('post')); // Add to posts
 // add_theme_support('post-thumbnails', array('page')); // Add to pages
}

Once enabled you should see a new meta box in your posts and pages in your WordPress admin.  We now need to tell WordPress what size we want the thumbnail to be.  You can do this by simply placing the following into your functions.php file.

set_post_thumbnail_size(570, 200, true); // width, height, crop (true or false)

In most cases we’ll want a few difference sizes for our post thumbnail for various areas of our website such as homepage, archives, single and search. This can be accomplished by creating new image sizes. Add this to your functions.php.

add_image_size('single_post', 200, 120, true); // name, width, height, crop

You can add as many of these as you want but remember it will create a crop for each image you upload so if you’re limited on space you may wish to try and keep them to a minimum.

Post thumbnails are created at the time the image is uploaded so if in the future you change your cropping sizes all previous post thumbnails uploaded won’t resize.  There is a plugin available called Regenerate Thumbnail which will go through all of your images and resize them to the new sizes.

Now we’ve set all the settings to our theme we can look at displaying the post thumbnail. You can use the following code in any loop to display a post thumbnail.

<?php
if (has_post_thumbnail()) {
 // an image has been uploaded lets display it
 the_post_thumbnail();
 // the_post_thumbnail('single-post'); // use to display custom thumbnails
  we've added previously
 // $image = get_the_post_thumbnail(); // this will return the image as a
  variable instead of printing it.
} else {
 // you may wish to include your previous method
  for older content or a default image?
}
?>

Here we’re displaying the post thumbnail in the loop. First we’re checking whether the post has a thumbnail attached to it.  If the thumbnail is present we can then either print out the default size or a custom one we’ve previously created in our functions.php file. I have added an else statement in this post in case you wish to add a default image or carry on supporting previous methods used before this function was used on your website.

Adding Post Thumbnail to your RSS

Unfortunately regardless of whether Post Thumbnail has been activated in your functions.php WordPress will not display them in your RSS feed. We can include the following function will add the thumbnail if available to each post in your RSS. Place it in your functions.php.

function rss_post_thumbnail($content) {
   global $post;
    if(has_post_thumbnail($post->ID)) {
         $content = '<p>' . get_the_post_thumbnail($post->ID) .
                '</p>' . get_the_content();
    }
    return $content;
}
add_filter('the_excerpt_rss', 'rss_post_thumbnail');
add_filter('the_content_feed', 'rss_post_thumbnail');

That’s it! Its really that simple.
Share:

Thursday, March 2, 2017

Training & Developing the Next Generation - Leadership Development



leadership development


An employee’s ability to learn on the job while simultaneously being selected, measured and developed as a future leader can be a headache for businesses. Every company claims it plans for the future, but the reality is that the expertise and leadership that drives it usually slip away with the best intentions of having learning and development as well as the succession plan in place.

The real-world nightmare is losing key leaders across an organization.

Those who can leave, will. Some of that can’t be prevented; some people want to move on regardless, and some people are just leaving the workforce.

According to Bersin by Deloitte’s Predictions for 2014, leadership will be a big challenge in 2014. “Executives are struggling with leadership gaps at all levels — from first-line supervision through top leadership (more than 60 percent of all companies cite ‘leadership gaps’ as their top business challenge). This year, baby boomers will begin to retire in large volumes; one oil company told me that they expect to lose 30 percent of their workforce in the next three years.”

This is echoed by Sue Ashford and Scott DeRue, leadership writers at the Harvard Business Review’s blog, “nearly 60 percent of companies face leadership talent shortages that impede performance. Even with unemployment rates as high as they are globally, that’s staggering to consider.”

That, despite the fact that U.S. companies spent upward of $13.6 billion on leadership development in 2012, according to research by Bersin by Deloitte. What’s clear is that when it comes to developing future leaders, too many organizations are simply going through the motions, or worse yet, doing nothing at all. These companies are losing out on a host of benefits, including:
  • Better business planning. Learning and leadership development leads to better succession planning, which then leads to developing and putting the right people in the right leadership roles at the right times. When organizations know they have the right people in the queue for key positions, they can proactively plan for the future of the business far more effectively.
  • Improved retention and lower turnover. Sound learning and leadership development helps to ensure that employees know they’re being groomed for a particular position, which gives them a strong sense of having a clearly defined future within the company. This is a strong retention tool and keeps people from leaving their companies for greener pastures. The resulting cost savings can be substantial, but it takes a long-term investment.
  • Improved employee engagement. Obviously, showing employees a learning plan and defined future with an upward career trajectory are powerful boosters of employee engagement and emotional commitment. And, as Gallup Inc. research showed the past few years, companies with highly engaged employees experience financial growth rates nearly four times higher than those of companies with lower engagement.
  • More accurate recruiting. Sound learning and leadership development also helps improve recruiting as well.
When employers have a clear understanding of their organizations’ gaps in skills and leadership qualities, they can sharpen their focus on recruiting for specific future roles (even those not yet defined by succession plans), shortening the recruiting process and increasing sourcing accuracy.

Learning and leadership development should be part of an organization’s total approach to talent management — which, in turn, should be integrated with its overall business strategy. This integration ensures that talent management activities are aligned to business goals and objectives, that employees are given the learning opportunities they need to develop their leadership skills and that the organization itself will have the leaders it needs for the future.

“Many companies today have some understanding of the talent they have and where their skills and leadership gaps are, but they don’t have the internal development processes in place or even the external recruiting plans they need,” said Mike Williams, vice president of human resources at Trinity Industries Inc.

Better Long Range

Succession-planning investments don’t fit well within annual budgets, Williams said.

They work better with long-range planning cycles, such as three- to five-year plans. But progressive companies that continually plan ahead invest in their long-term leadership development and succession strategy, which has to have buy-in from the top down. It takes a lot of discipline and investment, but the return is the greatest for the organizations that have a complete succession strategy.

Tim Jones, vice president of HR, talent and organizational effectiveness at ConAgra Foods Inc., thinks while it’s fairly easy to pull together a short list of successors at any leadership level and to create a development plan for those individuals, executing that development plan is tough. This is why senior leadership has to be committed to the learning and development plan as well as the time investment, which isn’t easy to do when running the day-to-day operations of the organization. This is what makes peer-enforced accountability so critical, and what can only be done when these individuals can learn and develop together.

In addition, Jones said, it takes significant financial investment to maintain a quality leadership development and succession strategy. “You have to cover the costs of leadership assessments, executive coaching, mentoring programs and other initiatives. That said, companies get much more bang for their buck when they commit to long-term succession and development investments that solidify leadership continuity.”

And it starts with collaborative learning.

Investment in Collaborative Learning 

With an improving economy and corporate restructuring for the most part behind them, business executives are looking to the future. Many large organizations have their sights set on global expansion, highlighting the need for new skills in global acumen, agility and innovative thinking throughout the enterprise.

After the Great Recession temporarily took the focus off learning and e-learning investments, enterprise investments in social learning technologies have increased significantly in the past few years, according to research firms like Aragon Research, Bersin by Deloitte, Forrester Research, Gartner Inc., International Data Corp. and Ventana Research. Driving this growth is the explosive demand for social learning, formal and informal knowledge-sharing and increased collaboration.
Unfortunately, today’s learning management systems focus more on scheduling and taking courses than delivering learning development results. Companies are looking for scalable, holistic and comprehensive leadership development answers that create thriving learning and leadership communities where participants create and curate relevant content to then share with peers and colleagues.

There are viable models that exist today for knowledge sharing, and while they’ll never entirely take the place of formal classroom coaching, private industry and university movements like massive online open courses, better known as MOOCs, and online learning sites like Coursera, Khan Academy, Skillshare and Udacity have dramatically changed how learners attain knowledge in thousands of different subjects.

These have become learning communities that combine social tools with the power of video, of which its impact is undeniable. According to online analytics firm comScore’s monthly index of Internet video usage in the U.S., in November 2013, 189.2 million Americans watched 47.1 billion online content videos.

These online learning sites and services have released knowledge from the time and space boundaries of the formal classroom; organizations can also do this for their leaders, simultaneously developing their leadership skills while continuing their day-to-day work. Plus, busy leaders don’t always have time to sit in a classroom to wait and watch lectures, so learning must come to them in the form of easy-to-consume mediums like video.

Leadership development is a collaborative learning and development exercise, one in which mentors and instructors should share information virtually, and where peers can learn from each other long after formal instructor-based learning is completed.

JetBlue Airways Corp. operates a “Hire, Inspire, Grow” program that creates a fully integrated talent system, with its goal being to fill 80 percent of nonfront-line positions internally. That just can’t be done today without a collaborative learning and leadership development platform. Experience-based learning that’s reinforced by colleague and expert networks, informal training, real-world video vignettes and the like are significantly better at reinforcing behavior change than formal training activities alone.

This is how organizations can harness some of our instinctive tendencies into collaborative learning and leadership development communities that attract, identify, engage, develop and retain today and tomorrow’s world of work stars.
Share:

Sunday, February 26, 2017

8 Career Lessons from Your Favorite TV Characters


We’ve all heard the saying, “Art imitates life.” TV characters become our favorites because they strike a chord with our own reality. We either relate to them or there is some aspect of their lives and attitudes we wish we could emulate. Sure, you may not be a fugitive from the FBI or an impossibly perky vampire, but even these exaggerated characters provide solid career advice.
Learn from their victories and mistakes, read a little between the lines, and inspire yourself to reach that next goal at work.

Career Lessons


1. Jessica Pearson — “Suits”

Appearance matters.

People judge you in the immediate seconds after seeing you. Jessica (Gina Torres) is a powerful head of a successful law firm, and it’s evident just by looking at her. Her professional, tailored clothes are sexy without being inappropriate. She isn’t afraid to experiment with high fashion, making clients feel she’s ahead of the curve.
Clothes don’t entirely make the woman. You also want to stand tall, speak with confidence, and maintain a cool demeanor even in tense situations. Like Jessica, command attention the moment you arrive and then hold that attention for the rest of the meeting.

2. Raymond “Red” Reddington — “The Blacklist”

You can’t succeed without strong relationships.

You don’t want to relate too strongly to a murderous sociopath, but there is no denying that Red’s (James Spader) extensive network of contacts is impressive. He’s amassed an incredible fortune and kept himself alive in a dangerous business by using his wit and charm to cultivate friends and useful resources. The more people he knows, the more valuable a contact he himself becomes, and his network expands even further.
Many of us have someone like Red in our lives. He’s the one who says “I know a guy,” to any problem you’ve ever encountered. If you don’t have the personality to build that kind of network, focus on getting to know the people who do.

3. Alicia Florrick — “The Good Wife”

Don’t be afraid to change careers.

Alicia (Julianna Margulies), a former stay-at-home mother and political wife, plunged back into the workforce at the bottom rung of a law firm. Since then, she’s moved up to a partnership in the practice, started her own firm, merged with another firm, and taken on a political career. She earned increasingly greater money and prestige, changed lives and enriched her own.
While career shifts are stressful, follow Alicia’s lead and never give up. Bravely face new challenges, learn new skills, and keep an open mind about change, even if it is drastic. Not every move will be successful, but you’ll gain invaluable wisdom and experience. Even when things seem to be at their worst, we know Alicia has the talent, resources, and guts to start all over again. You can do the same.

4. Sheldon Cooper — “The Big Bang Theory”

Find order in the chaos.

Sure, Sheldon (Jim Parsons) is obsessively compulsive about sitting in the optimum corner of the couch and complying with rigid roommate agreements. It is wise to have some semblance of order in your work life, however. Keeping your desk organized helps you more efficiently find files and supplies when you need them. Maintaining routines on small tasks makes it easier to complete them on autopilot.
Having order in at least part of your day provides comfort and stability. This helps reduce stress and makes it easier to deal with chaotic days, and eliminate any Sheldon-level meltdowns when a project doesn’t go exactly as planned.

5. Rayna James — “Nashville”

Know when to be your own boss.

Rayna (Connie Britton) stayed with Edgehill Records for as long as they kept her career on track. Once she felt herself getting shoved aside in favor of new artists, she made the move to start her own label. While we haven’t always agreed with her business skills, we can’t deny that Rayna saved her own career.
If you feel stagnant and disrespected at your current workplace, and see promotions going to new hires, consider cutting the cord. Become a consultant, do freelance work, or start your own firm. You know your own strengths better than anyone, and can take charge of your own destiny.

6. Nick Burkhardt — “Grimm”

Information is power.

Where would Nick (David Giuntoli) be without all of those books in his aunt’s trailer? As a Grimm, his very survival depends on knowing exactly what he’s dealing with. The same is true in your career. Sometimes a metaphorical Wesen might leap up out of nowhere, but in most cases there is time to plan.
Do your research before a new job interview, or when courting a new client, or launching a new website. Seek advice from successful people, and learn from your predecessors. The more information you have, the easier it is to answer questions, solve problems, or lunge at opportunities when they come up.

7. Caroline Forbes — “The Vampire Diaries”

Maintain a social life.

Barring the whole “turning off emotions” part of her life, Caroline (Candice Accola) has always been the cheeriest vampire on television. No matter what supernatural danger confronts her, she’s ready to take time out for a party. While the “TVD” universe is pretty surreal, there is a method to Caroline’s madness.
 
Constant work leads to burnout, and also keeps you removed from the real world. If you’re trying to market to people, or create a new product, it helps to actually interact with those your business is trying to reach. Learn from Caroline and encourage your coworkers to take time out as well. When everyone has the chance to blow off steam, there’s a lot less carnage when things get stressful.

8. Harold Finch — “Person of Interest”

Privacy is a good thing.

Harold (Michael Emerson) has some good ideas about privacy, but you don’t need to live off the grid in an old subway station to get the same privacy. Maybe a super computer isn’t tracking you down with murderous intent, but that doesn’t mean no one’s watching. Don’t share every detail of your life on social media. Those radical political ideas, bad jokes, or embarrassing hangover photos could cost you a promotion, or even your job.
Consider keeping your private life separate in the office as well, especially at a new job. Get to know people better before you trust them with secrets. As Harold and his devoted colleagues have shown us, the friendships worth having take a bit longer to cultivate.
Maintaining a career is so much more than just showing up to work each day. These eight characters teach us that everything from the first impression you make up to the life you lead outside work matters. You don’t reside in the same glamorous or dangerous worlds these fictional people do, but adapt their wisdom to help you find success in your career.
Share:

Tuesday, February 21, 2017

How to Solve ‘You Do Not Have Sufficient Permissions to Access This Page.’ in WordPress



WordPress Tips

I have been running into troubles logging in to WordPress and was kinda frustrated all morning.

Basically each time I use tried to log in, I get:

You do not have sufficient permissions to access this page.

I could not edit the blog, nothing works except the front page. I did a couple of searches at Google but the solutions didn’t seem to work for me.

In the end, I did a new installation of WordPress and scrutinized every damn thing in the users and usermeta table between a database that worked and a database that doesn’t.



Did you change the prefix of your table names in WordPress after the migration?

In my old database, I used ‘wp_’ as my prefix. As I migrated, I decide to use ‘wp3_’ instead of ‘wp_’. Unfortunately, the meta_key values are tied down to:
  • wp_user_level
  • wp_capabilities
  • wp_autosave_draft_ids
I need to update it to
  • wp3_user_level
  • wp3_capabilities
  • wp3_autosave_draft_ids
I wrote an SQL statement to share, just replace ‘prefix_’ with your new WordPress prefix. The following statements go to ‘meta_key’ and does a string replace from ‘wp_’ to ‘prefix_’.

UPDATE `prefix_usermeta` SET `meta_key` = REPLACE( `meta_key` , 'wp_', 'prefix_' );

(Make sure you do backups first! Note that the quotes used for string and field name are different.)

In the options table, there is ‘wp_user_roles’, make sure you get that changed into ‘prefix_user_roles’.

UPDATE `prefix_options` SET `option_name` = 'prefix_user_roles' WHERE `option_name` ='wp_user_roles' AND `blog_id` =0;

(Make sure you do backups first! Note that the quotes used for string and field name are different.)

With everything set, I tried logging in again and it worked. A happy WordPress user once again. I am using WordPress 2.2.2 before the migration and I did not upgrade WordPress during the migration. Hope it helps. (Applies to WordPress 2.3.3 also.)
Share:

Copyright © HARDIK RAMI | Powered by Blogger
Design by SimpleWpThemes | Blogger Theme by NewBloggerThemes.com