Amit Verma
Forum Replies Created
-
Josie is correct.
global $post; $cats=array(); foreach(get_the_category() as $category) { echo '<a href="'.get_category_link($category->term_id ).'">'.$category->cat_name.'</a>'; }
Forum: Fixing WordPress
In reply to: Post FormattingYou will have to make modifications to your theme file in this case. Please take a look at https://amit.me/assign-categories-to-pages-in-wordpress/545#template-changes.
Or you can send me your theme files at amit [at] amit [dot] me.
Had it been fixed? I am facing the same issue in WooCommerce.
Do you have admin rights? I have tried it across different versions and it is working fine.
Did you read the instructions given at https://amit.me/assign-categories-to-pages-in-wordpress/545#template-changes?
You need to insert this code just after the loop finishes.
Use this:
<?php $myposts = get_posts('numberposts=-1&category=4,5&orderby=title&order=ASC&post_type=page'); ?> <ul> <?php foreach($myposts as $post) : setup_postdata($post); ?> <li><a href="<?php the_permalink(); ?>"><?php if ( get_post_meta($post->ID, 'page_thumb', true) ) : ?><img src="<?php echo get_post_meta($post->ID, 'page_thumb', true) ?>" alt="<?php the_title(); ?>" /> <?php endif; ?><?php the_title(); ?></a></li> <?php endforeach; ?> </ul>
Do you mean that the Pages arent displaying on Category pages? If so, please enable the first option on the plugin’s options page.
I will look into your code and check for the solution.
1) This plugin also provide you a widget using which you can show pages from the same category int he sidebar.
2) You will have to make changes to the code for this. Are you using WP Menus?
Can I see your setup? Mail me at amit [at] amit [dot] me
Yes, it will be lost. But it is a good idea to include this option in the plugin. I will add it in my todo list.
This plugin includes a widget to display pages from the current page’s category. But it doesn’t display posts.
If you want to display posts then follow following steps.
1) Open “ListAllPagesFromCategory.php” from the Plugin folder
2) Go to line 46
3) Change post_type to post or any. Currently it is set to pageHope it is what you are looking for.
Forum: Plugins
In reply to: [Map Categories to Pages] map-categories-to-pages paginationYou can see the full code to implement Map Categories to Pages with pagination (next and previous posts links) at https://pastebin.com/NR26n4XM. I have used loop HTML from twentyeleven theme. You might have to tweak HTML and CSS.
In addition, you need to edit page.php rather than category.php. This plugin is supposed to help you to insert Posts on Pages. Have you implemented the template changes in category.php?
Forum: Plugins
In reply to: [Plugin: Map Categories to Pages] diplay all pages and posts doesn′t workHi Frankpinaud,
Add following code to the function.php in the active theme directory. It should solve the problem.
add_action('pre_get_posts','change_post_type'); function change_post_type($var) { if(is_category()) { $var->query_vars['post_type'] = 'any'; } }
Forum: Plugins
In reply to: [Plugin: Map Categories to Pages] diplay all pages and posts doesn′t workAll the pages in wordpress are by default belongs to the default category.
Regarding displaying all the posts and pages on category page, I will check and get back to you soon.