Add a 2nd row of image links in the home page

  • Author
    Posts
  • #30737
    Senthil

    Hello, I am a beginner with WP. Mantra is the best choice of theme for my purpose. I tried adding a second row of images + links right below 4 placeholders available as part of the base theme. I am a beginner with php too. After spending a great deal of time in researching, I finally found that I can modify the settings.php (under admin folder) to add the additional image slides and by modifying theme_frontpage.php I can render the images onto the home page. I was successful with this first attempt. Then I had a requirement to add another row. I tried repeating the same steps. But it failed with the error “undefined index”. And I reverted back to the earlier working code, but that doesnt seem to work either.

    Here is the changes I have made to the settings.php file.

    Row no 549 (initially I had until 8 when it worked the first time, after the error, I am trying to make it work for just one more.
    //SKP adding 5 to the array;
    $items = array (“0″ ,”1”, “2” , “3” , “4” , “5” );

    After row no 626
    <!– SKP adding 5th column code begin–>
    <div class=”slidebox”>
    <h4 class=”slidetitle” > <?php _e(“5th Column”,”mantra”);?> </h4>
    <div class=”slidercontent”>
    <h5><?php _e(“Image”,”mantra”);?></h5>
    <input name=”ma_options[mantra_columnimg5]” id=”mantra_columnimg5″ class=”slideimages” type=”text” value=”<?php echo esc_url($mantra_options[‘mantra_columnimg5’]); ?>” />
    <span class=”description”><?php _e( ‘Select / Upload Image’, ‘mantra’ );?> </span>
    <h5> <?php _e(“Title”,”mantra”);?> </h5>
    <input id=’mantra_columntitle5′ name=’ma_options[mantra_columntitle5]’ size=’50’ type=’text’ value='<?php echo esc_attr( $mantra_options[‘mantra_columntitle5′] ) ?>’ />
    <h5> <?php _e(“Text”,”mantra”);?> </h5>
    <textarea id=’mantra_columntext5′ name=’ma_options[mantra_columntext5]’ rows=’3′ cols=’50’ type=’textarea’ ><?php echo esc_attr($mantra_options[‘mantra_columntext5′]) ?></textarea>
    <h5> <?php _e(“Link”,”mantra”);?> </h5>
    <input id=’mantra_columnlink5′ name=’ma_options[mantra_columnlink5]’ size=’50’ type=’text’ value='<?php echo esc_url( $mantra_options[‘mantra_columnlink5′] ) ?>’ />
    </div>
    </div>
    <!– SKP adding 5th column code end –> >

    It gives this error:

    Notice: Undefined index: mantra_columnimg5 in C:\wamp\www\agroPedia\wp-content\themes\mantra\admin\settings.php on line 633

    Could you please help me here? Thanks in advance..

    -Senthil

Viewing 1 post (of 1 total)

The topic ‘Add a 2nd row of image links in the home page’ is closed to new replies.