arthurmustafa
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Images attached to multiple posts and pagesWell, that was easy, if you put it that way :))
Thank you very much!
Best wishes,
ArthurForum: Fixing WordPress
In reply to: Images attached to multiple posts and pagesAnyone?
Forum: Plugins
In reply to: [Advanced Most Recent Posts] No thumbs in IEI found the problem; initially i integrated the plugin in my theme and that caused the mallfunction. I moved the plugin into the “plugins” directory and activated it and voila – it was all good, in all versions of IE and in Firefox of course. All i have to do is some CSS tweaks.
Forum: Plugins
In reply to: [Advanced Most Recent Posts] No thumbs in IEBartheemskerk, are you using this plugin?
And if you do, are you having problems with thumbnails showing in IE?
I try to find if the problem is caused by my theme.Forum: Plugins
In reply to: [Advanced Most Recent Posts] No thumbs in IEI`m not sure, but in my quest for this plugin i think i accidentaly saw other plugins that offered that, to only show the thumbnails …
Forum: Your WordPress
In reply to: Problem with Read More link in Advanced Most Recent Posts pluginWell, again … i did it!!!!!
I was just about to give up, and then i thought to just duplicate the title and put it below the excerpt, except that i copied only the link code:'<p><a href="' . get_permalink($post->ID) . '" style="display:block; color:#d2e5f3; font-size:10px; padding-top:2px;">Read more »</a></p>'
It was good timing, because i`m close to the deadline with this website.
Hope someone will find this post and think it is helpful.
Forum: Your WordPress
In reply to: Problem with Read More link in Advanced Most Recent Posts pluginWell, isn`t there anybody in this wordpress world that knows hot to resolve tis mistery?
Forum: Your WordPress
In reply to: Problem with Read More link in Advanced Most Recent Posts pluginyes, i have tried that and the link generated look like this:
https://localhost/constantart/<?php the_permalink() ?>
i have tried all sort of things. in fact, i am editing the plugin here, the plugin in embeded in theme and in the home page template i`m caling this plugin with a few lines of code.
this is how the plugin looks like:
<?php /* Plugin Name: Advanced Most Recent Posts Plugin URI: https://www.yakupgovler.com/?p=1033 Description: Display most recent posts from selected categories or current category or all posts with thumbnail images (optional). Version: 1.1 Author: Yakup G?VLER Author URI: https://www.yakupgovler.com */ class yg_recent_posts extends WP_Widget { function yg_recent_posts() { //Load Language load_plugin_textdomain( 'adv-recent-posts', false, dirname(plugin_basename(__FILE__)) . '/lang' ); $widget_ops = array('description' => __('Shows most recent posts. You can customize it easily.', 'adv-recent-posts') ); //Create widget $this->WP_Widget('advancedrecentposts', __('Advanced Recent Posts', 'adv-recent-posts'), $widget_ops); } function widget($args, $instance) { extract($args, EXTR_SKIP); echo $before_widget; $title = empty($instance['title']) ? __('Recent Posts', 'adv-recent-posts') : apply_filters('widget_title', $instance['title']); $parameters = array( 'title' => $title, 'limit' => (int) $instance['show-num'], 'excerpt' => (int) $instance['excerpt-length'], 'actcat' => (bool) $instance['actcat'], 'cats' => esc_attr($instance['cats']), 'cusfield' => esc_attr($instance['cus-field']), 'w' => (int) $instance['width'], 'h' => (int) $instance['height'], 'firstimage' => (bool) $instance['firstimage'], 'atimage' =>(bool) $instance['atimage'], 'defimage' => esc_url($instance['defimage']) ); if ( !empty( $title ) ) { echo $before_title . $title . $after_title; }; //print recent posts yg_recentposts($parameters); echo $after_widget; } //end of widget //Update widget options function update($new_instance, $old_instance) { $instance = $old_instance; //get old variables $instance['title'] = esc_attr($new_instance['title']); $instance['show-num'] = (int) abs($new_instance['show-num']); if ($instance['show-num'] > 20) $instance['show-num'] = 20; $instance['excerpt-length'] = (int) abs($new_instance['excerpt-length']); $instance['cats'] = esc_attr($new_instance['cats']); $instance['actcat'] = $new_instance['actcat'] ? 1 : 0; $instance['cus-field'] = esc_attr($new_instance['cus-field']); $instance['width'] = esc_attr($new_instance['width']); $instance['height'] = esc_attr($new_instance['height']); $instance['firstimage'] = $new_instance['first-image'] ? 1 : 0; $instance['atimage'] = $new_instance['atimage'] ? 1 : 0; $instance['defimage'] = esc_url($new_instance['def-image']); return $instance; } //end of update //Widget options form function form($instance) { $instance = wp_parse_args( (array) $instance, array( 'title' => __('Recent Posts','adv-recent-posts'), 'show-num' => 10, 'excerpt-length' => 0, 'actcat' => 0, 'cats' => '', 'cus-field' => '', 'width' => '', 'height' => '', 'firstimage' => 0, 'atimage' => 0,'defimage'=>'' ) ); $title = esc_attr($instance['title']); $show_num = (int) $instance['show-num']; $excerpt_length = (int) $instance['excerpt-length']; $cats = esc_attr($instance['cats']); $actcat = (bool) $instance['actcat']; $cus_field = esc_attr($instance['cus-field']); $width = esc_attr($instance['width']); $height = esc_attr($instance['height']); $firstimage = (bool) $instance['firstimage']; $atimage = (bool) $instance['atimage']; $defimage = esc_url($instance['defimage']); ?> <p> <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:');?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /> </label> </p> <p> <label for="<?php echo $this->get_field_id('show-num'); ?>"><?php _e('Number of posts to show:');?> <input id="<?php echo $this->get_field_id('show-num'); ?>" name="<?php echo $this->get_field_name('show-num'); ?>" type="text" value="<?php echo $show_num; ?>" size ="3" /><br /> <small><?php _e('(at most 20)','adv-recent-posts'); ?></small> </label> </p> <p> <label for="<?php echo $this->get_field_id('excerpt-length'); ?>"><?php _e('Excerpt length (letters):', 'adv-recent-posts');?> <input id="<?php echo $this->get_field_id('excerpt-length'); ?>" name="<?php echo $this->get_field_name('excerpt-length'); ?>" type="text" value="<?php echo $excerpt_length; ?>" size ="3" /><br /> <small>(<?php _e('0 - Don\'t show excerpt', 'adv-recent-posts');?>)</small> </label> </p> <p> <label for="<?php echo $this->get_field_id('cus-field'); ?>"><?php _e('Thumbnail Custom Field Name:', 'adv-recent-posts');?> <input id="<?php echo $this->get_field_id('cus-field'); ?>" name="<?php echo $this->get_field_name('cus-field'); ?>" type="text" value="<?php echo $cus_field; ?>" size ="20" /> </label><br /> <label for="<?php echo $this->get_field_id('width'); ?>"><?php _e('Width:', 'adv-recent-posts');?> <input id="<?php echo $this->get_field_id('width'); ?>" name="<?php echo $this->get_field_name('width'); ?>" type="text" value="<?php echo $width; ?>" size ="3" /></label>px<br /> <label for="<?php echo $this->get_field_id('height'); ?>"><?php _e('Height:', 'adv-recent-posts');?> <input id="<?php echo $this->get_field_id('height'); ?>" name="<?php echo $this->get_field_name('height'); ?>" type="text" value="<?php echo $height; ?>" size ="3" /></label>px </p> <p> <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('first-image'); ?>" name="<?php echo $this->get_field_name('first-image'); ?>"<?php checked( $firstimage ); ?> /> <label for="<?php echo $this->get_field_id('first-image'); ?>"><?php _e('Get first image of post', 'adv-recent-posts');?></label> </p> <p> <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('atimage'); ?>" name="<?php echo $this->get_field_name('atimage'); ?>"<?php checked( $atimage ); ?> /> <label for="<?php echo $this->get_field_id('atimage'); ?>"><?php _e('Get first attached image of post', 'adv-recent-posts');?></label> </p> <p> <label for="<?php echo $this->get_field_id('def-image'); ?>"><?php _e('Default image:', 'adv-recent-posts');?> <input class="widefat" id="<?php echo $this->get_field_id('def-image'); ?>" name="<?php echo $this->get_field_name('def-image'); ?>" type="text" value="<?php echo $defimage; ?>" /><br /> <small>(<?php _e('if there is no thumbnail, use this', 'adv-recent-posts');?></small> </label> </p> <p> <label for="<?php echo $this->get_field_id('cats'); ?>"><?php _e('Categories:', 'adv-recent-posts');?> <input class="widefat" id="<?php echo $this->get_field_id('cats'); ?>" name="<?php echo $this->get_field_name('cats'); ?>" type="text" value="<?php echo $cats; ?>" /><br /> <small>(<?php _e('Category IDs, separated by commas.', 'adv-recent-posts');?>)</small> </label> </p> <p> <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('actcat'); ?>" name="<?php echo $this->get_field_name('actcat'); ?>"<?php checked( $actcat ); ?> /> <label for="<?php echo $this->get_field_id('actcat'); ?>"> <?php _e('Get posts from current category', 'adv-recent-posts');?></label> </p> <?php } //end of form } add_action( 'widgets_init', create_function('', 'return register_widget("yg_recent_posts");') ); //Register Widget // Show recent posts function function yg_recentposts($args = '') { global $wpdb; $defaults = array('limit' => 10, 'excerpt' => 0, 'actcat' => 0, 'cats'=>'', 'cusfield' =>'', 'w' => 48, 'h' => 48, 'firstimage' => 0, 'atimage' => 0, 'defimage' => ''); $args = wp_parse_args( $args, $defaults ); extract($args); $limit = (int) abs($limit); $firstimage = (bool) $firstimage; $atimage = (bool) $atimage; $defimage = esc_url($defimage); $w = (int) $w; $h = (int) $h; $excerptlength = (int) abs($excerpt); $excerpt = ''; $cats = str_replace(" ", "", esc_attr($cats)); if (($limit < 1 ) || ($limit > 20)) $limit = 10; /*$postlist = wp_cache_get('yg_recent_posts'); //Not yet if ( false === $postlist ) { */ if (($actcat) && (is_category())) { $cats = get_query_var('cat'); } if (($actcat) && (is_single())) { $cats = ''; foreach (get_the_category() as $catt) { $cats .= $catt->cat_ID.' '; } $cats = str_replace(" ", ",", trim($cats)); } if (!intval($cats)) $cats=''; $query = "cat=$cats&showposts=$limit"; $posts = get_posts($query); //get posts $postlist = ''; $height = $h ? ' height = "' . $h .'"' : ''; $width = $w ? ' width = "' . $w . '"' : ''; foreach ($posts as $post) { $post_title = htmlspecialchars(stripslashes($post->post_title)); if ($excerptlength) { $excerpt = $post->post_excerpt; if ( '' == $excerpt ) { $text = $post->post_content; $text = strip_shortcodes( $text ); $text = str_replace(']]>', ']]>', $text); $text = strip_tags($text); $excerpt_length = 100; $words = explode(' ', $text, $excerpt_length + 1); if (count($words) > $excerpt_length) { array_pop($words); $text = implode(' ', $words); } $excerpt = $text; } if(strlen($excerpt) > $excerptlength) { $excerpt = mb_substr($excerpt, 0, $excerptlength) . ' [...]'; } $excerpt = ' ' . $excerpt; } $image = ''; $img = ''; if ($cusfield) { $cusfield = esc_attr($cusfield); $img = get_post_meta($post->ID, $cusfield, true); } if (!$img && $firstimage) { $match_count = preg_match_all("/<img[^']*?src=\"([^']*?)\"[^']*?>/", $post->post_content, $match_array, PREG_PATTERN_ORDER); $img = $match_array[1][0]; } if (!$img && $atimage) { $p = array( 'post_type' => 'attachment', 'post_mime_type' => 'image', 'numberposts' => 1, 'order' => 'ASC', 'orderby' => 'menu_order ID', 'post_status' => null, 'post_parent' => $post->ID ); $attachments = get_posts($p); if ($attachments) { $imgsrc = wp_get_attachment_image_src($attachments[0]->ID, 'thumbnail'); $img = $imgsrc[0]; } } if (!$img && $defimage) $img = $defimage; if ($img) $image = '<img src="' . $img . '" title="' . $post_title . '" class="recent-posts-thumb" ' . $width . $height . ' />'; $postlist .= '<li><a href="' . get_permalink($post->ID) . '" title="'. $post_title . '" class="recent-posts-title" ' . '" >' . $image . $post_title . '</a>' . $excerpt . '<p><a href="<?php the_permalink() ?>">Read more »</a></p>' . "</li>"; } /* wp_cache_set('yg_recent_posts', $postlist); }*/ echo '<ul class="advanced-recent-posts">'; echo $postlist; echo '</ul>'; } ?>
and this is the code in page:
<div id="Noutati" class="hiddencontent"> <?php if (function_exists('yg_recentposts')){ ?> <ul> <?php $parameters = array( 'limit' => 3, //Number of posts to show 'excerpt' => 150, //excerpt length (letters) 'actcat' => false, //get posts current category 'cats' => '4', //Categories to get posts 'cusfield' => 'thumbnail', //custom field name of thumbnail image 'w' => 61, //width 'h' => 61, //height 'firstimage' => false, //get first image of post content 'atimage' => true, //get first attached image of post 'defimage' => 'https://localhost/constantart/wp-content/uploads/2009/10/noutati-default.jpg' //default thumbnail image ); //print most recent posts yg_recentposts($parameters); ?> </ul> </li> <?php } ?> </div>
Forum: Your WordPress
In reply to: Problem with Read More link in Advanced Most Recent Posts pluginI sort of succeded (80%) in resolving this problem, by inserting a little piece of code:
'<p><a href="permalink">Read more »</a></p>'
and the text “Read more” appears below excerpt.
… but i still can`t call the permalink for each post excerpt.
Does anyone know the sollution to this, because it`s taking me too many hours.
Thanks!Forum: Your WordPress
In reply to: Problem with Read More link in Advanced Most Recent Posts pluginI
m sorry for duplicates, i posted in different sections because i didn
t know where exactly from i will receive reply.my site is not online, i`m developing this on a local server. but the plugin is fully functional, title is permalink, text is excerpt and image is thumbnail from custom field. but i really want to also have a “read more” link below the excerpt.
Forum: Requests and Feedback
In reply to: WP2.1 really sucksok, i admit, when i wrote this post i was very mad because i just upgraded my WONDERFUL WP 2.0.5 to 2.1 and suddenly everything went wrong: most of my plugins were not working anymore, so my sidebar and navigation were messed up; the SHOW MORE link was reduced to INLINE – exactly what i was trying to evoid; i could not write a post and include an image within for some sort of reason; same for writing new pages; not to say about modifying existing pages, that was not possible; visual and code modes are NOT WORKING as they are supposed to.
i followed the specified steps for step by step upgrade of wp2.1 but all these problems appeared so you must understand that i was made because i had to stay 2-3 more hours to try and fix my site. im a photographer and my work is on my site, i have a lot of visitors every day, i cannot let my site just go crazy like that. that evening i stayed in front of the computer until i re-installed WP2.0.5.
t know why my pages were transformed into posts, i had to re-write my pages, my links. thank god my posts were ok !
but after that installation i don
now im using WP2.0.5 again and everything goes very well, i have no errors.
m joking of course. i saw many things that i liked in WP2.1 but not as many as flaws.
please tell me if i did something wrong or this new version is so full of bugs that it must be exterminated :) i
i hope i didn`t upset anybody but if this improuved software is something else that expected i think my reaction is justified.
best wishes