Keyword Landing Page Generator

Which filters/actions can be used with the plugin?

Filters

  • 'wpsos_klpg_shortcode_text' - filters the shortcode text value right before displaying.
  • 'wpsos_klpg_custom_content' - filters the custom HTML text configured from General Settings right before displaying to the user.
  • 'wpsos_klpg_quickstart_landing_page' - filters the page that's created with the 1 click quick start.

Actions

  • 'wpsos_klpg_before_custom_content' - before displaying the custom HTML text configured from General Settings for the user.
  • 'wpsos_klpg_after_custom_content' - after displaying the custom HTML text configured from General Settings for the user.
  • 'wpsos_klpg_before_settings_page' - before displaying the settings page in admin UI.
  • 'wpsos_klpg_after_settings_page' - after displaying the settings page in admin UI.

Using your custom PHP template.

If you prefer using a custom WordPress template for using the Triggering Keywords and their values, here is the way to go:

  1. Create a WordPress template file under your theme.
  2. Load the existing Shortcode Keys and their values into a array. For that, you can use the global object $WPSOS_KLPG and it's class method 'get_keyword_values'. The class method takes one parameter, the keyword. The keyword is accessible via the query_var called 'wpsos_mkey'.
  3. Using the received array, you can display the values of the Triggering Keyword from the URL, with the Shortcode Keys as the array keys, configured under the Shortcodes Settings.
  4. Create a page and choose the new template for the created page.
  5. Flush the permalinks by going to the Permalinks settings and clicking 'Save'

Sample code when using your own template.

Here below is a sample code to show how to use the keys in your own template.

		...
		/** Template Name: Keyword Landing Page Generator **/
		get_header();
		...
		global $WPSOS_KLPG;
		//Check if the method exists
		if( method_exists( $WPSOS_KLPG, 'get_keyword_values' ) ){
			//Take the set array by the key value from the query vars, load 'default' if not found
			$key_array = $WPSOS_KLPG->get_keyword_values( get_query_var( 'wpsos_mkey', 'default' ) );
		}
		else {
			//Otherwise load an empty array
			$key_array = array();
		}
		...
		//Display the corresponding text of 'main-heading' configured under the Shortcode Settings
		echo $key_array['main-heading'];
		...
		//Display the corresponding text of 'content' configured under the Shortcode Settings
		echo $key_array['content'];
		//Your content
		...