4 Tips to Make an excellent WordPresss Theme

4 Tips to Make an excellent WordPress Theme

As a web developer, using WordPress as a platform of your web can bring you on two sides. On one side, WordPress can be done easily without the need of high level of technical knowledge, as you can just do copy and paste code. While in other side, using WordPress may be a curse, as even you go against the WordPress coding standards for PHP, HTML, CSS and JavaScript, your theme are still doing well.

Therefore, to explore how to structure WordPress theme in a simple and practical way, you need to read the article below and take a closer look at the WordPress templating system and how data is retrieved, as this article will provide you with some tips to create a better WordPress theme web development practices.

  1. Divide between Functionality and Presentation

Cram all the functionality into their theme, when much of it belongs in plugins is what most WordPress theme authors try to do. Moreover, on some points of view, keeping a theme as close to the presentation is a much better. However, if the functionality you are working on does not provide visual enhancement or fronted display it probably belongs in a plugin. Having limited theme functionality will allow users to mdify the appearance of their site, without the need of missing a substantial element of functionality. In fact, you can utilize a plugin which is already integrated with the theme. Another suggestion for this kind of theme is to insert styles for the plugin functionality in the theme. Moreover, it potentially reduces the number of http requests, which causes a better site performance.

  1. Compose Procedural Code

Mostly WordPress theme authors are more familiar with procedural programming than object oriented programming (OOP), since WordPress is written in a mostly procedural manner. But because WordPress is still in PHP 5.2 we tend to find ourselves either writing pseudo-OOP code or prefixing all our functions with something in order to prevent naming conflicts. However, the limitation of a version of PHP that has been unsupported over four years must not be an obstacle as we should attempt to drive our community forward and do not restrain ourselves.

The usage of PHP namespaces instead of pseudo-OOP code or prefixed functions is highly recommended if you want to build themes for clients directly and comprehend the environment the code will run in. To create a manageable and readable file, you can determine a namespace or sub-namespace in PHP. Since, each of these namespaces is a different scope, so there will be functions with the same name throughout your project. This will avoid you from conflicts or fatal errors in the site.

  1. Enqueue Your Scripts and Styles

Below writing tags will be common for you, if you get used to HTML :

<pre><link rel=”stylesheet” type=”text/

css” href=”theme.css”></pre> or <pre> <scriptsrc=”myscripts.js”></script></pre>

Many online tutorials have misled this information which they said this was the right code, but this is actually a wrong example.

Moreover, there are two resemble functions that allow you to include style sheets and scripts to your theme:

wp_enqueue_style()

and

wp_enqueue_ script()

 

These two functions permit you to define dependencies.

(wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer)

 

The third argument is dependencies. For example, let’s say you are adding a slider script to your theme and this script requires jQuery to be loaded before it will work. Furthermore, you would have to pay close attention to the order in which you placed these files if you use the direct linking method. Using wp_enqueue_script() to include your slider script means you can pass a dependency of jQuery and WordPress will make sure jQuery is loaded on the page before your slider script. WordPress ships with a couple of dozen scripts that you can add using this method by simply calling the handle to enqueue, or passing the handle as a dependency of your script.

WPScript

 

In order so you can determine load order of style sheets, the wp_enqueue_style() function comes with a dependency argument.

Another reason, why wp_enqueue_script is recommended is because the last parameter in the wp_enqueue_script() function referenced previously, which controls whether or not the script loads in the header or the footer of the site.

  1. Use Template Parts

One of the most highly useful function of WordPress is called get_template_part() which we can apply in our templates to call bits of disposable and usually used code, as seen in the below example from a ‘page.php’ template:

<pre>
<?php if ( have_posts() ) : ?>
<main id=”content” class=”site-content” role=”main”><?php while ( have_posts() ): the_post(); get_template_part( ‘partials/content’,’page’ ); endwhile; ?></main>
<?php endif; ?> </pre>

 

Then the inside of ‘content-page.php’ will look like this:

<pre>
<article class=”entry”> <header class=”entry-header”><?php the_title( ‘<h2 class=”page-title”>’, ‘</h2>’ ); ?><?php if ( ! empty( $post->subtitle ) ) {?> <p class=”subtitle”><?php echo esc_html( $post->subtitle );?></p> <?php } ?></header>
<section class=”entry-content”><?php the_ content(); ?></section>
</article>
</pre>

 

