Saturday, April 12, 2014

How to add menu in Wordpress Admin without Plugin

Here we are talking about Adding a menu item in wordpress admin panel to add manual functionality for your themes and plugins etc. Let's do it You need a Wordpress Function called add_action which get 2 parameter. 
add_action Parameters Explanations:
  1.  First parameter is what do you want to add so we write admin menu.
  2. Second parameter is that we will tell wordpress add action that my other explanation will be in signal_adder function
what will be in signal_adder function

We write function signal_adder(){

==>now our add_action will complete after this function  

we are telling wordpress in next line add_posts_page it means our menu item will be in posts section just copy the code and paste in theme functions.php file and you will see there is a menu called Add Signal.

add_posts_page parameter Explanations
  1. First parameter will be the Menu Title 
  2. Second parameter will be the Page Title 
  3. Third parameter will be manage our page options (Fixed just write as it is)
  4. fourth parameter will be your choice because in our admin panel url will be 
  5. Fifth parameter will be a function in which our other things lie like what will be the page matter or texts etc. 


function signal_adder(){
    add_posts_page('Add Signal','Add Signal','manage_options','signali','signal_adder_text');
function signal_adder_text(){
    echo "Hurrah i make a custom admin menu";

Beginners always feel very ambiguous while making admin menu just write i will comment and solve your problem as already i am beginner not an expert but the problems i tackle i write here. Just follow the path and you will be lead by me. Hope you will like this tutorial then you going to share and comment your review thanks for reading.


Post a Comment

Please Don't write wrong comments.
Please write good comments or mistakes ...