I am trying to:
I have a view where a list off the custom taxonomy 'Event categories' is shown with url.
When I go to the url i always see my latest added post.
How can i show the correct post with that category?
I visited this URL: hidden link
I expected to see: At left side a view with all 'Event Categories' en right side all the posts with from the category 'in-house-event'
Instead, I got: Latest added post.
Dear Thomas,
I checked the URL, but can not find the "Latest added post", how do you setup it?
Is it a widget?
If it is, I suggest you try with widget of Views plugin, see our document:
https://toolset.com/documentation/user-guides/views/
Section "4. Displaying the View":
To display a View as a widget, go to Appearance->Widgets. Look for the WP Views widget and drag it to a widget area. Then, select the View to display.
Dear,
I don't think that I described my problem correct.
The url hidden link should by a list of all posts from the taxonomy 'in-house-event'.
I made an archive layout for the taxonomy of 'event-category'. This is shown on the page hidden link or hidden link
But when I go to hidden link it must shown only the posts of the taxonomy in-house-event and if I go to hidden link it should shown the posts of taxonomy 'congress'. How can i do that in a lay-out or view?
I assume the problem URL is archive page of term "in-house-event", you are going to display the posts which are assigned with term "in-house-event", this is built-in feature of WordPress, in your layout, you can add a "Wordpress Archive cell" to display the posts, see our document:
WordPress Archive Cell
https://toolset.com/documentation/user-guides/wordpress-archive-cell/
Dear,
Yeah that is the result that I want but is it possible with the same pagination of the views?
So Previous 1 2 3 ... 5 Next?
The pagination of Archives page is depends on your theme file. for example in wordpress default theme twentysixteen, file archive.php line 47~52:
// Previous/next page navigation.
the_posts_pagination( array(
'prev_text' => __( 'Previous page', 'twentysixteen' ),
'next_text' => __( 'Next page', 'twentysixteen' ),
'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>',
) );
More help:
http://codex.wordpress.org/Function_Reference/the_posts_pagination
I use the toolset starter theme from wp-types but this theme doesn't have an archive.php file?
What do i need to do?
The toolset starter theme is using theme file "index.php" to render the wordpress archive page, I suggest you try this:
1) Create a theme file "archive.php" in your theme folder, copy/paste the PHP codes from index.php to archive.php.
2) Find the PHP codes 44~49:
// Previous/next page navigation.
the_posts_pagination( array(
'prev_text' => __( 'Previous page', 'twentysixteen' ),
'next_text' => __( 'Next page', 'twentysixteen' ),
'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>',
) );
Modify it as what you want
But I use the WordPress Archive function of Toolset.
So in the loop info is this shown:
<!-- wpv-loop-end -->
[wpv-archive-pager-prev-page][wpml-string context="wpv-views"]Older posts[/wpml-string][/wpv-archive-pager-prev-page][wpv-archive-pager-next-page][wpml-string context="wpv-views"]Newer posts[/wpml-string][/wpv-archive-pager-next-page]
How can i change this so the the pagination becomes 'Older posts 1 2 3 ... 6 Newer Posts'?
There isn't such a feature within Views plugin, you can create a custom shortcode for it, for example:
1) add below codes into your theme/functions.php:
add_shortcode('my-archive-pagination', 'my_archive_pagination_func' );
function my_archive_pagination_func($atts){
return get_the_posts_pagination( $atts );
}
2) use the shortcode, like this:
[my-archive-pagination mid_size="3"]