Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7979651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:49:50+00:00 2026-06-04T09:49:50+00:00

Is this possible? <div id=example title=is possible put PHP code here?> some text </div>

  • 0

Is this possible? <div id="example" title="is possible put PHP code here?"> some text </div>
I want put <?php the_excerpt(); ?> in the Title attribute

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T09:49:52+00:00Added an answer on June 4, 2026 at 9:49 am

    Yes.

    <div id="example" title="<?php echo the_excerpt(); ?>"> some text </div>
    

    or:

    <div id="example" title="<?= the_excerpt() ?>"> some text </div>
    

    The latter is a shorthand that automatically echoes everything in the PHP block, whereas the former can contain any code, including code that echoes something (prints it to where the block is).

    See basic syntax.

    Take note, however, to escape anything you output to HTML, to make sure it’s a valid attribute value (unless the_excerpt() already returns an escaped string):

    <div id="example" title="<?= htmlspecialchars(the_excerpt()) ?>"> some text </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider this HTML: <div id=entry-content> <div id=my-300px-ad>AD CODE HERE</div> <p><img src=file.jpg alt=file /></p> <p>SOME
Possible Duplicate: How to access this attribute using jquery, given a div defined by
Is this possible? example: $('a.change').click(function(){ //code to change p tag to h5 tag });
Using JQuery it possible to clone a Div like this and change add a
is it possible to do something like this in JSTL: <div class=firstclass<c:if test='true'> someclass</c:if>>
Is it possible to generate comments for closing div tags, lets take this ex.
$(#tab1).click(function(){ loadTab(1); $('div.HOMEtabdiv ul.HOMEtabs a').removeClass('selected'); $(this).addClass('selected'); }); Would it be possible to make the
Is this possible? I've followed the instructions from here ( http://www.jetbrains.net/confluence/display/TCD4/Setting+up+an+External+Database#SettingupanExternalDatabase-MicrosoftSQLServer2005 ) but I
Is it possible to have one controller use another? For example: This HTML document
I want to turn the JavaScript in this example into jQuery. Basically I've jerry-rigged

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.