• Hello Friends of coding and programation,

    I am new to WordPress and I am looking to create a “sub-article” from an existing article!?

    Specifically:
    For my site, I have a “Culture “category and an article “420” with the following URL:

    https://wikihhc.com/culture/420/

    What I would like to do is to easily add a sub-article (page?) as it is possible with pages and the “parent” option. For example, a sub-article about France:

    https://wikihhc.com/culture/420/france/

    However, with articles, this option is not available, only adding subcategories is possible, and that’s not what I want for several reasons:

     – By creating a subcategory, I “lose” my /420/ article because it automatically becomes a listing category page.
     – I don’t want to create a category for each subpage; that would be too many.
     – It quickly becomes chaotic with subcategories, creating duplicate content.

    For now, to illustrate my problem, I have left my blog with a subcategory, but now my article 420 no longer appears.
    In the WordPress display, with two “equal” URLs, I imagine that the category takes precedence over the article, and since the article and category have the same URL, WordPress must make a choice!

    What would be the solution to implement?

    Thank you in advance for your help and kindness.

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator bcworkz

    (@bcworkz)

    Blog posts are not hierarchical, you cannot assign a parent post to other posts. If you desire a hierarchical organization you need to either use pages or a custom post type.

    OTOH, pages by default do not have categories. But a small amount of custom code can make pages have categories.

    Thread Starter Lucas Lopez

    (@lucaslopez)

    Thank bcworkz for your answer :

    For info I just tried with the plugins:
    Posts 2 Posts
    custom post type ui
    (plugin to customize posts)

    Post Tags and Categories for Pages
    Pages with category and tag
    (plugin to add categories to pages)

    So finally I tried an extension that customizes permalinks: Permalink Manager
    And it work as i wanted!
    But…

    Except that now my urls are no longer translated by my TranslattePress plugin…
    and therefore for example the part (category) /culture/ of my site is not translated into /cultura/ for the Spanish part…
    (for 420 there is nothing to translate lol)

    ex I got:
    https://wikihhc.com/es/culture/420/francia/

    instead of what I want:
    https://wikihhc.com/es/cultura/420/francia/

    the ‘a’ makes all the difference and it is valid for the other languages…

    I wanted to go back to rewriting in Htaccess but it’s beyond my knowledge and it’s just a gas machine!
    I imagine there must be a conflict between the Permalink extension and TranslattePress
    What a disappointment so close to the goal!

    If you have another method I’m a taker but as you said before is better to don’t custom too much!

    Moderator bcworkz

    (@bcworkz)

    I don’t know how either plugin works, but I suspect Permalink Manager is somehow bypassing whatever mechanism TranslatePress uses to translate URLs. A conflict as you say. It could be a timing issue, that one does its thing before the other and you’d want it the other way around. This isn’t uncommon when plugins utilize the same hooks. Often this can be resolved by altering the priority of which hook callback is called first or last.

    You could try asking in the dedicated support channel of one or both for suggestions on how their plugin might be altered to work properly with the other. Unfortunately a meaningful suggestion likely requires good knowledge of both.

    Thread Starter Lucas Lopez

    (@lucaslopez)

    Thank you for your insightful response! Your explanation about the potential conflict between Permalink Manager and TranslatePress makes sense, and I appreciate your suggestion to look into the priority of the hook callbacks.

    I’ll definitely follow your advice and reach out to the dedicated support channels for both plugins to see if they have any suggestions on how to resolve this issue. Your help has been really valuable, and I appreciate the time and effort you’ve taken to provide this information.

    Best regards,

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Create a sub-article in WordPress from an existing article?’ is closed to new replies.