Custom template pagination

If you’ve created a Custom Post Type, then WordPress should be able to handle this for you automagically. Check the Template Hierarchy. Instead of creating a “Page” and trying to paginate that, create archive-{post_type}.php instead. That file will be used as the index file for your CPT, and will show up automatically at http://yoursite.com/news. You’ve … Read more

Link Back to Parent Category – Woocommerce

get_ancestors() seems like the function you need. If given an ID and object type, it will return an array of ancestor IDs with the first being the most distant parent/grandparent/great-grandparent/etc and the last being the immediate parent. You can use that information to construct your link. function parent_id_wpse_142550($object_id,$type) { $anc = get_ancestors($object_id,$type); $parent = array_shift($anc); … Read more