Forum Replies Created

Viewing 13 replies - 1 through 13 (of 13 total)
  • Thread Starter marcreig

    (@marcreig)

    Thank you!

    But I’ve finally decided to create a different way. I was waitting to your answer to see if there was a simply way to do that. As it required programming, I’ve done this:

    <div class="languages">
    	<ul>
    		<?php
    			$languages = pll_the_languages(array('echo'=>0));
    			echo preg_replace_callback('/(<a.+>)([^<]+)(<\/a>)/i', function($m){
    				return $m[1].pll__($m[2]).$m[3];
    			}, $languages);
    		?>
    	</ul>
    </div>

    And I’ve created the words “English” and “Espa?ol” in functions.php, and added the translations in Admin board.

    ??

    Thread Starter marcreig

    (@marcreig)

    Thanks god!

    Polylang 1.1 & it’s widget group removing feature on Administration Panel, solved the problem!! Now everything runs fine!

    Thank you so much for all your efforts and attention! ??

    ‘Til next time!

    Thread Starter marcreig

    (@marcreig)

    Oh, I’ve forgot to say, that what Black Studio TinyMCE Widget had, was a HTML rich text strings inside, so maybe there is a problem with codification and bad quotes escape on reading from DB on the plugin?

    As the data is propperly inside the DB, but it doesn’t show on Admin Settings page, I think this could be a problem based on the reading/escaping quotes from DB in the plugin behavior’s.

    Could it be?

    Thread Starter marcreig

    (@marcreig)

    Ok.
    I’ve seen what could be the problem:

    – I’ve installed Black Studio Widget, and this guy added automatically a lot of strings on “Strings Translate” page on Settings.

    Those strings get imported correctly on the file, but they don’t show on the panel when imported on Localhost! There only appears the normal strings (functions.php ones + the exsiting ones on Polylang).

    So in localhost, if I modify some of the strings and Save, suddenly the DB gets cleaned and only appears the visible strings, deletting the black studio ones from DB (as I said, those were on the DB, but they didn’t show on the administration panel!). From now on, everything works fine.

    So I need to delete those strings from this page, but this is not possible. Those are “ghost strings” that are not propperly shown on panel, but they exists inside wp_options on polylang records! As so, cleanning DB it’s not useful!

    I’ve tried to do it manually agains DB record. It’s not useful, because when you save on Polylang, indexes on JSON string got rewritted, as I’ve seen.

    So this is a dead end!

    On the remote host I SEE those strings on administration panel.
    I’ve emptyned’em and tried to save cleaning the DB. Stills not useful.
    Even deactivated the widget, and uninstalled it.
    Nothing!

    How do I proceed?

    Thread Starter marcreig

    (@marcreig)

    As it’s a FULL exporting of a DB, from PHPMyAdmin on my online host, and then an import from this very same file to localhost via Navicat software, it’s should be obvious that they are.

    And yes, they are!

    WP_TERM:

    localhost: https://i.imgur.com/StOAZWP.png
    online: https://i.imgur.com/mTB6vZx.png

    WP_OPTIONS:

    localhost: https://i.imgur.com/yxiVHUY.png
    online: https://i.imgur.com/oSULSRm.png

    So I encourage you to test it by yourself if you can, please!

    I really need to know how to solve this, as if anything happens someday, I’ll need a DB copy, and with this, we really have a problem!

    Just EXPORT a DB from an online host WP you have with Polylang, and simply import the DB copy from a local WP copy you have. Just watch! ??

    Thread Starter marcreig

    (@marcreig)

    Well, so it happens!
    Cause in OPTIONS table I’ve the correctly imported registers, as you can see (this is an screenshot from localhost! After importing! And the registers are allright, with the right translations):

    View post on imgur.com

    And the translations are inside the DB, with no problems at all, they’re correct.

    BUT, they don’t show on Admin page and of course, they don’t load, as in Admin page, only var_names are loaded.
    Look:

    – What should be on localhost AFTER importing via .SQL executing against DB (this is a screenshot form the online version, the right one):

    https://i.imgur.com/8IlKGxC.png

    – What on localhost really is AFTER executing the .SQL file (after importing). This is a screenshot from the local version after the import. The BAD one:

    View post on imgur.com

    And as I said, I’ve done nothing more than simply executing an IMPORT on Navicat or in PHPMyAdmin from a previously EXPORTED file from the online host!

    Any idea?

    marcreig

    (@marcreig)

    Ok, let’s see:

    – I’m developing on localhost. And it is NOT working on localhost.
    – I’ve created the APP on tweeter, wrote the real .org domains on fields, even callback URL, and saved everything.
    – Then I’ve authorized app on same twitter details page, and everything show fine now.

    View post on imgur.com

    – Then authorized localhost on @anywhere domains like this:

    View post on imgur.com

    as twitter doesn’t like “localhost”.

    So everything is fine, isn’t it?

    – So everything OK on WP, on plugin settings page, but still having to authorize the app there, so when I press the button, I got this:

    View post on imgur.com

    Is this because localhost?

    Don’t know what to do… ??

    Thread Starter marcreig

    (@marcreig)

    It’s over! ??

    It was the update what resolved it!

    Thread Starter marcreig

    (@marcreig)

    Hey!
    Anything new?

    As I said, I’ve made no modification to original theme.
    Just functions.php with the function to be called and the call on a site.js. That’s it.

    Oh and for if it’s useful, I’ve this over the function:

    add_action( 'wp_ajax_nopriv_loadMorePosts', '_loadMorePosts' );
    add_action( 'wp_ajax_loadMorePosts', '_loadMorePosts' );

    edit:

    Oh wow man! I’ve recently seen that there was a new Polylang update! And you know what? Now it works!! No more PHP error there! :_)
    Thanks man! Don’t know what you’ve resolved (I guess file dependencies on load time…) but now it works wonderfully! ??

    Thread Starter marcreig

    (@marcreig)

    Nop.
    I’ve modified nothing at all…
    I’ve just made a JS file with the respective jQuery $.post(…) call, with some data which I’ve showed you before, and that’s it!
    On functions.php, I’ve the function which does the WP_Query call and it’s over!

    ??

    Thread Starter marcreig

    (@marcreig)

    https://viewportindustries.com/products/starkers/

    I’ve changed nothing. I’ve created my index and whatever… but I’ve not modified anything in general.

    So you try! ??

    Thanks!

    Thread Starter marcreig

    (@marcreig)

    Well, yes. I’ve used the STARKERS empty (blank base) theme, to do and create my own theme. From very scratch.

    So everything is ok, I think so.

    So right now, what should I do?
    I mean, can I recieve translated posts or not?

    Will you publish the update without being a development unit, soon?

    Thanks.

    Thread Starter marcreig

    (@marcreig)

    Well then, I’ve done this:

    1) Changed option to number 2, which is appending the language on every single URL.
    Nothing changed. Keep recieving block in English when I’m working in Spanish on web’s home.

    2) On AJAX request, I’ve added on data block for the POST request the variable “pll_load_front”.
    And I’ve tried like this:

    `$.post(AdminAjax.ajaxurl, { action: “loadMorePosts”, cont: cont, ptype: ptype, pclass: pclass, offset: offset, pll_load_front: true }).done(function(data) {
    //alert(“Data Loaded: ” + data);
    button.remove();
    $(“.loadmorepostsimg”).remove();

    $(“.”+cont).append(data);
    });

    And I’ve tried like “pll_load_front: ‘pll_load_front'” too.
    Nothing happened.

    Keep recieving in both cases texts in english.

    So, could you explain me the exact steps I should take to make it work please?

    Thank you so much! ??

    —————————–

    EDIT:

    Since I’ve added on ajax request pll_load_front: 1, now when I push the button to load more posts, I get this error:

    Fatal error: Call to undefined method Polylang_Core::register_string() in …….

    So I guess that adding pll_load_front: 1 has done something at last (I’ve cleared the cache to see that it was really doing something). But now, it works no more. If I remove pll_load_front: 1, then everything works normally.

    Thanks!

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