This Solution is about how to avoid duplicate urls on xml sitemap video wordpress. The problem is when we’ve multiple videos on the same post, I’m using this plugin Google XML Sitemap for Videos and it’s great but it’s generating multiple entries with the same url and google is detecting these errors.

To avoid that we need to edit (2 steps) this plugin and add these lines:

1-.

Search:

$xml .= ‘< ?xml-stylesheet type=”text/xsl” href=”‘ . get_bloginfo(‘wpurl’) . ‘/wp-content/plugins/xml-sitemaps-for-videos/video-sitemap.xsl”?>’ . “\n” ;
$xml .= ” . “\n”;

$videos = array();

 

Add:

$permalink_array = array();

 

Finally:

$xml .= ‘< ?xml-stylesheet type=”text/xsl” href=”‘ . get_bloginfo(‘wpurl’) . ‘/wp-content/plugins/xml-sitemaps-for-videos/video-sitemap.xsl”?>’ . “\n” ;
$xml .= ” . “\n”;

$videos = array();
$permalink_array = array();

 

2-.

Search:

$id = $match [2];
$fix = $c++==0?”:’ [Video '. $c .'] ‘;

if (in_array($id, $videos))
continue;

 

Add:

if (array_key_exists($permalink,$permalink_array))
continue;

$permalink_array[$permalink];

 

Finally:

$id = $match [2];
$fix = $c++==0?”:’ [Video '. $c .'] ‘;

if (in_array($id, $videos))
continue;

if (array_key_exists($permalink,$permalink_array))
continue;

$permalink_array[$permalink];

 

 

We need to save and re-generate our video sitemap and that’s it!

With this solution we will only have unique urls in our video sitemap.


Para el que no sepa que es Zend Studio, en resumidas cuentas, es un gran editor web orientado a la programación de páginas PHP, con ayudas en la gestión de proyectos y depuración de código.

Me han pasado por correo este listado de atajos de teclado (keyboard shortcuts) para Zend Studio.

Seguro que le viene de perlas a más de uno.

Gestión:

  • Ctrl + N -> Add New Document
  • Ctrl + O -> Open Document
  • Ctrl + F4 -> Close Document/Window
  • Ctrl + Shft + F4 -> Close All
  • Ctrl + Shft + O -> Open Project
  • Ctrl + Shft + N -> New Project
  • Ctrl + S -> Save File
  • Ctrl + Shft + S -> Save As
  • Ctrl + Alt + S -> Save All

Editor:

  • Ctrl + Space -> Show Code Completion
  • Ctrl + Space + Shft -> Show Function Arguments
  • Ctrl + Shft + F -> Reformat Code
  • Ctrl + / -> Add Remove Comment
  • Ctrl + / + Shft -> Add Remove PHP Block Comment
  • Ctrl + W -> Toggle Line Wrap
  • Ctrl + Z -> Undo
  • Ctrl + Y -> Redo
  • Ctrl + E -> Erase Line
  • Ctrl + D -> Duplicate Selection
  • Ctrl + L -> Change Selection to Lower Case
  • Ctrl + U -> Change Selection to Upper Case
  • Ctrl + B -> Bold Tag
  • Alt + I -> Italic Tag
  • Ctrl + – [1-3] -> Heading 1-3 Tag
  • Ctrl + Enter -> Break Tag
  • Ctrl + Back + Quote -> NBSP Tag
  • F1 -> Open Function Help


Código:

  • Ctrl + Shft + 1 -> Collapse All Non-PHP
  • Ctrl + Shft + 2 -> Collapse All Classes
  • Ctrl + Shft + 3 -> Collapse All Functions
  • Ctrl + Shft + 4 -> Collapse All DocBlocks
  • Ctrl + Shft + 9 -> Fold in Scope
  • Ctrl + Shft + E -> Expand All Folds
  • Ctrl + Shft + C -> Collapse All Folds


Depurando:

  • F8 -> Debug URL
  • F12 -> Profile URL
  • Ctrl + F5 -> Run
  • F5 -> Go
  • F10 -> Step Over
  • F11 -> Step Into
  • Shft + F1 1 -> Step Out
  • Shft + F5 -> Stop Debug
  • Shft + F10 -> Go to Cursor
  • F9 -> Toggle Breakpoint
  • Shft + F8 -> Add Watch
  • Ctrl + Alt + B -> Show In Browser


