VIP GladWeb 1433 Posted February 12, 2015 VIP Report Share Posted February 12, 2015 В общем моих знаний на данное решение не хватило, прошу помощи у Вас! Суть следующая: сайт на Wordpress, нужна функция или плагин, для автоматического прописывания тегов alt и title для всех изображений в постах (+миниатюр, если можно). В title и alt нужно прописать название поста, в котором картинка располагается. Раньше с этим справлялся плагин SEO Friendly Images, сейчас он у меня не работает. Quote Link to post Share on other sites
VIP seo-net 2343 Posted February 12, 2015 VIP Report Share Posted February 12, 2015 я для таких целей пользуюсь стандартным решением все устраивает и картиночный трафик идет Quote Link to post Share on other sites
VIP GladWeb 1433 Posted February 12, 2015 Author VIP Report Share Posted February 12, 2015 я для таких целей пользуюсь стандартным решением все устраивает и картиночный трафик идет В том то и проблема, задумался об этом только сейчас, а править свыше 1000 картинок вручную желания нету Quote Link to post Share on other sites
VIP seo-net 2343 Posted February 12, 2015 VIP Report Share Posted February 12, 2015 В свое время была такая проблема, нанимал людей)))))) Quote Link to post Share on other sites
Starks 26 Posted February 12, 2015 Report Share Posted February 12, 2015 Кстати, могу вручную перековырять, если не найдете решение и самому будет лень. Quote Link to post Share on other sites
Модератор files 2797 Posted February 12, 2015 Модератор Report Share Posted February 12, 2015 Уже странно, что SEO Friendly Images не работает. Это очень простой плагин и использует самые стандартные функции ВП для подмены алт и титле. Тут проще найти конфликт, чем изобретать велосипед (ну или как вариант - попробовать разные версии SEO Friendly Images) Например, версию 2.7.6 <?php /* Plugin Name: SEO Friendly Images Plugin URI: http://www.prelovac.com/vladimir/wordpress-plugins/seo-friendly-images'>http://www.prelovac.com/vladimir/wordpress-plugins/seo-friendly-images Description: Automatically adds alt and title attributes to all your images. Improves traffic from search results and makes them W3C/xHTML valid as well. Version: 2.7.6 Author: Vladimir Prelovac Author URI: http://www.prelovac.com/vladimir To-Do: - localization (done in premium version) - integration module with google xml sitempas to support images sitemap (done in premium version) Copyright 2008 Vladimir Prelovac vprelovac@gmail.com */ $seo_friendly_images_localversion="2.7.6"; $sfi_plugin_url = trailingslashit( get_bloginfo('wpurl') ).PLUGINDIR.'/'. dirname( plugin_basename(__FILE__) ); function seo_friendly_images_add_pages() { add_options_page('SEO Friendly Images options', 'SEO Friendly Images', 'manage_options', __FILE__, 'seo_friendly_images_options_page'); } function seo_friendly_images_admin_notice() { echo ''; } // Options Page function seo_friendly_images_options_page() { global $seo_friendly_images_localversion; $status=seo_friendly_images_getinfo(); $theVersion = ( isset($status[1]) ? $status[1] : ''); $theMessage = ( isset($status[3]) ? $status[3] : ''); if( (version_compare(strval($theVersion), strval($seo_friendly_images_localversion), '>') == 1) ) { $msg = 'Latest version available '.' <strong>'.$theVersion.'</strong><br/>'.$theMessage; _e('<div id="message" class="updated fade"><p>' . $msg . '</p></div>'); } // If form was submitted if (isset($_POST['submitted']) && check_admin_referer('CSRFcheck','CSRF_check')) { $alt_text=(!isset($_POST['alttext'])? '': htmlentities(stripslashes(strip_tags($_POST['alttext'])))); $title_text=(!isset($_POST['titletext'])? '': htmlentities(stripslashes(strip_tags($_POST['titletext'])))); $override=(!isset($_POST['override'])? 'off': 'on'); $override_title=(!isset($_POST['override_title'])? 'off': 'on'); update_option('seo_friendly_images_alt', $alt_text); update_option('seo_friendly_images_title', $title_text ); update_option('seo_friendly_images_override', $override ); update_option('seo_friendly_images_override_title', $override_title ); $msg_status = 'SEO Friendly Images options saved.'; // Show message _e('<div id="message" class="updated fade"><p>' . $msg_status . '</p></div>'); } if (isset($_GET['notice'])) { if ($_GET['notice']==1) { update_option('seo_friendly_images_notice', 1); } } // Fetch code from DB $alt_text = get_option('seo_friendly_images_alt'); $title_text = get_option('seo_friendly_images_title'); $override =( get_option('seo_friendly_images_override')=='on' ) ? "checked":""; $override_title =( get_option('seo_friendly_images_override_title')=='on' ) ? "checked":""; global $sfi_plugin_url; $imgpath=$sfi_plugin_url.'/i'; $action_url=htmlentities(stripslashes(strip_tags($_SERVER['REQUEST_URI']))); // Configuration Page echo <<<END <div class="wrap"> <h2>SEO Friendly Images $seo_friendly_images_localversion</h2> <div id="poststuff" style="margin-top:10px;"> <div id="sideblock" style="float:right;width:270px;margin-left:10px;"> </div> </div> <div id="mainblock" style="width:710px"> <form name="sfiform" action="$action_url" method="post"> <div class="dbx-content"> <input type="hidden" name="submitted" value="1" /> <h2>General Options</h2> <p>SEO Friendly Images automatically adds alt and title attributes to all your images in all your posts specified by parameters below.</p> <p>You can enter any text in the field including two special tags:</p> <ul> <li>%title - replaces post title</li> <li>%name - replaces image file name (without extension)</li> <li>%category - replaces post category</li> <li>%tags - replaces post tags</li> </ul> <h4>Images options</h4> <div> <label for="alt_text"><b>ALT</b> attribute (example: %name %title)</label><br> <input style="border:1px solid #D1D1D1;width:165px;" id="alt_text" name="alttext" value="$alt_text"/> </div> <br> <div> <label for="title_text"><b>TITLE</b> attribute (example: %name photo)</label><br> <input style="border:1px solid #D1D1D1;width:165px;" id="title_text" name="titletext" value="$title_text"/> </div> <br/> <div> <input id="check1" type="checkbox" name="override" $override /> <label for="check1">Override default Wordpress image alt tag (recommended)</label> </div> <br/> <div> <input id="check2" type="checkbox" name="override_title" $override_title /> <label for="check2">Override default Wordpress image title</label> </div> <br/><br/> <p> Example:<br/> In a post titled Car Pictures there is a picture named Ferrari.jpg<br/><br/> Setting alt attribute to "%name %title" will produce alt="Ferrari Car Pictures"<br/> Setting title attribute to "%name photo" will produce title="Ferrari photo" </p> <div class="submit"><input type="submit" name="Submit" value="Update options" /></div> </div> END; wp_nonce_field('CSRFcheck','CSRF_check', false); echo <<<END </form> <br/><br/><h3> </h3> </div> </div> END; } // Add Options Page add_action('admin_menu', 'seo_friendly_images_add_pages'); function remove_extension($name) { return preg_replace('/(.+)\..*$/', '$1', $name); } function seo_friendly_images_process($matches) { global $post; $title = $post->post_title; $alttext_rep = get_option('seo_friendly_images_alt'); $titletext_rep = get_option('seo_friendly_images_title'); $override= get_option('seo_friendly_images_override'); $override_title= get_option('seo_friendly_images_override_title'); # take care of unsusal endings $matches[0]=preg_replace('|([\'"])[/ ]*$|', '\1 /', $matches[0]); ### Normalize spacing around attributes. $matches[0] = preg_replace('/\s*=\s*/', '=', substr($matches[0],0,strlen($matches[0])-2)); ### Get source. preg_match('/src\s*=\s*([\'"])?((?(1).+?|[^\s>]+))(?(1)\1)/', $matches[0], $source); $saved=$source[2]; ### Swap with file's base name. preg_match('%[^/]+(?=\.[a-z]{3}\z)%', $source[2], $source); ### Separate URL by attributes. $pieces = preg_split('/(\w+=)/', $matches[0], -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); ### Add missing pieces. $postcats=get_the_category(); $cats=""; if ($postcats) { foreach($postcats as $cat) { $cats = $cat->slug. ' '. $cats; } } $posttags = get_the_tags(); $tags=""; if ($posttags) { foreach($posttags as $tag) { $tags = $tag->name . ' ' . $tags; } } if (!in_array('title=', $pieces) || $override_title=="on") { $titletext_rep=str_replace("%title", $post->post_title, $titletext_rep); $titletext_rep=str_replace("%name", $source[0], $titletext_rep); $titletext_rep=str_replace("%category", $cats, $titletext_rep); $titletext_rep=str_replace("%tags", $tags, $titletext_rep); $titletext_rep=str_replace('"', '', $titletext_rep); $titletext_rep=str_replace("'", "", $titletext_rep); $titletext_rep=str_replace("_", " ", $titletext_rep); $titletext_rep=str_replace("-", " ", $titletext_rep); //$titletext_rep=ucwords(strtolower($titletext_rep)); if (!in_array('title=', $pieces)) { array_push($pieces, ' title="' . $titletext_rep . '"'); } else { $key=array_search('title=',$pieces); $pieces[$key+1]='"'.$titletext_rep.'" '; } } if (!in_array('alt=', $pieces) || $override=="on" ) { $alttext_rep=str_replace("%title", $post->post_title, $alttext_rep); $alttext_rep=str_replace("%name", $source[0], $alttext_rep); $alttext_rep=str_replace("%category", $cats, $alttext_rep); $alttext_rep=str_replace("%tags", $tags, $alttext_rep); $alttext_rep=str_replace("\"", "", $alttext_rep); $alttext_rep=str_replace("'", "", $alttext_rep); $alttext_rep=(str_replace("-", " ", $alttext_rep)); $alttext_rep=(str_replace("_", " ", $alttext_rep)); if (!in_array('alt=', $pieces)) { array_push($pieces, ' alt="' . $alttext_rep . '"'); } else { $key=array_search('alt=',$pieces); $pieces[$key+1]='"'.$alttext_rep.'" '; } } return implode('', $pieces).' /'; } function seo_friendly_images($content) { return preg_replace_callback('/<img[^>]+/', 'seo_friendly_images_process', $content); } add_filter('the_content', 'seo_friendly_images', 100); //add_action( 'after_plugin_row', 'seo_friendly_images_check_plugin_version' ); function seo_friendly_images_check_plugin_version($plugin) { global $plugindir, $seo_friendly_images_localversion; if( strpos($plugin,'seo-friendly-images.php')!==false ) { $theVersion = $status[1]; $theMessage = $status[3]; if( (version_compare(strval($theVersion), strval($seo_friendly_images_localversion), '>') == 1) ) { $msg = 'Latest version available '.' <strong>'.$theVersion.'</strong><br/>'.$theMessage; echo '<td colspan="5" class="plugin-update" style="line-height:1.2em;">'.$msg.'</td>'; } else { return; } } } function seo_friendly_images_install() { if(!get_option('seo_friendly_images_alt')) { add_option('seo_friendly_images_alt', '%name %title'); } if(!get_option('seo_friendly_images_title')) { add_option('seo_friendly_images_title', '%title'); } if(get_option('seo_friendly_images_override' == '') || !get_option('seo_friendly_images_override')) { add_option('seo_friendly_images_override', 'on'); } if(get_option('seo_friendly_images_override_title' == '') || !get_option('seo_friendly_images_override_title')) { add_option('seo_friendly_images_override_title', 'off'); } if (!get_option('seo_friendly_images_notice')) add_action('admin_notices', 'seo_friendly_images_admin_notice'); } add_action( 'plugins_loaded', 'seo_friendly_images_install' ); campusboy, Heim and GladWeb 3 Quote Link to post Share on other sites
VIP GladWeb 1433 Posted February 12, 2015 Author VIP Report Share Posted February 12, 2015 Уже странно, что SEO Friendly Images не работает. Это очень простой плагин и использует самые стандартные функции ВП для подмены алт и титле. Тут проще найти конфликт, чем изобретать велосипед (ну или как вариант - попробовать разные версии SEO Friendly Images) Есть конечно подозрения на другие плагины, которые могут мешать, но в моем случае все они важные и отключить их нету возможности. Сейчас попробую версию 2.7.6 и отпишусь Quote Link to post Share on other sites
VIP GladWeb 1433 Posted February 12, 2015 Author VIP Report Share Posted February 12, 2015 попробовать разные версии SEO Friendly Images) Например, версию 2.7.6 Жирный плюс от меня! Вопрос решен, с этой версией все работает! Хотя конечно интересно, почему не пашут новые версии Heim 1 Quote Link to post Share on other sites
Модератор files 2797 Posted February 12, 2015 Модератор Report Share Posted February 12, 2015 Жирный плюс от меня! Вопрос решен, с этой версией все работает! Хотя конечно интересно, почему не пашут новые версии Функции все время модифицируются, за всем сложно уследить. Quote Link to post Share on other sites
VIP GladWeb 1433 Posted February 12, 2015 Author VIP Report Share Posted February 12, 2015 Функции все время модифицируются, за всем сложно уследить. Еще вопрос, может сталкивались с плагином, который переименовывает все медиафайлы на чпу? К примеру, sddkk.png = nazvanie_statie.png ? Quote Link to post Share on other sites
Модератор files 2797 Posted February 12, 2015 Модератор Report Share Posted February 12, 2015 @GladWeb, Media File Renamer Quote Link to post Share on other sites
VIP GladWeb 1433 Posted February 12, 2015 Author VIP Report Share Posted February 12, 2015 @GladWeb, Media File Renamer Пробовал, но как я понял он все не совсем автоматически делает. В моем случае он не переименовывает, пока я вручную не впишу название для каждого изображения. Если у вас он работает по-другому, возможно снова в версии у меня проблема Quote Link to post Share on other sites
Модератор files 2797 Posted February 12, 2015 Модератор Report Share Posted February 12, 2015 Пробовал, но как я понял он все не совсем автоматически делает. В моем случае он не переименовывает, пока я вручную не впишу название для каждого изображения. Если у вас он работает по-другому, возможно снова в версии у меня проблема Найдите File Renamer в Инструментах или Настройках. Там должно быть для всех фото Quote Link to post Share on other sites
VIP GladWeb 1433 Posted February 12, 2015 Author VIP Report Share Posted February 12, 2015 Найдите File Renamer в Инструментах или Настройках. Там должно быть для всех фото А этот способ сработает если медиафайлы у меня расположены на поддомене? Quote Link to post Share on other sites
Модератор files 2797 Posted February 12, 2015 Модератор Report Share Posted February 12, 2015 А этот способ сработает если медиафайлы у меня расположены на поддомене? не в курсе, если честно. Quote Link to post Share on other sites
Zaga 28 Posted May 29, 2015 Report Share Posted May 29, 2015 Уже странно, что SEO Friendly Images не работает. Это очень простой плагин и использует самые стандартные функции ВП для подмены алт и титле. Тут проще найти конфликт, чем изобретать велосипед (ну или как вариант - попробовать разные версии SEO Friendly Images) Например, версию 2.7.6 <?php /* Plugin Name: SEO Friendly Images Plugin URI: http://www.prelovac.com/vladimir/wordpress-plugins/seo-friendly-images'>http://www.prelovac.com/vladimir/wordpress-plugins/seo-friendly-images Description: Automatically adds alt and title attributes to all your images. Improves traffic from search results and makes them W3C/xHTML valid as well. Version: 2.7.6 Author: Vladimir Prelovac Author URI: http://www.prelovac.com/vladimir To-Do: - localization (done in premium version) - integration module with google xml sitempas to support images sitemap (done in premium version) Copyright 2008 Vladimir Prelovac vprelovac@gmail.com */ $seo_friendly_images_localversion="2.7.6"; $sfi_plugin_url = trailingslashit( get_bloginfo('wpurl') ).PLUGINDIR.'/'. dirname( plugin_basename(__FILE__) ); function seo_friendly_images_add_pages() { add_options_page('SEO Friendly Images options', 'SEO Friendly Images', 'manage_options', __FILE__, 'seo_friendly_images_options_page'); } function seo_friendly_images_admin_notice() { echo ''; } // Options Page function seo_friendly_images_options_page() { global $seo_friendly_images_localversion; $status=seo_friendly_images_getinfo(); $theVersion = ( isset($status[1]) ? $status[1] : ''); $theMessage = ( isset($status[3]) ? $status[3] : ''); if( (version_compare(strval($theVersion), strval($seo_friendly_images_localversion), '>') == 1) ) { $msg = 'Latest version available '.' <strong>'.$theVersion.'</strong><br/>'.$theMessage; _e('<div id="message" class="updated fade"><p>' . $msg . '</p></div>'); } // If form was submitted if (isset($_POST['submitted']) && check_admin_referer('CSRFcheck','CSRF_check')) { $alt_text=(!isset($_POST['alttext'])? '': htmlentities(stripslashes(strip_tags($_POST['alttext'])))); $title_text=(!isset($_POST['titletext'])? '': htmlentities(stripslashes(strip_tags($_POST['titletext'])))); $override=(!isset($_POST['override'])? 'off': 'on'); $override_title=(!isset($_POST['override_title'])? 'off': 'on'); update_option('seo_friendly_images_alt', $alt_text); update_option('seo_friendly_images_title', $title_text ); update_option('seo_friendly_images_override', $override ); update_option('seo_friendly_images_override_title', $override_title ); $msg_status = 'SEO Friendly Images options saved.'; // Show message _e('<div id="message" class="updated fade"><p>' . $msg_status . '</p></div>'); } if (isset($_GET['notice'])) { if ($_GET['notice']==1) { update_option('seo_friendly_images_notice', 1); } } // Fetch code from DB $alt_text = get_option('seo_friendly_images_alt'); $title_text = get_option('seo_friendly_images_title'); $override =( get_option('seo_friendly_images_override')=='on' ) ? "checked":""; $override_title =( get_option('seo_friendly_images_override_title')=='on' ) ? "checked":""; global $sfi_plugin_url; $imgpath=$sfi_plugin_url.'/i'; $action_url=htmlentities(stripslashes(strip_tags($_SERVER['REQUEST_URI']))); // Configuration Page echo <<<END <div class="wrap"> <h2>SEO Friendly Images $seo_friendly_images_localversion</h2> <div id="poststuff" style="margin-top:10px;"> <div id="sideblock" style="float:right;width:270px;margin-left:10px;"> </div> </div> <div id="mainblock" style="width:710px"> <form name="sfiform" action="$action_url" method="post"> <div class="dbx-content"> <input type="hidden" name="submitted" value="1" /> <h2>General Options</h2> <p>SEO Friendly Images automatically adds alt and title attributes to all your images in all your posts specified by parameters below.</p> <p>You can enter any text in the field including two special tags:</p> <ul> <li>%title - replaces post title</li> <li>%name - replaces image file name (without extension)</li> <li>%category - replaces post category</li> <li>%tags - replaces post tags</li> </ul> <h4>Images options</h4> <div> <label for="alt_text"><b>ALT</b> attribute (example: %name %title)</label><br> <input style="border:1px solid #D1D1D1;width:165px;" id="alt_text" name="alttext" value="$alt_text"/> </div> <br> <div> <label for="title_text"><b>TITLE</b> attribute (example: %name photo)</label><br> <input style="border:1px solid #D1D1D1;width:165px;" id="title_text" name="titletext" value="$title_text"/> </div> <br/> <div> <input id="check1" type="checkbox" name="override" $override /> <label for="check1">Override default Wordpress image alt tag (recommended)</label> </div> <br/> <div> <input id="check2" type="checkbox" name="override_title" $override_title /> <label for="check2">Override default Wordpress image title</label> </div> <br/><br/> <p> Example:<br/> In a post titled Car Pictures there is a picture named Ferrari.jpg<br/><br/> Setting alt attribute to "%name %title" will produce alt="Ferrari Car Pictures"<br/> Setting title attribute to "%name photo" will produce title="Ferrari photo" </p> <div class="submit"><input type="submit" name="Submit" value="Update options" /></div> </div> END; wp_nonce_field('CSRFcheck','CSRF_check', false); echo <<<END </form> <br/><br/><h3> </h3> </div> </div> END; } // Add Options Page add_action('admin_menu', 'seo_friendly_images_add_pages'); function remove_extension($name) { return preg_replace('/(.+)\..*$/', '$1', $name); } function seo_friendly_images_process($matches) { global $post; $title = $post->post_title; $alttext_rep = get_option('seo_friendly_images_alt'); $titletext_rep = get_option('seo_friendly_images_title'); $override= get_option('seo_friendly_images_override'); $override_title= get_option('seo_friendly_images_override_title'); # take care of unsusal endings $matches[0]=preg_replace('|([\'"])[/ ]*$|', '\1 /', $matches[0]); ### Normalize spacing around attributes. $matches[0] = preg_replace('/\s*=\s*/', '=', substr($matches[0],0,strlen($matches[0])-2)); ### Get source. preg_match('/src\s*=\s*([\'"])?((?(1).+?|[^\s>]+))(?(1)\1)/', $matches[0], $source); $saved=$source[2]; ### Swap with file's base name. preg_match('%[^/]+(?=\.[a-z]{3}\z)%', $source[2], $source); ### Separate URL by attributes. $pieces = preg_split('/(\w+=)/', $matches[0], -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); ### Add missing pieces. $postcats=get_the_category(); $cats=""; if ($postcats) { foreach($postcats as $cat) { $cats = $cat->slug. ' '. $cats; } } $posttags = get_the_tags(); $tags=""; if ($posttags) { foreach($posttags as $tag) { $tags = $tag->name . ' ' . $tags; } } if (!in_array('title=', $pieces) || $override_title=="on") { $titletext_rep=str_replace("%title", $post->post_title, $titletext_rep); $titletext_rep=str_replace("%name", $source[0], $titletext_rep); $titletext_rep=str_replace("%category", $cats, $titletext_rep); $titletext_rep=str_replace("%tags", $tags, $titletext_rep); $titletext_rep=str_replace('"', '', $titletext_rep); $titletext_rep=str_replace("'", "", $titletext_rep); $titletext_rep=str_replace("_", " ", $titletext_rep); $titletext_rep=str_replace("-", " ", $titletext_rep); //$titletext_rep=ucwords(strtolower($titletext_rep)); if (!in_array('title=', $pieces)) { array_push($pieces, ' title="' . $titletext_rep . '"'); } else { $key=array_search('title=',$pieces); $pieces[$key+1]='"'.$titletext_rep.'" '; } } if (!in_array('alt=', $pieces) || $override=="on" ) { $alttext_rep=str_replace("%title", $post->post_title, $alttext_rep); $alttext_rep=str_replace("%name", $source[0], $alttext_rep); $alttext_rep=str_replace("%category", $cats, $alttext_rep); $alttext_rep=str_replace("%tags", $tags, $alttext_rep); $alttext_rep=str_replace("\"", "", $alttext_rep); $alttext_rep=str_replace("'", "", $alttext_rep); $alttext_rep=(str_replace("-", " ", $alttext_rep)); $alttext_rep=(str_replace("_", " ", $alttext_rep)); if (!in_array('alt=', $pieces)) { array_push($pieces, ' alt="' . $alttext_rep . '"'); } else { $key=array_search('alt=',$pieces); $pieces[$key+1]='"'.$alttext_rep.'" '; } } return implode('', $pieces).' /'; } function seo_friendly_images($content) { return preg_replace_callback('/<img[^>]+/', 'seo_friendly_images_process', $content); } add_filter('the_content', 'seo_friendly_images', 100); //add_action( 'after_plugin_row', 'seo_friendly_images_check_plugin_version' ); function seo_friendly_images_check_plugin_version($plugin) { global $plugindir, $seo_friendly_images_localversion; if( strpos($plugin,'seo-friendly-images.php')!==false ) { $theVersion = $status[1]; $theMessage = $status[3]; if( (version_compare(strval($theVersion), strval($seo_friendly_images_localversion), '>') == 1) ) { $msg = 'Latest version available '.' <strong>'.$theVersion.'</strong><br/>'.$theMessage; echo '<td colspan="5" class="plugin-update" style="line-height:1.2em;">'.$msg.'</td>'; } else { return; } } } function seo_friendly_images_install() { if(!get_option('seo_friendly_images_alt')) { add_option('seo_friendly_images_alt', '%name %title'); } if(!get_option('seo_friendly_images_title')) { add_option('seo_friendly_images_title', '%title'); } if(get_option('seo_friendly_images_override' == '') || !get_option('seo_friendly_images_override')) { add_option('seo_friendly_images_override', 'on'); } if(get_option('seo_friendly_images_override_title' == '') || !get_option('seo_friendly_images_override_title')) { add_option('seo_friendly_images_override_title', 'off'); } if (!get_option('seo_friendly_images_notice')) add_action('admin_notices', 'seo_friendly_images_admin_notice'); } add_action( 'plugins_loaded', 'seo_friendly_images_install' ); я извиняюсь а куда этот код вставить? чтобы заработал плагин? или можно просто версию 2.7.6 выложить? а то тоже стала острая необходимость заполнять альт и тайтл в соответствии с постом темы.. а то этот код подставляю - он вроде работает но не полностью - настройки не работают Quote Link to post Share on other sites
Модератор files 2797 Posted May 29, 2015 Модератор Report Share Posted May 29, 2015 я извиняюсь а куда этот код вставить? чтобы заработал плагин? или можно просто версию 2.7.6 выложить? а то тоже стала острая необходимость заполнять альт и тайтл в соответствии с постом темы.. а то этот код подставляю - он вроде работает но не полностью - настройки не работают Сохраняете как файл seo-friendly-images.php в папку seo-image в папке plugins вашего ВП. Активируете в админке. Но не обновляете! С новыми версиями ВП почему-то не работает. Quote Link to post Share on other sites
Zaga 28 Posted May 29, 2015 Report Share Posted May 29, 2015 Сохраняете как файл seo-friendly-images.php в папку seo-image в папке plugins вашего ВП. Активируете в админке. Но не обновляете! С новыми версиями ВП почему-то не работает. в админке выдает такую ошибку: Fatal error: Call to undefined function seo_friendly_images_getinfo() in /home/chekhlyd/xn-----8kcod2ajcvj9dey3d5c.com.ua/www/wp-content/plugins/seo-image/seo-friendly-images.php on line 31 если не затруднит - можете дать полностью версию 2.7.6 рабочую? в архиве..буду благодарен...а этот плагин будет работать для картинок товаров woocommerce ??? Quote Link to post Share on other sites
Модератор files 2797 Posted May 29, 2015 Модератор Report Share Posted May 29, 2015 Plugin Name: SEO Friendly ImagesDescription: Automatically adds alt and title attributes to all your images. Improves traffic from search results and makes them W3C/xHTML valid as well.Version: 2.7.6 seo-image.zip а этот плагин будет работать для картинок товаров woocommerce ??? Вроде как не будет для произвольных типов записей. Но попробуйте... Quote Link to post Share on other sites
Zaga 28 Posted May 29, 2015 Report Share Posted May 29, 2015 Plugin Name: SEO Friendly Images Description: Automatically adds alt and title attributes to all your images. Improves traffic from search results and makes them W3C/xHTML valid as well. Version: 2.7.6 seo-image.zip Вроде как не будет для произвольных типов записей. Но попробуйте... переустановил, но ошибка в админке там и осталась, странно.... хотя видно что уже работает, но только для страниц, для товаров из woocommerce не работает к сожалению(((( а нужно было именно для него(( Quote Link to post Share on other sites
Модератор files 2797 Posted May 29, 2015 Модератор Report Share Posted May 29, 2015 Удалите строчку: $status=seo_friendly_images_getinfo(); это вроде как бесполезная кастрированная функция проверки версии Quote Link to post Share on other sites
Zaga 28 Posted May 29, 2015 Report Share Posted May 29, 2015 Удалите строчку: $status=seo_friendly_images_getinfo(); это вроде как бесполезная кастрированная функция проверки версии благодарю, работает, но основную функцию таки не выполняет((( в товарах не заполняет тайтлы и альт((( Quote Link to post Share on other sites
Модератор files 2797 Posted May 29, 2015 Модератор Report Share Posted May 29, 2015 благодарю, работает, но основную функцию таки не выполняет((( в товарах не заполняет тайтлы и альт((( Основную как раз и выполняет. Плагин работает (и заточен) для родных типов записей ВП. Quote Link to post Share on other sites
Zaga 28 Posted May 29, 2015 Report Share Posted May 29, 2015 Основную как раз и выполняет. Плагин работает (и заточен) для родных типов записей ВП. да возможно вы и правы)) а для товаров woocommerce не знаете плагина? вообще в идеале нужно и автоматом изменять название самого файла jpg в соответствии с названием товара..но думаю это мега задача для вордпресс Quote Link to post Share on other sites
Модератор files 2797 Posted May 29, 2015 Модератор Report Share Posted May 29, 2015 да возможно вы и правы)) а для товаров woocommerce не знаете плагина? вообще в идеале нужно и автоматом изменять название самого файла jpg в соответствии с названием товара..но думаю это мега задача для вордпресс woocommerce не совсем Ворпдресс. Не знаю, к сожалению, не работал с ним. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.