Edit index.php. tco_theme_template

Hi, use X theme 9.1.4
I have to put some php code in page that use index.php

like this (show all autor list):

<?php wp_list_authors( 'exclude_admin=0&optioncount=1' ); ?>

But i index.php I have only this code:

get_header();
do_action( ‘tco_theme_template’ );
get_footer();

How to edit (put custom php code) in that template ?

Thansk,
Dejan

Hello Dejan,

Thanks for writing in!

You need to install a child theme. You can get it here:

once installed, go to Appearance > Theme File Editor > functions.php file and insert a PHP add_action() code. Kindly check this out:

Kindly let us know how it goes.

Hi Ruenel, thanks on reply.

I have make copy of index.php and put in child theme and then have to insert a PHP add_action() code in **Appearance > Theme File Editor > functions.php (also in child theme).

Is this the correct procedure?

Dejan

Hey Dejan,

According to Runel’s instruction, yes. But, if you inserted exactly the add_action() code, that doesn’t do anything and does not answer your question on how to add code in index.php.

The code in the index.php simply gets other template parts, and those template parts are where you should add the code. We can point you to the template part if you tell us exactly where you need to output your author code.

Please just note that working with the child theme requires that you understand PHP and WordPress development. We cannot teach you those subjects, and we will not fix custom development issues. We can, however, provide some guidance in our One Premium Support.

Thanks.

Hi Christian,

Template part is at the beginning of the container to output my author code.

Can you please point me to the template part ?

Thanks,
Dejan

Hey Dejan,

Since you didn’t specific the exact area, I assume you mean the main x-container. In that case, the template is wp-index.php. You can find that in wp-content\themes\pro\framework\views\integrity assuming your Stack is Integrity.

To learn more how to customize our themes, please see https://theme.co/docs/best-practices

Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.