Navegación:

  • Ctrl + Alt + G -> Goto File
  • Ctrl + Shft + G -> Goto PHP Resource
  • Ctrl + G -> Goto Line
  • Ctrl + F2 -> Goto Next Bookmark
  • Alt + F2 -> Goto Next Project Bookmark
  • Ctrl + M -> Goto Matching Bracket
  • Alt + Left/Right -> Go Back/Forward
  • F2 -> Toggle Bookmark
  • Ctrl + Shft + F2 -> Remove All Bookmarks
  • Ctrl + Shft + M -> Open Bookmarks Dialog
  • Ctrl + Shft + R -> Show Recent Files
  • F4 -> Open Next Entry

CVS/Subversion:

  • Alt + U -> Update
  • Alt + C -> Commit


Herramientas:

  • Alt + Ctrl + A -> Analyze Code
  • Ctrl + Shft + I -> Check Include Files

Encontrar/Reemplazar:

  • Ctrl + F -> Find
  • F3 -> Find Next
  • Shft + F3 -> Find Prev
  • Ctrl + H -> Replace
  • Ctrl + Alt + F -> Find In Files

Plantillas PHP:

  • itar -> Iterates an Array
  • itdir -> Iterates a Directory
  • prv -> Prints a Value
  • inst -> Instance of Statement
  • fore -> For each Statement
  • swi -> Switch Statement
  • if -> If Statement
  • while -> While Loop
  • my_fr -> Mysql_Fetch_Row() Loop
  • my_gc -> Trap Code Output
  • cln -> Clone an Object
  • pcon -> Call Parent Constructor
  • fnc -> Function Statement


Plantillas HTML:

  • href -> Create a Hyperlink
  • ihref -> create an image hyperlink
  • form -> Create a Get Form
  • html -> Create Html Page
  • inbu -> Input by Button
  • insub -> Input Type Submit
  • intxt -> Input by Text Field
  • ol -> Ordered List
  • table -> Table 3 Rows by 3 Columns
  • jscript -> JavaScript Tag
  • select -> Select in Form
  • style -> Text/Css Style
  • inch -> Input by checkbox
  • ta -> form textarea

He estado buscando estos días la forma de incluir las noticias relacionadas de una noticia en los feeds de Feedburner, y buscando buscando lo he encontrado.

La solución se llama: ST Add Related Posts to Feed lo único que tenemos que tener en cuenta es que tenemos que tener instalado el plugin Ultimate Tag Warrior o Related Posts.

Una vez sabido esto la instalación es muy sencilla.

  1. Nos descargamos el plugin. Pincha aquí.
  2. Lo descomprimimos y lo subimos a nuestra carpeta wp-content/plugins
  3. Y finalmente lo activamos.

Todo lo que necesitas de FeedFlare para FeedBurner en castellano. Para los que me siguen vía feed, habreis visto que ahora aparecen unos enlaces de las noticias en la parte inferior. Me refiero a los enlaces: Meneame, Enviar por email, Añadir a del.icio.us y Enviar a Fresqui.

Bueno si quereis modificar los vuestros tan solo hace falta hacer lo siguiente: ir a nuestra zona de feed en cuestión de FeedBurner, hacer click en Optimize e irnos a FeedFlare.

Vereis que os aparecen unos cuantos predeterminados. Bueno pues bajamos un poco más y veremos Personal FeedFlare. En el cuadro inferior deberemos introducir los xml de los enlaces que se incluirán en nuestros feeds.

Podeis buscar en el catálogo de feedflare y en una lista de 101 ideas para feedflare . El problema es que aparecen en inglés y a nosotros nos gustaría que apareciesen estos enlaces en castellano.

En su día me tocó investigar por internet los sitios donde ofrecían estos enlaces. Sinceramente ya no me acuerdo de donde los saqué con lo que no puedo nombrar estas páginas.

Para ahorraros el trabajo de buscar, os dejo los enlaces a esos xml, los cuales harán que estos enlaces aparezcan en castellano. Para utilizarlos, copiar la ruta del enlace, pegarla en la casilla y hacer click en Add New Flare. Nos aparecerán arriba y simplemente seleccionaremos la primera casilla al lado del nuevo feedflare para que aparezca en nuestros feeds (la segunda es para incluirlos en los post). Y finalmente haremos click en Save, en la parte inferior de la página.

Bueno os dejo las rutas de estos xml, espero que os sirvan de ayuda: