WordPress.org

Forums

How do I change html in wordpress? (6 posts)

  1. miku88
    Member
    Posted 2 years ago #

    On the bottom of this page http://teresitamoralesifbbpro.com/ it says "Latest From Blog". I'd like to change that wording so I went into bottom.php and changed it. It messed up the whole page. The php code I am trying to change looks like this: (I put in bold the part I want to change.)

    <div class='bottombox'>
    <h3> <?php _e('Latest from blog'); ?> </h3>
    <ul class="recposts">
    <?php $loop = new WP_Query( array( 'post_type' => 'post','showposts' => 5 ) ); ?>
    <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>

  2. Victor Rodriguez
    Member
    Posted 2 years ago #

    Hi! Teresita Morales looks like my perfect personal trainer lol, well, so you want to change that title "Latest from Blog", why are you messing up the page after the change? did you change only the text string part:

    <h3> <?php _e('Latest from blog'); ?> </h3>
    just edit to
    <h3> <?php _e('Your custom text'); ?> </h3>

    If not working try to change that text in the .mo .po file in your dierctory template, you can use Poedit (google it) to do that, open the file an change the text to match your text then save it.

    The _e part means that is a domaintext so you can use it to change the language of your theme with out changing the php code, just editing the .po .mo files in this case you are going to change the text for customizing purpose not for language translation.

  3. miku88
    Member
    Posted 2 years ago #

    Thanks for the info! I only changed the text- Latest from blog. I tried several times. Maybe I'll try it again. I don't really want to use Poedit. It seems like it should be so easy.

  4. Andrew
    Forum moderator
    Posted 2 years ago #

    Are you using a Child Theme?

  5. miku88
    Member
    Posted 2 years ago #

    Yay I figured it out. (I think) It's because I was trying to write "Let's Chat" and the word "Let's" has an apostrophe and it was messing up the PHP or something like that? It works without the apostrophe. So how should I write it so I can use an apostrophe? Thanks!

  6. Victor Rodriguez
    Member
    Posted 2 years ago #

    Ok, now i can see your mistake, yes, is a comun mistake if you dont know the sintax of php, just add a backslash directly before the apostrophe.

    <h3> <?php _e('Let\'s Chat'); ?> </h3>

    Now the PHP interpreter treats the character literally and not going to interpret it.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.