southcast
Forum Replies Created
-
Forum: Your WordPress
In reply to: wordpress websiteI would like to say a few other things instead.
Layout is pretty spacious and neat, colors are subtle and delivers a professional look. Although, If it was me I would relocate the search module and perhaps use a responsive theme in order to tap clients with mobile devices. Overall it is nice and gets the work done I guess.Forum: Your WordPress
In reply to: Photography websitePersonally I think the space seems a little cramped ( a bit overutilized ). Given that it is a site of an artist I was expecting a bit more whitespace. Probably coz I believe If too many elements come together, nothing can really stand out. Beautiful subtle colors, though.
Forum: Fixing WordPress
In reply to: Is it possible to pull and display a single landscape oriented imageGot the solution and it seems it is possible. I came back to this thread so that if someone else is looking to achieve something similar, they might find this helpful. Now the first piece of code has to go to your functions.php.
function wpse_landscape_image() { /* global post object holding info about the current post */ global $post; /* grab all images attached to the current post */ $attached_images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image' ) ); /* set minimum ratio between width / height, change to your liking */ $minimum_aspect_ratio = 1.2; /* * iterate over attachments * get size, compare width & height * stop execution if an image with "landscape" dimensions is found */ foreach( $attached_images as $image ) { $url = wp_get_attachment_url( $image->ID ); $size = getimagesize( $url ); if ( $size[0] >= ( $size[1] * $minimum_aspect_ratio ) ) { return $url; } } return false; }
Then there is this template tag you can use anywhere you want your image to be displayed.
<?php $landscape_image_url = wpse_landscape_image(); if ( $landscape_image_url ) { echo '<img alt="landscape image" src="' . $landscape_image_url . '" />'; } ?>
Also if you want to display vertical/portrait oriented image instead of landscape/horizontally oriented image then just change the indices in the code.
Forum: Fixing WordPress
In reply to: Simple increment in post views.Yep, that was the culprit. I recieved the same solution here just a few seconds ago. But I appreciate the effort you took to help. I am marking this resolved. Again, many thanks @catacaustic.
Forum: Fixing WordPress
In reply to: Simple increment in post views.Whoops ! This one throws a Fatal error: Cannot redeclare wpfp_get_current_count(). I will paste here what I have in my custom-functions.php. Kindly take a look and suggest me an appropriate modification in the code.
function wpfp_get_current_count() { global $wpdb; $current_post = get_the_ID(); $query = "SELECT post_id, meta_value, post_status FROM $wpdb->postmeta"; $query .= " LEFT JOIN $wpdb->posts ON post_id=$wpdb->posts.ID"; $query .= " WHERE post_status='publish' AND meta_key='wpfp_favorites' AND post_id = '".$current_post."'"; $results = $wpdb->get_results($query); if ($results) { foreach ($results as $o): echo $o->meta_value; endforeach; }else {echo( '0' );} }
I really appreciate your help.
Forum: Fixing WordPress
In reply to: Simple increment in post views.@catacaustic. Thanks for trying but the code did not work. In fact I had tried this earlier.
wpfp_get_current_count()
still works and displays the actual post views but the addition does not happen. Any suggestion ?Forum: Plugins
In reply to: [WP Favorite Posts] Number of favourites in post@lildragn, I am not an expert, so cant help you there sorry. But if you create a new thread with your issue, I am sure you will get the attention of some expert. Goodluck.
Forum: Fixing WordPress
In reply to: Display number of posts within category@bondigor69, I had to thank you. It helped a lot.
Forum: Plugins
In reply to: [WP Favorite Posts] Number of favourites in postThis code did the job. Long live the wp community. Thanks to all the great guys who contribute.
Forum: Plugins
In reply to: [WP Favorite Posts] Number of favourites in postWhen I say I need favorite counts on a single post, I believe I am asking for the same thing.
Any idea how this could be achieved, anyone ?Forum: Hacks
In reply to: help with the code to display thumbnails of recently uploaded imagesYour suggested solutions are flawless. The modified code worked perfectly. Thanks a million for your time @bcworkz.
Forum: Hacks
In reply to: help with the code to display thumbnails of recently uploaded images@bcworkz, thanks for reverting back. I am just starting to learn a bit php and pretty much a noob adjusting a few codes here and there. Pardon my ignorance but I am incapable to decipher your explanation, as its a bit too technical for me.
However if you could please write me back a modified version of the code above, that will be really great. The code is already pulling a “small” sized thumbnail, so it works. I just need to know that if my custom thumbnail size is called “mythumb”, then how is the above code affected in order to pull “mythumb” thumbnail instead of “small” thumbnail it is pulling currently.
Hope I have been clear enough. Thanks again.
Forum: Plugins
In reply to: need correction with a snippet regarding an array issueDoesnot work. Taken an alternative route.
Forum: Fixing WordPress
In reply to: need a confirmation text to appear on email submissionSolved it. Will leave a response here in case it could help someone. It just needed a little tweak. Now my JS looks like this.
<script type="text/javascript"> jQuery(document).ready(function($) { $('#sendEmail').click(function(){ $.ajax({ type: 'POST', url: 'https://xxxxxxxxxxxxxxx/email.php', data: { content: $('#email-data').html()}, success:function(data) { alert('You data has been successfully e-mailed'); } }); }); }); </script>
Forum: Fixing WordPress
In reply to: need a confirmation text to appear on email submission@andrew I have put a link to the page in question. Thanks.