What is this small code's error?

7 replies
Hello my friens. Can you fix this code?

<div class="footerleft">
<?php _e('Powered by',wordpress); ?> <?php _e('Design by' organicthemes); ?> </div>


Thanks.
#code #error #small
  • Profile picture of the author Tashi Mortier
    I assume this code comes from Wordpress?

    I'm not 100 % sure, but it seems there are some '' missing, try this:

    <div class="footerleft">
    <?php _e('Powered by wordpress'); ?> <?php _e('Design by organicthemes'); ?> </div>

    edit: removed my second example, because it is wrong.
    Signature

    Want to read my personal blog? Tashi Mortier

    {{ DiscussionBoard.errors[4577370].message }}
  • Profile picture of the author ghughes
    I believe Tashi is correct. You may also want to read more about the WordPress translation code (link provided below) because the following code is also technically acceptable (although not what you want in this case).

    <div class="footerleft">
    <?php _e('Powered by', 'wordpress'); ?> <?php _e('Design by', 'organicthemes'); ?> </div>

    What this function does is look up the localized output for the value "Powered by" in the "wordpress" domain. If it exists, it will echo it. This allows you to create a theme for deployment in multiple languages.

    In the second case above, it would look for the translation file in the wp-content\themes\organicthemes folder. If the file was not found, it would simply output "Design by."

    But, I believe that Tashi is correct based on the context of what is being output. It appears that you simply want to output the full string of text in the footer.

    You can learn more about the Wordpress localization functions here:

    Translating WordPress « WordPress Codex
    Signature

    Gary Hughes
    IT Services of Texas
    www.completesolutions.com

    {{ DiscussionBoard.errors[4579122].message }}
  • Profile picture of the author iintense
    Banned
    [DELETED]
    {{ DiscussionBoard.errors[4581054].message }}
    • Profile picture of the author alkantenik
      Originally Posted by iintense View Post

      I agree...it looks fine...but why not just do...

      <div class="footerleft">
      <?php _e('Powered by', 'wordpress'); _e('Design by', 'organicthemes'); ?>
      </div>

      Thanks. You are correct.

      Also thanks all friends.
      Signature
      Wordpress Designer
      Skype: wordpress_alkan
      {{ DiscussionBoard.errors[4581937].message }}
      • Profile picture of the author SteveJohnson
        Originally Posted by alkantenik View Post

        Originally Posted by iintense
        I agree...it looks fine...but why not just do...

        <div class="footerleft">
        <?php _e('Powered by', 'wordpress'); _e('Design by', 'organicthemes'); ?>
        </div>
        Thanks. You are correct.

        Also thanks all friends.
        This IS NOT CORRECT.

        You're going to get a footer that looks like:
        Code:
        Powered byDesign by
        If the theme isn't using localization, the correct form would be:
        <?php _e('Powered by WordPress'); _e('Design by OrganicThemes'); ?>

        If using localization, locate the textdomain that has been loaded - probably 'organicthemes' in this case, and use this:
        <?php _e('Powered by WordPress', 'organicthemes'); _e('Design by OrganicThemes', 'organicthemes'); ?>
        Signature

        The 2nd Amendment, 1789 - The Original Homeland Security.

        Gun control means never having to say, "I missed you."

        {{ DiscussionBoard.errors[4607517].message }}
  • Profile picture of the author rainso0
    <div class="footerleft">
    <?php _e('Powered by', 'wordpress'); _e('Design by', 'organicthemes'); ?>
    </div>

    So this is the correct answer?

    Glad to hear your problem has been solved
    Signature
    {{ DiscussionBoard.errors[4601133].message }}

Trending Topics