How to add a link in a blockquote cite

Hi there,

I’m trying to add a link in all my blockquotes cites. I tried to use one of your tricks but it doesn’t work…

Here’s the code

1. Copy content-quote.php from \x\framework\views\{STACK}\ to your child theme (eg. \x-child\framework\views\{STACK}\ )

2. Edit your child theme’s content-quote.php and replace all instances of this code :

<cite class="entry-title-sub"><?php echo $cite; ?></cite>

with this:

<cite class="entry-title-sub"><?php echo '<a href="'.get_post_meta(get_the_ID(), 'cite_url', true).'" target="_blank">'.$cite.'</a>'; ?></cite>

3. Save and upload.

4. Now edit your posts that are formatted as quote and go to Screen Options from the very top of the page and enable Custom Fields.

5. At your current post, scroll down until you find Custom fields section.

6. Add new custom field with the name of cite_url and the value of your preferred url/link.

7. Save/publish your post.

I also changed the class “entry-title-sub” to “x-cite” but nothing changed. Where am I wrong?

I’ll attache a secure note with login and password, in case you need those.

Thanks in advance :slight_smile:

Regards

Hi There,

Thanks for writing in! You reference shows how to edit the Quote page (when you add new post, there are post formats).

Could you please provide us with the URL to your sample page? so that we can assist you.

Thanks!

Hi there,

the page with the blockquote I need to add links is my home page. At the bottom I add a carousel with some blockquote via shortcode. I need to link the name cite in the blockquotes to a Facebook reviews link: all cites must have the same link so no big deal.

The account login is in the secure note I’ve attached in first post.

Hope you can help me :slight_smile:

Regards

Hey @frankie_design,

The fastest way to achieve that wrapping the cite with an anchor tag linking to your FB link. Here’s the code you need to put in either your Global CSS for site-wide implentation or Content CSS for page per page basis.

jQuery('.x-cite').wrap('<a href="FACEBOOK_URL" target="_blank"></a>');

Please note that this requires custom code and this is outside the scope of our support. Fixing issues arising from the use of it and further enhancements would be your responsibility. Thank you for understanding.

Hope that helps.

Hey there,

it works! :slight_smile: What should I do if I want to add the same link to a photo or the text in the block quote? Do I just have to add the right class in the query string?

Thanks in advance :slight_smile:

Apply a class to your image or text then add the class like this (.x-cite, .my-class)

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.