Custom Post Type - index / or archive

hi there,

in my child theme I created a custom post type “depoimentos” and created the single-depoimentos.php, wp-single-depoimentos.php… and it’s ok.

but when i try ( …/depoimentos) i was expeting to find an index for “depoimentos” but i get an error msg: “…The page you are looking for is no longer here”

can you help me with that?

thanks

Hi,

The default archive template is index.php at the root folder of the theme. You could just duplicate and rename it with your archive name. Then do the same with other template parts.

get_template_part() is wrapped by X’s function named x_get_view(). This allows to pick template parts based on stack (from specific folder locations). Please check X’s customization best practices.1

So from the index.php:
<?php x_get_view( x_get_stack(), 'wp', 'index' ); ?>
That lines is calling wp-index.php from this folder: wp-content\themes\x\framework\views\{stack}

Hope this helps.

Hi,

i duplicated the index, renamed it to depoimentos.php (wp-content/themes/x-child) and changed to:

<?php x_get_view( x_get_stack(), 'wp', 'depoimentos' ); ?>

and at the stack folder (wp-content/themes/x-child/framework/views/renew)
wp-depoimentos.php
with the same content from the wp-index.php

nothing changed, still with the msg “…The page you are looking for is no longer here”

whats missing?

Hi there,

Is it supposed to be an archive page? Then it should be archive-depoimentos.php instead of just depoimentos.php. Plus, your custom post type should have has_archive option and set to true.

Are there existing items for that post type? If none then that message will appear as well.

Thanks!

Hi there,

ok, now it has the “has_archive” but now i got another ploblem, as this one:

here it is:
Warning: include(/var/www/vhosts/domain.com/httpdocs/wp-content/themes/x-child/index.php): failed to open stream: No such file or directory in /var/www/vhosts/domain.com/httpdocs/wp-includes/template-loader.php on line 74

Warning: include(/var/www/vhosts/dsc-curitiba.com/httpdocs/wp-content/themes/x-child/index.php): failed to open stream: No such file or directory in /var/www/vhosts/domain.com/httpdocs/wp-includes/template-loader.php on line 74

Warning: include(): Failed opening ‘/var/www/vhosts/domain.com/httpdocs/wp-content/themes/x-child/index.php’ for inclusion (include_path=’.:/opt/plesk/php/5.6/share/pear’) in /var/www/vhosts/domain.com/httpdocs/wp-includes/template-loader.php on line 74

do you think it’s the same problem?

Thanks

Yes. Your archive-depoimentos.php file is causing it. I renamed it and the error was gone.

Regretfully, this is getting into custom development which is outside the scope of our support. I recommend that you learn the best practices in customizing X.

If you have a tight deadline, we do have an in-house custom development team that offer paid services, who may be able to assist. They can be contacted at pinnacle@theme.co if this is of interest to you.

Thank you for your understanding.

Thank you!

You’re welcome.

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