• Anonymous User 14737637

    (@anonymized-14737637)


    Someone asked on this topic the same question before. However the answer is not so clear for who does not good knowledge like me. But I found a way.

    1. As the plugin author @alexandret mention on that topic, I copied template/opensearchserver_search.php file to the root of my theme’s folder. I found facet post type value
    <?php print opensearchserver_get_facet_value($facet, $value); ?>

    and I deleted that.

    Search result was like this before:

    – page (2)
    – blog (5)
    – forum (1)

    And then changed to this:

    – (2)
    – (5)
    – (1)

    2. Why I did this? Because I discovered that, on the search result page, each post type has different label tag. Like this: <label for="type_page"> <label for="type_post"> so on

    Now I added some css code to my style.css file:

    
    label[for="type_page"] a.oss-link:before {
        content: 'страница';
    }
    
    label[for="type_post"] a.oss-link:before {
        content: 'Блог';
    }
    
    label[for="type_forum"] a.oss-link:before {
        content: 'Форум';
    }
    

    And now it looks like this

    – страница (2)
    – Блог (5)
    – Форум (1)

    This is the way that I found.

    • This topic was modified 8 years, 4 months ago by Anonymous User 14737637.
    • This topic was modified 8 years, 4 months ago by Anonymous User 14737637.
    • This topic was modified 8 years, 4 months ago by Anonymous User 14737637.
    • This topic was modified 8 years, 4 months ago by Anonymous User 14737637.
Viewing 1 replies (of 1 total)
  • Thread Starter Anonymous User 14737637

    (@anonymized-14737637)

    I found a better way.

    As I mentioned on the previous message delete the code <?php print opensearchserver_get_facet_value($facet, $value); ?> in template/opensearchserver_search.php

    and

     <?php if ($value == 'page') {
                              print 'страница';
                              }
                              elseif ($value == 'post') {
                              print 'Блог';
                              }
                              elseif ($value == 'forum') {
                              print 'Форум';
                              }
       ?> 
Viewing 1 replies (of 1 total)
  • The topic ‘Post Type translation – an idea’ is closed to new replies.