Justyna Ratajczak
Forum Replies Created
-
Forum: Plugins
In reply to: [PDF Thumbnails] Black areas on thumbnailsJust tested it – adding
$imagick->setImageAlphaChannel(self::ALPHACHANNEL_DEACTIVATE);
to the function caused “HTTP error” when uploading the PDF into WordPress, and didn’t generate a thumbnail at all. Used it like this:add_action('pdf_thumbnails_generate_image_blob', function ($blob, $filename) { $imagick = new Imagick(); $imagick->readImage($filename); $imagick->setImageAlphaChannel(self::ALPHACHANNEL_DEACTIVATE); $imagick->setIteratorIndex(0); $imagick->setImageFormat('jpg'); return $imagick->getImageBlob(); }, 10, 2);
Also tried setting
$imagick->setImageAlphaChannel(11);
as per the answer you linked – no HTTP error but still black areas on the generated thumbnails.- This reply was modified 7 years, 7 months ago by Justyna Ratajczak. Reason: extra testing
Forum: Fixing WordPress
In reply to: Show Future Posts in Date OrderHi Adam,
Have you been able to fix this issue? I’m having the same problem with listing future posts in the correct order – using
orderby
andorder
doesn’t work for me either. Using WP 3.4.1Forum: Plugins
In reply to: [WP-PageNavi] [Plugin: WP-PageNavi] wp-pagenavi throws error 404Hi Scribu, thanks for your reply!
I use my code (above) in a custom page template (which is why I’m using
get_query_var('page')
). Think a portfolio page that I’m trying to display my Work CPT posts on.EDIT: I changed my code a bit with an exact copy/paste from your article I mentioned above:
[Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]
but that doesn’t work either. I’m not sure I should be using
get_query_var('page')
orget_query_var('paged')
Forum: Plugins
In reply to: [WP-PageNavi] [Plugin: WP-PageNavi] wp-pagenavi throws error 404Same problem here, my code:
<?php $paged = (get_query_var('page')) ? get_query_var('page') : 1; ?> <?php $work_items = new WP_Query(array( 'post_type' => 'work', 'posts_per_page' => '12', 'paged' => $paged ) ); ?> <?php while ($work_items->have_posts() ) : $work_items->the_post(); ?> <div class="col2 work-item"> <a href="<?php the_permalink(); ?>"> <img src="<?php the_field('work_overview_thumbnail'); ?>" alt="" /> <p class="descr"><?php the_field('work_overview_description'); ?> <span><?php the_field('work_client_name'); ?></span></p> </a> </div> <?php endwhile; ?> <?php wp_pagenavi(array( 'query' => $work_items )); ?>
Using
get_query_var('page')
cause it’s a custom page template as explained in this article. Usingget_query_var('paged')
doesn’t work either.My permalink structure is just /%postname%/
Has anyone managed to fix this problem?
Hi Johan,
I’m having a problem related to what fireproofsocks posted.
After dragging the widget into active area the whole form in the widget disappears, except Delete/Close/Save buttons. They come back after the widget has been saved.
Forum: Fixing WordPress
In reply to: Google-loaded jQuery doesn't work in wp-adminI can’t make it to work with custom scripts in my theme. I register my scripts in functions.php, like this:
wp_register_script('selectivizr', get_bloginfo('template_directory').'/_assets/js/selectivizr.js', 'jquery'); wp_enqueue_script('selectivizr');
to have them included in
wp_head
. Then I usewp_enqueue_script("jquery");
in my header.php BEFORE thewp_head
but the jQuery is STILL loaded after my scripts anyway.Registering Google-hosted version of jQuery forced it to load before my registered scripts to make them work properly. However it made the draggable menu items in Appearance/Menus to stop working. Removing the
if(!is_admin())
condition fixes the menu problem, but the dashboard items don’t slide down then (there is no jQuery on the page at all).Forum: Fixing WordPress
In reply to: Category RSS linkFrom what I understand, this function displays the category in the feed, not on the page. It doesn’t return any value.
Forum: Fixing WordPress
In reply to: [WP 3.0 RC] Recent comments code snippet?Anyone?
Forum: Fixing WordPress
In reply to: How to make a template for child categories?Looks great, thanks.
However, I have an issue. What I want to achieve is template with a layout (different from the rest of the archives) for these child categories.
Using the plugin and, in my example, category-5.php to achieve the same layout for all child categories, I get the same effect on each of them: the loop seems to return all posts in category 5.
What I need to have is category 6 page to display only category 6 posts etc.
The current
query_posts
in the template files looks as follows:query_posts( 'paged=$page&post_per_page=-1&cat=' . get_query_var('cat') );
I assume WordPress takes the 5 ID from the filename, how should I change the
query_posts
call to achieve the effect I need?Forum: Plugins
In reply to: [Plugin: WP-PageNavi] PageNavi getting confused with URLs?Loops are in different files:
homepage.php: https://tinypaste.com/7217d – the actual homepage template
index.php: https://tinypaste.com/3f32e
page.php: https://tinypaste.com/8d206 – posting in case it can be relevant to the problem.EDIT: I think it’s worth mentioning that the archives for both categories and tags paginate correctly as well:
https://dev.gentlecode.net/cssshow/wordpress/tag/colors/page/2
https://dev.gentlecode.net/cssshow/wordpress/category/designer/page/2Forum: Plugins
In reply to: [Plugin: WP-PageNavi] PageNavi getting confused with URLs?You can achieve the same thing using
query_posts()
andwp_reset_query()
.That’s the problem. It doesn’t work with
query_posts()
. It gets really confused. This method was the only one that worked for me.Well, in that case, make sure the correct loop is executed on /wordpress/page/2. You can add a line like this:
echo "in the home loop";
.I think it’s pretty obvious that it doesn’t execute the correct loop on /wordpress/page/2. Otherwise, it wouldn’t display posts from a category that is excluded in that query.
The whole point of this thread is me trying to figure out why it doesn’t execute the correct loop. I reset the query after both loops, everything works great (PageNavi correctly renders 5 links for 5 pages of posts) just not the actual links in the homepage pagination.
Forum: Plugins
In reply to: [Plugin: WP-PageNavi] PageNavi getting confused with URLs?The
$wp-query
stuff comes from the fact that PageNavi doesn’t really work with custom queries, as explained here: https://www.wplover.com/756/how-to-get-custom-wp_query-loop-working-with-pagination-and-wp-pagenaviUsing this tutorial was the only way I managed to even get PageNavi to display correctly.
Thing is, as explained, homepage and blog page use two different loops. So I would expect Page 2 of “blog” loop (/wordpress/blog/page/2) to display blog posts – which happens, all good.
However, homepage has a different loop, so I would expect Page 2 of “homepage” loop (/wordpress/page/2 to display only homepage posts.
Here’s the link to live example: https://dev.gentlecode.net/cssshow/wordpress/
Homepage displays all posts EXCEPT blog category. Blog page displays ONLY posts in blog category.
EDIT: It’s worth mentioning that PageNavi correctly renders the pagination on the homepage (it’s set to show only one posts per page for testing purposes) – there are 5 posts and it correctly displays 5 pages. It just seems to get confused with the URLs.
Forum: Fixing WordPress
In reply to: Excluding latest post from the LoopThank you, got it working now.
Justine
Forum: Fixing WordPress
In reply to: Conditional tag for post “age”?Thank you very much!
Forum: Fixing WordPress
In reply to: Displaying name of current page in query_posts?Thanks for all the help, Stvwlf. Here’s the final code I used – it works great:
<?php $pageslug = $post->post_name; // name of the page (slug) $catslug = get_category_by_slug($pageslug); // get category of the same slug $catid = $catslug->term_id; // get id of this category $query= 'cat=' . $catid. ''; query_posts($query); // run the query ?>