• Resolved airamnaal

    (@airamnaal)


    Hi, I am new to wordpress. Could someone please help me to add a function to a specific post on the main page. I have 4 columns in one section and I need to add a word to the 4th columns title (page id = 13). Each of the column is a page. Now I have words next to each title of page 4, but I only need the word next to the title on main page.
    My code:
    function klipper_add_word( $content ) {
    if (is_page(13)) {
    $custom_content = ‘Tädi Maali’;
    $custom_content .= $content;
    return $custom_content;
    }

    else {
    return $content;
    }
    }
    add_filter( ‘the_title’, ‘klipper_add_word’ );

Viewing 2 replies - 1 through 2 (of 2 total)
  • i dont understand very well what you want to do but you can use wp_functionif ( is_front_page() )`

    ex

    function klipper_add_word( $content ) {
    if (is_page(13)) {
      if ( is_front_page() ) {
        $custom_content = 'Tädi Maali';
        $custom_content .= $content;
        return $custom_content;
      }else {} // end is_front_page
    }

    else {
    return $content;
    }
    }
    add_filter( ‘the_title’, ‘klipper_add_word’ );

    Thread Starter airamnaal

    (@airamnaal)

    sorry english is not my native language, but i figured it out! thank you for your time 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘wordpress hooks’ is closed to new replies.