Krokodyl
Forum Replies Created
-
It’s been a while since your post but I found a solution.
In the file wp_favorite_posts.php find the function
function wpfp_shortcode_func() { wpfp_list_favorite_posts(); } add_shortcode('wp-favorite-posts', 'wpfp_shortcode_func');
starting on line 297 and change it to
function wpfp_shortcode_func() { ob_start(); wpfp_list_favorite_posts(); return ob_get_clean(); } add_shortcode('wp-favorite-posts', 'wpfp_shortcode_func');
I think it would be useful to incorporate this or similar (better?) solution in the core.
[Please post code or markup snippets between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]
Anyone has any idea? I’d also love to know how to do that…
Forum: Fixing WordPress
In reply to: Display both post and page excerpts in the loopI solved the problem myself. Only a small addition was needed.
In the code: $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args= array('category_name' => "Category name", 'paged' => $paged ); query_posts($args);
I had to add page as a post typu (by default the parameter post_type has the value only post):
$args= array('category_name' => "$cat_name", 'paged' => $paged, 'post_type' => array('post', 'page') );
Thanks again for your help. If it wasn’t for you I would be still at the beginning ??
Forum: Fixing WordPress
In reply to: Display both post and page excerpts in the loopThis works. Thanks ?? Sorry for my little knowldge of WordPress internals ??
Only one more question. The is_category() tag can be used inside the Loop. But I also want to display the excerpts from the category on one template page whis is not a category.
I copied the site to another address so that I can play with it without problems. Now the category page https://bt7.pl/category/tlum-inf/ works very well.
But I also want to display items assigned to the same category on the page (custom template) https://bt7.pl/lingwistyka/tlumaczenia-informatyczne/.
I tried to use is_page and is_page_template but these didn’t work for me (I suppose because they cannot be used inside the Loop).
Forum: Fixing WordPress
In reply to: Display both post and page excerpts in the loopOn another template file.
Forum: Fixing WordPress
In reply to: Display both post and page excerpts in the loopThe code is very simple, so I think I can post it here (of course this is only the core, I omitted the structural markup etc.):
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args= array('category_name' => "Category name", 'paged' => $paged ); query_posts($args);
However I think the problem might be connected with the plugin itself or my theme. Pages are added to categories, and the counter of items in a category gets incremented, but when I open the category page, there are only posts there.
You can see it here: https://www.bt4.pl/
If you scroll to the bottom, you’ll see category (under Kategorie) T?umaczenia informatyczne with number 3 next to it. But when you open this category, there are only two items.Forum: Fixing WordPress
In reply to: Display both post and page excerpts in the loopActually I’ve got another problem, but this is something different although connected with the previous one (is this understandable ??
I made several static pages with custom templates. On these pages I display excerpts of posts assigned to appropriate categories.
But I’d also like to display on these pages excerpts of pages assigned to these same categories.E.g. I have category Programs. I also have a page called My Programs. When I create a new page or post and assign it to the category Programs, its excerpt should show up on the page My Programs (as well as on home page, which is already settled :)).
I use the plugin Map Categories to Pages.
Forum: Fixing WordPress
In reply to: Display both post and page excerpts in the loopIt works! Thanks a lot. I lost the whole day on this, but I don’t think I would ever solve it on my own.
P.S.
Yes I used the line add_post_type_support( ‘page’, ‘excerpt’ ); to enable excerpts