Customise wp_List_pages to output a UL LI

Arguments of wp_link_pages() Maybe this will work for you: $args = array( ‘before’ => ‘<ul><li>’ . __( ‘Pages:’ ), ‘after’ => ‘</li></ul>’, ‘link_before’ => ”, ‘link_after’ => ”, ‘next_or_number’ => ‘number’, ‘separator’ => ‘</li><li>’, ‘nextpagelink’ => __( ‘Next page’ ), ‘previouspagelink’ => __( ‘Previous page’ ), ‘pagelink’ => ‘%’, ‘echo’ => 1 ); wp_link_pages( $args … Read more

How to customize wp_link_pages()?

You can use next_or_number param of wp_link_pages to achieve this. From Codex: next_or_number (string) Indicates whether page numbers should be used. Valid values are: number (Default) next (Valid in WordPress 1.5 or after) Then you can use nextpagelink and previouspagelink params to modify these links texts. So doing it like this should do the job: … Read more

Get URL of current post but not the page number

I don’t think your code works as expected because you are not printing the URL of the post. Note that get_permalink() returns the permalink of current post inside a loop but doesn’t print it like the_permalink(). So, you should use <?php echo get_permalink(); ?> or <?php the_permalink(); ?>.

How to cache wp_query with pagination using transients?

You need to set a unique transient key for each page of posts otherwise each page will output same posts. Here is a example. Focus on get_transient & set_transient functions. <?php $my_posts_query = get_transient( ‘my_unique_transient_key_’ . get_query_var( ‘paged’ ) ); if( false === $my_posts_query ) { $args = array( ‘post_type’ => ‘post’, ‘posts_per_page’ => ’12’, … Read more

Hide text if not homepage

You can use is_paged() …checks if page being displayed is “paged” and the current page number is greater than one. This is a boolean function, meaning it returns either TRUE or FALSE. You can adjust your code as follows <?php if( is_home() && !is_paged() ) : ?> <p>Some text</p> <?php endif;?>

Custom taxonomy pagination

Drop your custom query and go back to the default loop. Never replace the main query on the home page or any kind of archive page with a custom query. Use pre_get_posts to alter the main query variables before the main query runs Your taxonomy archive page should look like this if ( have_posts() ) … Read more

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