By utilizing get_template_part(), someone can cover the whole snippet with just one line of code, and if you want to replace the markup or logic, you only need to reorganize it in one place. Above all of other points, those presented points are the most clean, and secure WordPress codebase. You can try them to make your WordPress theme looks perfect.

Other Things That You Should Know As a SEO

What is your first thought that enters your mind when you hear about SEO? Is it something related with coding and website development? Well, if you think so, you are almost right, however as an SEO, the job is not merely about coding, but you also need to consider many other aspects.  These days, when you say you “do SEO”, you really do about a million other things that historically aren’t considered SEO. If that’s the case, then what else is in the SEO job description?

  •  Content Developer

“Content is king” is a saying that should not surprise you. If you want to rank well, there is no other way unless you create good content on your website. In many cases, the requirements of being non-technical SEO now include content writing. However, making a quality content is not an easy thing, since there is no formula you can follow and it does take a lot of time. This is something that you may need other persons to do,  in case you cannot do it by yourself.

  • User Experience Advocate

Even though Google hasn’t stated that good user experience impacts to search rankings, there is a lot of speculation that user experience will be adding mobile user experience into its algorithm. It means that if you want to drive more traffic to a page, the page should provide a good user experience for all platforms.

  • Digital Strategies

SEO today means playing a bigger role in overall site strategies, however there are still a lot of people who view SEO in a silo, so it’s up to us to not pigeonhole ourselves into just keyword research or title tag updates.

  • Creative Marketer

It means you are not creating SEO campaigns or link building campaigns, you are creating marketing campaigns for brand awareness, boost social mentions, generate PR buzz and of course, still building some links.

  • Cheerleader

As an SEO, you need to realize that SEO contains creative, social media, IT and copywriting, so educating them on realizing what they do is actually SEO, is the way for you and your team to meet your goal.

5 Digital Marketing Trends in 2015 that will boost Your Strategy

The digital world is where everything runs and changes quickly.  The strategies that you use one day could change abruptly or may not be suitable anymore the next. That is why, a person who works in this field will need to follow current trends, settle on an actionable strategy and have a strong need to always learn. Since, the subject is always developing, long term strategies will not be suitable. Therefore, in this article, the strategies that will be offered are short-term strategies. Here are some of the strategies that you may want to consider.

  1. Stop relying on Google.

This does not mean that relying on Google is not right, but it just means, don’t only focus on Google. Search engine optimization is important, but a searcher can accomplish her goal through more means than just Googling. So, It is better for digital marketers to rely less on Google and engage more direct forms of interaction with their target market.

  1. More Mobile.

Marketers now have to find a way to make media concise and digestible enough for consumers who are on the go and viewing from a small and movable screen, so the development of digital marketing strategies in mobile, such as the importance of mobile search, mobile optimization, mobile conversions, and mobile ubiquity is very important. Since, mobiles are still being developed and the opportunity is around defining what works and what doesn’t in the evolving space of mobile, there are still a lot of things for you to explore.

  1. Social conversion is coming

The utilization of social networks is impressive these days, as it is stated in a recent survey of social media services in Melbourne, that 69% of people used social media to get marketing information, 89% said they generated greater business awareness with social media management, while 62% reported a rise in search engine rankings after using this platform for more than 2 years. However, the importance of social conversion is needed to be considered too. For ecommerce and lead generation sites, social provides a growing opportunity to improve conversion rates and gain new conversion channels.

  1. New payment methods are on the rise.

With the existence of EVM credit cards, society faces many new methods in payment. These new methods of payment will have some effects on online payment and e-commerce sites. Privacy issues are mainstream concern and it is up to digital marketers to lead the way in reassuring, educating, and coaching customers through the transition.

  1. Content Creators are more necessary than ever.

Do you provide a reason for people to spend more than a few seconds reading your pages? Do you offer real value, something of substance to visitors, that is unique, different, useful and that they won’t find elsewhere? In order to provide good content, you will need professional crew, such as great writers, developers, video producers, and speakers. I know from experience that a great crew is hard to find, so just find people who possess the knowledge, ideally experiential knowledge, of the subject matter needed.