Filespit
Forum Replies Created
-
Forum: Plugins
In reply to: [GD Mail Queue] Plugin not sending mails in queueThanks for answering.
Yes I do. In the dashboard, the queue status says “Waiting”, as I suppose it should? I see all my emails in the log, they all have the green “To Queue” tag in the status column. I suppose that means they’re awaiting to be sent? The queue cron job has been called over 3000 times, but its not sending any emails. I might have the wrong interval or timeout settings, do you have any recommendations for those?
Forum: Fixing WordPress
In reply to: Find which is right file to customize.As Jakob says above, it depends on the theme. You should be able to identify the page template though, since the
<body>
tag has some classes that describes what template the current page is using, and from there you should be able to find the correct file.If all you want to do is edit some CSS you can do so with the Custom CSS option in the theme customizer, or with a plugin as you say. You should never edit the theme files however, since if you update the theme from the admin panel all your changes will be overwritten. There’s also the possibility of creating a child theme that has it’s own CSS file, which won’t affect the parent theme.
Forum: Plugins
In reply to: [WooCommerce] 502 Bad Gateway once cart total reaches a certain amountSo I’ve managed to localize the issue to a cookie. When adding a product to the cart they are saved in a cookie, and when too many products have been added, the error occurs whenever I try to visit another product page. Everything else works, but I can’t visit any product pages. So what I originally thought was the problem, see above, wasn’t the problem.
Forum: Plugins
In reply to: [WordPress Popular Posts] Display author avatar in listI finally figured it out. This plugin doesn’t use the usual loop so I had to go around it using wpp_custom_html filter.
<?php function my_custom_popular_posts_html_list( $mostpopular , $instance ) { global $post; foreach ( $mostpopular as $popular ) { $p = get_post( $popular->id ); $author = $p->post_author; echo get_avatar ( get_the_author_meta( 'ID' , $author ) ); } } add_filter( 'wpp_custom_html' , 'my_custom_popular_posts_html_list' , 10 , 2 ); ?>
Forum: Plugins
In reply to: [Author Image] How to check if Author image is blankI just figured it out, here is my solution;
$author_image = get_user_meta( $user->ID , 'author_image', true ); if ( $author_image ) { the_author_image(); } else { // echo another picture }
Forum: Plugins
In reply to: [Author Image] How to check if Author image is blankI have the same issue. I try this code but it won’t work.
if ( the_author_image ( $user->ID ) ) { the_author_image( $user->ID ); } else { // echo another picture instead }
Basically, if a user has uploaded an author image, it should be displayed. If not, it displays another picture.
Forum: Plugins
In reply to: [WooCommerce] Display category image on single product pageI did some tweaking and finally solved it. Here’s my code;
$terms = get_the_terms( $post->ID, 'product_cat' ); foreach ( $terms as $term ){ $category_name = $term->name; $category_thumbnail = get_woocommerce_term_meta($term->term_id, 'thumbnail_id', true); $image = wp_get_attachment_url($category_thumbnail); echo '<img class="absolute category-image" src="'.$image.'">'; }
Forum: Hacks
In reply to: Use checkboxes in wp_dropdown_categoriesAfter some more work in modifying an example I found, I finally managed to solve this!
Forum: Plugins
In reply to: [Simple Fields] If several instances have same values, list only onceThank you P?r, that helped a bit but it’s still not right.
This way each country only displays one city in separate <div class=”buy-country”> tags, and makes the html code look like this.
<div id="buy-list"> <ul> <li class="buy-country"> <span>Sweden</span> <ul> <li class="buy-city"> <span>Gothenburg</span> </li> </ul> </li> <li class="buy-country"> <span>Sweden</span> <ul> <li class="buy-city"> <span>Stockholm</span> </li> </ul> </li> <li class="buy-country"> <span>Denmark</span> <ul> ... </ul> </li> </ul> </div>
The code only displays the first “buy-country” instance, the rest that have the same country are hidden. I want the html code to look like this;
<div id="buy-list"> <ul> <li class="buy-country"> <span>Sweden</span> <ul> <li class="buy-city"> <span>Gothenburg</span> </li> <li class="buy-city"> <span>Stockholm</span> </li> </ul> </li> <li class="buy-country"> <span>Denmark</span> <ul> ... </ul> </li> </ul> </div>
Forum: Plugins
In reply to: [Simple Fields] Display Gallery in Simple FieldsHi P?r,
I tried this, but it only returns Array
<?php $content_from_simple_fields = simple_fields_get_post_group_values($post->ID, "galleri-grupp", true, 2); $content_from_simple_fields = apply_filters( 'Galleri', $content_from_simple_fields ); echo $content_from_simple_fields; ?>
Perhaps I wrote it all wrong?
Forum: Fixing WordPress
In reply to: Display list of child pages plus all parent pagesNo luck there I’m afraid. The only thing I manage to do is display the child pages of a parent page. The sibling parent pages all disappear, which I don’t want them to. This does seem to do the work, but it displays nothing for me, and completely removes the_content() as well.
<?php // use wp_list_pages to display parent and all child pages all generations (a tree with parent) $parent = 93; $args=array( 'child_of' => $parent ); $pages = get_pages($args); if ($pages) { $pageids = array(); foreach ($pages as $page) { $pageids[]= $page->ID; } $args=array( 'title_li' => 'Tree of Parent Page ' . $parent, 'include' => $parent . ',' . implode(",", $pageids) ); wp_list_pages($args); } ?>
It was working after all, I just had to find all the correct ID’s for the categories. Thanks for helping!
Ok, I tried it out but it still lists all my categories. I’m no PHP-guru so I’m not sure how to write it correctly. Here’s the code I tried;
<?php $args = array('exclude'=>'2'); foreach (get_categories($args) as $cat) : ?>
Am I close perhaps?
I have a follow-up question! I’m posting in the same thread as it’s regarding the same code I have above. The question is simple, how do I exclude categories from my category list using my above code? That must be possible!
This should help me, but it doesn’t with my current code. Since I started this thread I’ve rewritten my code a bit. This is how it looks at the moment.
<?php foreach (get_categories() as $cat) : ?> <li class="item"> <a href="<?php echo get_category_link($cat->term_id); ?>"> <img src="<?php echo z_taxonomy_image_url($cat->term_id); ?>" /> </a> <a class="link" href="<?php echo get_category_link($cat->term_id); ?>"> <?php echo $cat->cat_name; ?> </a> </li> <?php endforeach; ?>
As you can see I have a hyperlink with the class “link”. On the current category I’d like the class to be “link current-menu-item”, while all other links simply have the class “link”. How do I add your bit of code to solve this? Should it be inside the “a” tag or outside?
EDIT: I actually solved it by doing this;
<a class="link <?php echo (get_query_var('cat') == $cat->term_id) ? ' active' : ''; ?>" href="<?php echo get_category_link($cat->term_id); ?>"> <?php echo $cat->cat_name; ?> </a>
Thanks for the help!