• Hello,

    I have a tiny problem with the plugin. I installed it, selected the categories I need to be subdomains, configured DNSs and it all works fine apart from one small thing: most of my posts are in one or more categories and some of them get the “subdomained” permalink, some of them do not. It probably has to do with this remark ‘If Your post has two or more categories, we will pick the first category order by an ID.’ you have made in the plugin settings page.

    Now, I’d love the plugin to do this one thing: if it sees, that the post is located in the category, that has it’s own subdomain, use the subdomain. There won’t be any overlapping from the categories (one post is in two categories with subdomains and so on).

    I can do the changes in the code myself, I don’t really care, just point me towards the right part of it.

    Otherwise you plugin code has to be printed out, stapled together by the hand of some gorgeous lady, framed in gold, put on some important mountain and worshipped by other plugin devs! It just works! Thank you!

    https://wordpress.org/plugins/main-category-as-subdomain/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author dersax

    (@dersax)

    Actually i am planning to give priority categories in next update, but if you can’t wait, here’s the code you need to change:

    Line : 340 (class.subdomain.php)
    Method : post_link

    usort($category, '_usort_terms_by_ID'); // order by ID

    Compare $category object data variable that matches subdomain in $this->selected_categories

    just remind you: your method can create duplicate content if you create new subdomain

    Thread Starter iMPR3SSiON

    (@impr3ssion)

    Thank you, exactly what I wanted! I am going to try this out! When are you planning to release the next update?

    I am using plugin version 1.0, in which the above code already appears on line 345 of the file.

    But I can view my posts that are assigned no category EXCEPT the subdomain category, and yet I can view them without the subdomain.

    In cPanel, I have my one subdomain name (I’m only using one) pointing toward the root directory of my WordPress install.

    Do you know why this isn’t working as expected? Otherwise, I do love the plugin. Thanks!

    Plugin Author dersax

    (@dersax)

    But I can view my posts that are assigned no category EXCEPT the subdomain category, and yet I can view them without the subdomain.

    do you mean “duplicate content”?
    did you have activated “redirect option”
    if you had, please send me your website address, I will try to identify your problem. bintangtaufik[at]gmail

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Post in multiple categories, only some get the subdomain permalink’ is closed to new replies.