Our Mentor, Gaurav Pareek Speaks At WordCamp Pune, 2015

wordcamp-puneWordCamps are locally organized, informal conferences that cover everything around WordPress, an open-source publishing software. This conference conducts formal and informal sessions with an objective to learn WordPress that powers more than 75 million websites. It is conducted all over the globe every year. The next one is approaching on 6th Sep, 2015 at Pune, India.

WordCamp Pune, 2015 will witness a lot of informative sessions and workshops revolving around WordPress. It is an ideal platform for WordPress bloggers, designers and developers who wish to experience the power of an open source software. This time it is conducted in a local language along with English, i.e. in English, Hindi and Marathi. So, one can witness a lot of learning pouring in different languages.

gaurav-pareekOur mentor Gaurav Pareek will also share some of his experiences and understanding at WordCamp Pune, 2015. He discovered WordPress in 2009 and fell in love. He also spoke in WordCamp Mumbai, 2015 and was appreciated by a lot of people. This time he will speak on ‘An Introduction to the WordPress REST API’.

The WordPress REST API is an upcoming feature of WordPress, and is currently being developed as a feature plugin. The API will put WordPress in the league of modern web software. It will prove its viability as a strong base for not only building large, content heavy websites but also things like web and mobile applications.

Gaurav will be giving a technical introduction to the REST API and some demos related to it. The main purpose of the presentation is to make people aware of the advantages, and the power and flexibility it gives to developers. It thereby enable them to make not only great websites, but powerful and innovative web applications as well, all the while tapping into a stable and familiar core that is WordPress.

So, get ready to experience the power of WordPress REST API with Gaurav. Get your tickets now and join the community of WordPress lovers at Pune this time.

Using Hook Priorities In Genesis

Hooks are amazing. They allow adding/removing/changing functionality without editing any core files. In a modern framework such as Genesis, hooks form the basis of nearly all customization. For example, to add some text just after the site header, you would do this:

add_action('genesis_after_header', 'some_function');

Where `some_function` prints something. But what happens when this hook trivia becomes bigger than little tweaks? What if you have to add/remove multiple things, or override actions defined in the framework. Someone recently asked on Google+

How do I add the secondary navigation above the footer in a Genesis child theme?

Well that’s simple, just hook the navigation to the appropriate hook(*genesis_before_footer*) in this case. But let’s see what happens in one particular case.

Screenshot from 2014-02-28 19:03:39

There’s our problem, the navbar displays below the footer widgets. This can be traced back to framework code. On line 14 of *lib/structure/footer.php*, you’ll find this

add_action( 'genesis_before_footer', 'genesis_footer_widget_areas' );

Now we’re assigning our function to the same hook, but it runs after the one defined in the framework. Why does this happen, and how can we correct this?

Enter Hook priorities

The WordPress codex entry about hooks tells us why this happens

(int) (optional) Used to specify the order in which the functions associated with a particular action are executed. Lower numbers correspond with earlier execution, and functions with the same priority are executed in the order in which they were added to the action.
Default: 10

Hook priorities allow us to define the order in which our hooked functions are to be executed. So, to add our navigation bar above the footer widgets, we just execute the function with a lower hook priority than the default(10). So the code would be like

add_action( 'genesis_before_footer', 'genesis_do_subnav', 9);

And the result is what we wanted.
Screenshot from 2014-02-28 19:07:58

Other places that this might be useful in the Genesis framework:

  • Place elements(e.g. featured image) before/after entry-title, before/after entry-header, etc.
  • Change the order of elements via hooks.
  • Place elements in footer, before/ after the main footer content.
  • And many more.

If you have an interesting example, or any doubt, don’t forget to comment below, and sign up for my newsletter on the bottom to receive tutorials and articles every week.

Hello World!

If you’re reading this, you either followed a link on one of the social media websites, or you know me from somewhere. If you know me already, high five. If you don’t know me, you will.

After running 3 failed startups, and a moderately successful design agency during the past 5 years, with different partners, I’m on my own in the wild now. MagikPress is my first foray into the world alone, and I hope that this will turn out to be a positive thing.

Anyways! This will be the official MagikPress blog, and I’ll write things related to WordPress, Genesis, Bootstrap, Linux and various things, ranging from tutorials to reviews to full blown product launches.

For the first few weeks, I’ll be taking requests for articles. So if you have anything that you want me to write about, do mention in the comments. Topics that I’ll cover are:

  • WordPress(themes, plugins, development)
  • Genesis Framework
  • Design, typography, UX and things like that.

P.S. I’m testing my first Genesis child theme right now, so stay tuned for that.