Show posts of category in a page

The way i’d do it: First – create a page in the wp admin. Then create a file like mypage.php. Save it in your theme and a the top of it, add this to tell wordpress that this is a custom page template: <?php /* Template Name: Custompage */ get_header(); ?> Note: it’ll also already … Read more

Need help understanding pagination parameters

The following code line: $paged = ( get_query_var(‘paged’) ) ? get_query_var(‘paged’) : 1; is using the ternary operator ?: It’s a shorthand notation for if( get_query_var( ‘paged’ ) ) $paged = get_query_var(‘paged’ ); else $paged = 1; This can in fact be simplified further, by using the the second input parameter for the default value, … Read more

Keep Pagination in Tabs

Use the following extension to the WP_Query class. The extension only takes your arguments as an array, rather than a string format. You’ll to add individual values for “page_link” for each of your tabs. This should just be a string (“tab1”, “tab2” etc etc) Then you’ll need to use the $my_query->next() and $my_query->prev() to add … Read more

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