URL Variables in a Certain Page

Try this code:

add_filter( 'query_vars', 'my_query_vars' );
function my_query_vars( $vars ) {
    $vars[] = 'catname';
    return $vars;
}

add_action( 'generate_rewrite_rules', 'my_rewrite_rules' );
function my_rewrite_rules( $wp_rewrite )
{
    $products_page_id = 1; //your product's page ID
    $wp_rewrite->rules = array(
        'products/?([0-9]{1,})/?$' => $wp_rewrite->index . '?page_id='.$products_page_id.'&paged=' . $wp_rewrite->preg_index( 1 ),
        'products/(.+?)/?([0-9]{1,})/?$' => $wp_rewrite->index . '?page_id='.$products_page_id.'&catname=".$wp_rewrite->preg_index( 1 )."&paged=' . $wp_rewrite->preg_index( 2 ),
        'products/(.+?)/?$' => $wp_rewrite->index . '?page_id='.$products_page_id.'&catname=".$wp_rewrite->preg_index( 1 ),
    ) + $wp_rewrite->rules;
}

You”ll get cat_name than as get_query_var('catname'); and paged as get_query_var('paged');

To little explain the code above: this adds rewrite rules to WordPress, when each request to www.yourdomain.com/products/ get rewrote to (means brings content from) www.yourdomain.com/index.php?page_id={$products_page_id}&paged=2 (for example).

$producst_page_id is a ID of your products page in administration with your shorcode – thus page which content should appear. paged is a parameter for you to be able to get another page of your products. catname is another param for you to, filter returned products by category.

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