Forum Replies Created

Viewing 15 replies - 31 through 45 (of 46 total)
  • Thread Starter TheElear

    (@peterpap)

    Hi again Chouby,

    So I set up this test site where I activated Polylang and as expressed above it works like a dream. Now I have activated it in my live site and have the same problem again!

    I can set up languages in settings, I can set up pages in different languages and easily link relevant page translations using ID field. I can then see liitle ‘+’ and pencil icons in the table listing all pages.

    However when it comes to categories and tags I am not able to even set a language.

    Lets say I have 30 categories, all with English selected in the dropdown (they were original categories). I add a couple of new translated categories. Now I click on edit (new) category. The language shows English. So I select Polish from the drop down (as this is the second language for my project). A frame shows up below – more like a table – showing 3 columns in 1 row:
    Language – English
    Translation – No untranslated term
    Edit – Add new

    There is no drop down field where I could select matching English category! I believe a drop-down field should appear where there is ‘No untranslated term’ is.

    It is absolutely doing my head in!!!
    I click ‘Update’ button and my language selection is not saved.
    When I come back to re-edit the category it still reads English even though I had selected different language.
    (is it because it is not saving ‘Polish’ I select, that then ‘No untranslated term’ shows on any English category???)

    I remember I had a similar issue on the test site and then suddenly these drop-downs where I could select matching translated category showed up. From then on I could match all categories/tags. I do not recall what I did to get to that point though.

    Any ideas?
    Your help will be much appreciated,
    Pete

    Thread Starter TheElear

    (@peterpap)

    Thread Starter TheElear

    (@peterpap)

    ok. In order to sort and format custom field alphabetically as below:
    Angle: 30 degrees
    Birthday: 124
    Education: higher
    Key3: whatever

    I have used the following code in the loop.php:

    <div class="pprow">
    <?php $myid = $post->ID; 
    
    $data = $wpdb->get_results("
    SELECT * FROM $wpdb->postmeta WHERE post_id = $myid
    AND meta_key NOT LIKE '\_%'
    ORDER by meta_key ASC
    ");
    
    	if( !empty( $data ) ) {
    		foreach( $data as $result_object ) {
    			print '<div class="ppmeta-key">';
    			print $result_object->meta_key;
    			print ': ';
    			print '</div><div class="ppmeta-value">';
    			print $result_object->meta_value;
    			print '</div>';
    			print '<br />';
    						}
    				}
    	?>
    	</div><!-- .pprow -->

    and the following styling in .css:

    .pprow {
    	margin-bottom: 24px;
    	}
    
    .ppmeta-key {
    	font-weight: bold;
    	margin: 0px;
    	display: inline
    	}
    
    .ppmeta-value {
    	list-style: none;
    	font-weight: normal;
    	padding: 0px;
    	margin: 0px;
    	display: inline
    	}

    many thanks to all who provided earlier input on this topic

    regards,

    Thread Starter TheElear

    (@peterpap)

    wow! I have some results.

    I studied these 2 threads:
    1 https://www.ads-software.com/support/topic/how-to-sort-custom-fields-alphabetically-by-key
    2 https://www.ads-software.com/support/topic/sort-custom-fields-after-meta_id-not-randomly

    I could not make in my twenty ten child the 1st work. So started to look into number 2.

    And got some results.

    The original code is:

    <?php $myid = $post->ID; // Assign this using a variable, or however you were before, eg. $post->ID
    
    $data = $wpdb->get_results("
    SELECT * FROM $wpdb->postmeta WHERE post_id = $myid
    AND meta_key NOT LIKE '\_%'
    AND meta_key NOT IN('cycle','pdf','youtube','underrubrik')
    ORDER by meta_id ASC
    ");
    
    if( !empty( $data ) ) {
    	foreach( $data as $result_object ) {
    		print $result_object->meta_id;
    		print '<br />';
    		print $result_object->post_id;
    		print '<br />';
    		print $result_object->meta_key;
    		print '<br />';
    		print $result_object->meta_value;
    		print '<hr />';
    	}
    }
    ?>

    As I only want meta_key followed by meta_value e.g.:
    Date: 1973 I made some modifications, see below:

    <?php $myid = $post->ID; // Assign this using a variable, or however you were before, eg. $post->ID
    
    $data = $wpdb->get_results("
    SELECT * FROM $wpdb->postmeta WHERE post_id = $myid
    AND meta_key NOT LIKE '\_%'
    ORDER by meta_key ASC
    ");
    
    	if( !empty( $data ) ) {
    		foreach( $data as $result_object ) {
    			print $result_object->meta_key;
    			print ': ';
    			print $result_object->meta_value;
    			print '<br />';
    					}
    				}
    		?>

    and it WORKS!
    See my test page here: https://coelo.eu/category/test-category-1/

    I strugle however to apply formatting. In the thread no 2, mentioned above, a user adds <div> tags to change her formatting.
    I already have styles defined for both the key and the value in my .css. However when I added div’s I just cannot make it work. My classes are as follows:

    .post-meta {list-style: none; font-weight: normal; padding: 0px; margin: 0px;}
    .post-meta-key {font-weight: bold; margin: 0px;}

    Any ideas how to modify this:

    print $result_object->meta_key;
    print ': ';
    print $result_object->meta_value;
    print '<br />';

    so it looks like that:
    Date: 1973
    Education: blablabla

    I am so glad I made some progress on it!
    Now just to finish it off ??

    Thread Starter TheElear

    (@peterpap)

    just to confirm that this does the trick.
    Exactly what I needed.

    Many thanks

    Thread Starter TheElear

    (@peterpap)

    Many thanks guys, I will definitely try that!
    And come back with the feedback.

    Thread Starter TheElear

    (@peterpap)

    Thanks alchmyth. It works.

    I also found that ‘-1’ instructs to show all posts, but can be changed to whatever number of posts one wants to have displayed. So for example if I want to have 5 posts per page then the code will read:
    &posts_per_page=5. Navigation is then automatically added back.

    many thanks,

    Thread Starter TheElear

    (@peterpap)

    Silly!!!!

    You can translate it in Settings/Languages/String Translations

    regards to all

    Thread Starter TheElear

    (@peterpap)

    Many thanks. Works like a dream!

    Thread Starter TheElear

    (@peterpap)

    Chouby, thank you very much both for the advise and for making this plugin. I just cannot believe how simple it is yet does the job so brilliantly!

    I have just noticed that widget labels are translated automatically!!!

    However the category page title/label which reads in English “Category Archives:” and then displays the particular category name is not translated in to the other language. Same with meta texts e.g “Posted in”, “Posted by”, “Tagged”, etc. What changes should I make for this to be translated? (thought it would be a short post but the more I use the plugin the more questions pop up ?? )

    Thread Starter TheElear

    (@peterpap)

    Many thanks Chouby. This is very helpful.
    I already use child themes.

    Would you know how to move the flags to the page title bar?

    REGARDS,

    Thread Starter TheElear

    (@peterpap)

    OK, so I put Polylang on the fresh WP 3.1.1 installation and I found I had 2 issues present:

    1. One as described above – language switcher flags disappear on a page which is a post category page. It works fine on stand alone pages.

    2. In WP dashboard when I add a new post, when I want to select which categories it belongs to in a ‘category widget’ I cannot see any categories even though there are categories set up in the WP.
    This is true for posts added after installing Polylang. When I edit posts added before Polylang installation, which had categories added before I can still see the full list of available categories.

    THe above problems no 1 and no 2 were the result of relevant categories in different languages not matched! Once I matched/translated categories all works brilliantly!

    One more question then:
    How to make switcher flags align to the right edge of the nav menu.
    They are currently just after the last menu item but I would like them to be on the right hand side.

    Any help will be much appreciated.

    regards,
    Pete

    Thread Starter TheElear

    (@peterpap)

    I did set language for all categories.

    I will prepare a clean test environment to get rid of all other multilingual plugin remains and test it again. I will then post my findings here.

    speak soon,
    P

    Thread Starter TheElear

    (@peterpap)

    Hello Chouby,

    I use twentyten.
    Link to the test site: coelo.eu

    Quiet possibly the reason might be that I installed and tested xili, qtranslate on the same site/wp installation before. So perhaps these other sites messed sth up?

    After checking all other plugins I wanted to go ahead with polyang as it is simple, light and does the job but came accross the above mentioned issue.

    Another question is: Is it possible to have a static page as the Home page. You specify this page in Dashboard settings/Reading. Obviosly you can specify only one (in one language)……..

    Peter

    Thread Starter TheElear

    (@peterpap)

    Many thanks Christine.

    Peter

Viewing 15 replies - 31 through 45 (of 46 total)