Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1243625
    MiquelAdell
    Participant

    Hi, please let me first state some things about my project:

    I have a child theme of X called “jipi”.
    I have created a custom post type called “past”. I plan on having single plage custom template and archive custom template for said post type.

    Single page tempalte works perfectly. I have ‘single-past.php’ on the root of my child theme and it gets called on:
    http://staging.jipi.cat/en/past/2016/

    But the file ‘archive-past.php’ does not get called on http://staging.jipi.cat/en/past
    Instead I got the following error:

    Notice: Undefined index: args in /home/jipi/staging.jipi.cat/wp-includes/functions.php on line 4961
    
    Warning: include(/home/jipi/staging.jipi.cat/wp-content/themes/jipi/index.php): failed to open stream: No such file or directory in /home/jipi/staging.jipi.cat/wp-includes/template-loader.php on line 75
    
    Notice: Undefined index: args in /home/jipi/staging.jipi.cat/wp-includes/functions.php on line 4961
    
    Warning: include(): Failed opening '/home/jipi/staging.jipi.cat/wp-content/themes/jipi/index.php' for inclusion (include_path='.:/opt/cpanel/ea-php55/root/usr/share/pear') in /home/jipi/staging.jipi.cat/wp-includes/template-loader.php on line 75

    There seems to be happening 2 things here.
    It does not find any custom template for the archive page so it goes all the way to request ‘index.php’ but it’s looking for said index.php on the path of the child theme and as I not have a copy of X index.php there it fails.

    That’s puzzling me because I’ve both followed the WordPress guide to custom post types and also checked this post with instructions specific for X and I don’t see anything wrong… in fact single-past.php works.

    Is there something that I’m missing?

    Thanks!

    #1243691
    Rue Nel
    Moderator

    Hello There,

    Thanks for writing in! Would you mind providing us the url of your site with login credentials so we can take a closer look and fix the issue? This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.

    To do this, you can make a post with the following info:
    – Link to your site

    – WordPress Admin username / password
    – FTP Hostname
    – FTP Username
    – FTP Password

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    Thank you.

    #1243748
    MiquelAdell
    Participant
    This reply has been marked as private.
    #1243886
    MiquelAdell
    Participant

    It’s related to WPML. Disabling this plugin makes everything “work”.

    I’ll look to that plugin instead then.

    Thanks!

    #1243895
    Rahul
    Moderator

    Glad you’ve sorted it out for yourself!

    If you have anything further to ask, kindly let us know. We’d be happy to assist you with anything.

    Thank you.

    #1243999
    MiquelAdell
    Participant

    I was to quick to dismiss this issue.

    It seems to be a issue with *both* X and WPML.

    If I disable WPML X works as intended.
    But if I use a child theme of twentysixteen with just the CPT the archive works correctly.

    I’ve created just this test and staging.jipi.cat/en/past displays “archive-past” which is the correct optput.

    If I switch to the X child I get the error from the first post.

    If I switch to the X child *and* disable WPML it works.

    As I’ve seen X work with WPML with X I suspect there is something more to it.

    Could you please give it a look?

    #1244488
    Rue Nel
    Moderator

    Hello There,

    This is not the issue between X and WPML. This is because of the way you have created the custom post type template. To fully understand how it should be done, please follow a detailed instruction from this topic: https://community.theme.co/forums/topic/need-advice-on-custom-post-type-template/#post-616094

    For reference topic, you may check these topics as well: https://community.theme.co/forums/topic/custom-post-type-template-2/, https://community.theme.co/forums/topic/custom-post-type-templates/

    Hope this helps.

    #1246727
    MiquelAdell
    Participant

    Hello,

    Thanks for your help.

    I’ve read the 3 linked posts and I’m not getting it to work. Either there is something different on my configuration or I am not understanding something.

    I’ve created some test files and uploaded them to the test server.

    My file structure is as follows (paths relative to the child theme folder):

    ./index.php

    Is a copy of x/index.php

    single-past.php
    contains:

    <?php x_get_view( x_get_stack(), 'wp', 'single-past' ); ?>
    

    archive-past.php
    contains:

    <?php x_get_view( x_get_stack(), 'wp', 'archive-past' ); ?>
    

    So from this point on I should be checking the files on
    ./framework/views/icon/

    There I have:
    ./framework/views/icon/wp-index.php
    a copy of the same file from the X theme folder.

    ./framework/views/icon/wp-single-past.php
    A copy and rename of wp-index.php

    ./framework/views/icon/wp-archive-past.php
    A copy and rename of wp-index.php

    For single-past URLs everything works.
    The files are called as:

    ./single-past.php
    ./framework/views/icon/wp-single-past.php

    But for archive-past URLs I get the following stack of calls:

    ./framework/views/icon/wp-index.php
    

    Instead of
    ./framework/views/icon/wp-archive-past.php

    You can check all that by going to the following urls:

    http://staging.jipi.cat/en/past/?test
    and
    http://staging.jipi.cat/en/past/2016/?test

    I’ve made all the files referenced on this reply print their file names if ?test is passed.
    (you can remove test to see the normal output)

    It seems to me that, for some reason, ./archive-past.php, is not being recognized as the template for the archive of past CPT.

    #1246744
    Paul R
    Moderator

    Hi,

    I would like to check, but the ftp login you provided no longer works.

    Do you mind activating it again so we can check.

    Thanks

    #1246818
    MiquelAdell
    Participant
    This reply has been marked as private.
    #1246949
    Rad
    Moderator
    This reply has been marked as private.
    #1247062
    MiquelAdell
    Participant
    This reply has been marked as private.
    #1247635
    Jade
    Moderator

    Hi there,

    I tried to login through the details you have provided but it still doesn’t seem to work.

    Kindly double check and make sure that the IP restriction is temporarily disabled.

    Thank you.

    #1248360
    MiquelAdell
    Participant

    I’m checking with my hosting provider. I’ll come back to you. Sorry about the delay.

    #1248388
    Christopher
    Moderator

    Let us know how it goes.

  • <script> jQuery(function($){ $("#no-reply-1243625 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>