• Resolved biblicomentarios

    (@biblicomentarios)


    I’m creating a series of CPT. I used acf to create this, but they seems to behave normal. I have two CPT named capitulo and versiculo.

    versiculo uses the single-versiculo.php template and I can see the posts display the links. The single-versiculo.php uses this line to display the content:

    <?php echo apply_filters('the_content', get_the_content()); ?>

    capitulo uses the single-capitulo.php template. It uses this line to display the content:

    echo apply_filters('the_content', get_the_content());

    But there are no links displayed. I can’t see the difference and I’m turning myself crazy with this.

    Besides, in single-capitulo.php I also retrieve versiculos, because there are a one to many relationship among capitulos and versiculos. Because performance, I use a direct call to the database to retrieve the content from wp_posts ($versiculo->ver_contenido). Then I use this line to display the post:

    $filtered_content = substr(apply_filters('the_content', $versiculo->ver_contenido), 3, -5);
    printf('<div class="versiculo-item " style="background-color:var(%s)"><b style="color:purple">%s</b> %s</div>',                                            $alternateColor,                                            $versiculo->ver_num_versiculo,                                            $filtered_content                                        );

    Despite the use of apply_filters with the_content filter, I can’t see any link in my page.

    The CPT Capitulos is also added to the whitelist. What may be wrong?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter biblicomentarios

    (@biblicomentarios)

    I used another existing CPT, volumen. I added it to the whitelist. I used exactly the same code than versiculo in single-volumen.php. I rebuild the index. No links in any volumen, but the links in the versiculo remains. I changed the template to single.php. Same situation.

    So, I have a CPT that works, versiculo, and two CPT that doesn’t work, volumen and capitulo. Capitulo is a complex code, with relationships, so I’m currently focusing in volumen and versiculo.

    I went to ACF to compare both CPT’s. Same features in the advanced section of the types. I can’t see what’s the difference.

    This are my testing URLs:

    versiculo
    https://biblicomentarios.com/versiculo/mateo-28_12/

    volumen
    https://biblicomentarios.com/volumen/antiguo-testamento/

    This post, in volumen, would must display several links, because the posts (Abraham, Moises, etc.) has the corresponding keywords.

    Plugin Support markilj

    (@markilj)

    Thank you for contacting us.

    I see, so you are able to generate links on post type versiculo right? I assume it is using the default wordpress editor? or the_content field right?

    Does it only not show the links for capitulo, and volumen in the front end? Or it doesn’t generate any links at all? If there are any links generated to them they should show up here: https://prnt.sc/x1QCKeB730mQ the issue would be from the filter, but if no links are generated to them, it could be that these post types use a Custom field for their content?

    But from the code above I assume the contents are fetch thru code right? it is from the versiculo and the capitulo’s the_content is actually empty? Is that correct?

    Thank you

    Plugin Support markilj

    (@markilj)

    As we have not heard from you in a while, we are closing the thread. Please feel free to get back in contact if you need further support.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Links not being displayed in CPT’ is closed to new replies.