Shresrtha Narayan
Shresrtha Narayan

Reputation: 11

How to show my plugin in WordPress?

can any one help to solve a problem? Just For example: If I have one site wpnpl.com.np I wannt to give access to the files of a plugin like if they type wpnpl.com.np/npl they will access the features of the plugin How to do this???Any Idea

Upvotes: 1

Views: 50

Answers (1)

Ravi Solanki
Ravi Solanki

Reputation: 63

First create plugin short code in your plugin core file

 function bartag_func( $atts ) {
        $atts = shortcode_atts( array(
            'foo' => 'no foo',
            'baz' => 'default baz'
        ), $atts, 'bartag' );
        return "foo = {$atts['foo']}";
    }
    add_shortcode( 'bartag', 'bartag_func' );

After that create a page in wp-admin with slug npl and content with

[bartag foo="bar"]

Upvotes: 1

Related Questions