Monday, 15 February 2010

Wordpress: Use post Excerpt to insert a URL -


I use a part of a term to use that content in a

  & lt; A href = "& lt ;? php the_excerpt () ;? & gt;" & Gt; Link & lt; / A & gt;  

But it generates only empty space and the URL does not join well, how is any idea fixed?

Here is a screen:

Code> get_the_excerpt () . See the documentation here:

Write the result of get_the_excerpt () in a var and enter as many as you like. "The_xxx" The work is used in the loop:

Edit: I tried to reproduce your results and found the problem! Some Theme Functions (within functions.php) For each generated quote, add a "Read more" link if you use the_excerpt or get_the_excerpt.

In my case Twenty Eleven uses this topic:

  / ** * Set the post excise length to 40 words. * * To override this length in the subject of hair, remove the filter and join your own function * excerpt_length filter hook. * * @since Twenty Eleven 1.0 * * @ Ultimate int $ Length Number of characters * 0return int characters Filter Number * / Function BiseLine_XSprint_Lamp ($ Length) {Return 40; } Add_filter ('excerpt_length', 'twentyeleven_excerpt_length'); If (Function_exists ('twentyeleven_continue_reading_link')): / ** * Extras * * @since Twenty Eleven 1.0 * * @Return string Return a "Continue Reading" link "Continue Reading" HTML Link * / FunctionBeselvin_going_reading_link ( ) {Return '& lt; A href = "'esc_url (get_permalink ()).' '& Gt;' .__ ('Continue reading; & lt; span class =" meta-nav "& gt; & amp; rarr; & lt; / span Read more links with 'Elyspiris' in '[...]', 'Equine', '& lt; / a & gt;';} if end; //baseelvin_change_reading_link / ** * [...] "has been added for automatically generated fractions. * * To override it in a child theme, remove the filter and add your own * function associated with Extra_more filter hooks. * * @since Twenty Eleven 1.0 * * @ Ultimate String $ More Read More Text * @ RATTER FILDER Read More * / function BEILIEN_OUTOXSearch_Advanced ($ more) {if (! Is_admin ()) {Return '& amp; hellip;' .20eleven_continue_reading_link ();} $ return;} Add_filter ('excerpt_more', 'twentyeleven_auto_excerpt_more'); / ** * Add a beautiful "Continue reading" link in the custom post excerpts. * * Override this topic in a child theme For, remove the filter and add your own * function associated with the get_the_excerpt filter hook. * * @since Twenty Eleven 1.0 * * @ External String $ Output "Continue Reading" link * @ Layer Filtered "Continue reading" link . * / Function bisileclass_xsrint_access ($ Output) {if (Ha_akssrpt () and amp; amp; amp; Awr_aitaktment () & amp ;! Ha_admin ()) {$ output. = Twentyeleven_continue_reading_link ();} return $ output;} Add_filter ( 'get_the_excerpt', 'twentyeleven_custom_excerpt_more' );  

I have removed the above code from functions.php (to ensure that no automatic fraction is modified) and the result you are looking for Trying to do it again with it! Calling get_the_excerpt () without plain formatting or wired href The expertise.

To make sure that the rest of your page still works, I recommend making a fraction of my own rather than removing this task.


No comments:

Post a Comment