Skip to content

Instantly share code, notes, and snippets.

View q2amarket's full-sized avatar

Q2A Market q2amarket

View GitHub Profile
@q2amarket
q2amarket / q2amarket-plugin-path-and-url.php
Created March 28, 2016 12:00
Get plugin path and url
<?php
/**
* To set pluign path I used below
*
* Since my core class is in sub-directory of plugin, I had to point upward to get root directory
*/
define( 'Q2AM_DIR', q2am_trailingslash_dir( realpath( __DIR__ . '/../..' ) ) );
/*
@q2amarket
q2amarket / README.md
Last active February 14, 2018 06:16
This code will allows to create custom page without creating a page in admin > page area. This will create automatically and doesn't require any page creation in plugin section too. Replace your-page to what you like

#Create Page With Plugin

This code will allows you to create page without adding page in Admin > Pages area. This page can be set as a home page by defining constant path in qa-config.php. Also you can create menu link by adding page request (page slug e.g. your-page).

##Usage

  • Create directory in qa-plugin. for example: your-site/qa-plugin/your-page
  • Place qa-plugin.php and your-page.php file in your-page directory you created in above step

###Optional To make page as a home page