Get page content by ID (from a plugin)

The values assigned to $user_set_value should be stored somehow in some form, usually an option. You will know how the values and where the values are stored. It is easy then from there $user_set_value = get_some_saved_option_value(); $args = array( ‘page_id’ => $user_set_value ); $q = new WP_Query( $args ); Just change get_some_saved_option_value() with the actual … Read more

Content template when adding a new page

Use shortcodes with as many attributes as you want. add_shortcode(‘custom-display-of-data’, ‘custom_display_of_data’); function custom_display_of_data($atts) { $atts = shortcode_atts( array( ‘foo’ => false, // default foo is false ‘bar’ => ‘default bar’, // default bar is string: default bar // define defaults for as many attributes you need ), $atts, ‘custom-display-of-data’ ); // place your code here … Read more

Display only current page -> posts tags in page

First you’ve to know what you want to retrieve, you will have to find something identical for that group of post you want to retrieve. Use the following code to retrieve the post, where $args is the variable what contains the arguments to select the right post ids. $posts = get_posts($args); $terms=array(); foreach($posts as $post) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)