« first day (2609 days earlier)      last day (312 days later) » 

10:36 AM
I use Understrap to create themes for resell. Still sometimes it takes lot of time to develop themes because Understrap comes with very very very basic styles.

Is there any more advanced Bootstrap or non-bootsrap WordPress starter theme which allow me to create themes and resell?

I am looking a starter themes which comes with at least some basic styles for default widgets, nice looking archive pages, etc.
 
 
2 hours later…
12:59 PM
@kraftner Hello :D I asked you about twig in "use __($str) to translate strings (symfony/twig)" I never used that chat before so I don't really know what you mean with pinging
 
Hi. I meant what you just did. :)
 
Okey :D thanks for your help I'm really interested about the problems with twig and wp
 
Okay so I have played with Twig in WP myself. There are already various implementations (e.g. https://github.com/timber/timber or https://github.com/Rarst/meadow) all with their various advantages and disadvantages.
It really depends on what you are building...
 
Ah so you did not implement it on your own?
 
That too. Generally I investigated and gave up on the idea. But let me elaborate:
1. If you are using Twig to completely separate "Controllers" that prepare data and Twig really only assembles that this practically not doable with WP. A lot of WP core functions behave differently depending on when you call them. Some also shouldn't be run multiple times. (Which e.g. practically kills template inheritance in Twig)
So you can't easily run them before you're in the template. So you need a lot of Twig helpers (like the one you created) that pierce through the abstraction Twig is made to offer. Which kills all but one advantage over PHP templates: You might just like the format/style of Twig.
This isn't worth the hassle if you ask me.
2.Then comes interoperability with Plugins and the wider WP ecosystem. E.g. by using Twig you are most probably bypassing the WP template hierarchy developer.wordpress.org/themes/basics/template-hierarchy which will cause all kind of compatibility issues with 3rd party code/plugins.
 
1:12 PM
I see, well since I'm not using other plugins or anything like that (I build all the things on my own) and since I'm not using any wordpress functions except to get the current user id I'm fine with that

To be honest I bypassed nearly the entire system and created my custom made framework on top of it^^"
 
3. As you have experienced a lot of the tooling also doesn't play to well with twig. For example various tools parse templates to extract strings for i18n which they won't detect in Twig unless you roll your own solution as well.
Okay, then why are you using WP at all instead of building a plain Symfony application?
I mean launching WP and then using nothing of it is quite a waste. You're site/application will be tremendously slower if it needs to init WP on each request. WP doesn't do any lazyloading so it always initializes the whole thing even if you only use the user part.
 
Like I said, we usually build pages with Craft CMS in our company and I use Yii2, Laravel and the Zend frameworks for many other things, but this time a customer forced us to use WP because he think it's the best CMS and he does not want to learn anything else. So I just copied my custom framework I made some time ago into Wordpress.. I wanted to use the default translator but it did not work
So I deactivated most of WP functions (routing and all of that stuff - a friend told me how to do it) and just used the WP interface
it was much faster than getting used to WP... At least I was able to build the page really fast since I already had all tools I needed
I know this is not the purpose of WP but damn compared to most other systems it really sucked. Every one in my company told me I'm going to hate it because it does not provide the functionality I'm used to and does many things in a strange way. That's why I did what I did. There are many pages/tutorials how to bypass WP when you have customers who want to use it
 
As already said, even if you abort the routing you're still loading most of WP. Also I personally wouldn't feel comfortable selling something that only masquerades as WP if that is what the client requested. What would you say if you ordered a Symfony application and then what you get is something where the only Symfony thing is a Proxy that forwards all requests to a binary because I feel more comfortable writing Go?
If you want the UI of WP but want to have your own routing, templating and so on I'd recommend looking into the REST API WP offers. Or directly work with the DB. Or just don't use WP at all. I think what you're doing gets you the worst of both worlds.
 
I know you are right and usually I would agree with you, but originally WP was made for blogs as far as I know and not for shops and such
 
But hey, who am I to tell you what to do. ;)
 
1:27 PM
Like I said, I know, I would not do that usually and if it was just for a simple blog I had not done it. But creating a complex shop sounded like real pain
 
Yes, just like PHP originally meant "Personal Home Page Tools" and wasn't meant for anything it does nowadays. Also if you think WP is unfit for the project you shouldn't use it and explain that to the client. But I won't get into that discussion. Let's get back to your actual issue at hand.
I am 99% sure the breakdown of your approach is an issue with tooling and not the feature of WP itself. What you need is:
1. A tool that extracts strings from your Twig templates and creates a *.pot file from it.
2. Properly load the translation into WP.
 
Well.. It might be faster to use my custom translator then
Because I was not able to make the pot file work
 
You mean 1 or 2?
 
I've not started with the first part but when I create a pot file per hand it is ignored by wp
But I don't know anything about pot files. I never used them
 
Okay first you need to save it with e.g. Poedit so you get *.po and *.mo files.
Then you need to load that file.
And then you'll need Twig helpers for all i18n functions, not just __
 
1:36 PM
I did the first two things but even the echo __("test".... did not work like I stated in my thread
 
I don't see anything about loading the translation in your question.
 
Isn't that the first answer? Or what do you mean with loading?
Yes that was the first answer after your comment and I did that afterwards
WP seems to recognize the file because I was able to output it
 
With the correct text domain as defined in the plugin header? developer.wordpress.org/plugins/internationalization/…
 
I did not set a text domain^^"
I just used the same wording like the plugin
 
Does it work if you set it?
 
1:43 PM
nope
echo __("test", 'cardio');die(); prints just test and not Foo
 
You do have the site/user language set to german in your case, right?
 
I don't know
The backend is german so I guess yes?
My customer gave me the project and said go for it.... I changed nothing and configurated nothing
 
Okay sorry, I'm out of ideas without seeing it and I should get back to my work now. But maybe someone else has an idea, this should work.
 
Okay, thanks for your time :D
 
I had some issues with this too but the chat is too long to read... Could you summarize the issue please?
 
1:53 PM
@JackJohansson It is based on this question wordpress.stackexchange.com/questions/287988/… I can't bring WP to translate my strings
even without using twig just a normal echo __("test".... only prints test and not the translated value
 
I assume you have included the language file by load_plugin_textdomain?
 
Yes I did that
and it is loaded successful
 
So no matter if you set both site and user language to German, you still can't get it to translate?
 
Oh, one more idea. You probably load the translation on the plugins_loaded hook. When do you call __()? Maybe you are too early?
 
Also, you can't use variables in your translation function
__($string,'text-domain'); will not work.
 
2:00 PM
Technically you can, it is just really, really bad practice and breaks the parser for pot files
But Robin doesn't generally seem to care about doing it the WP way, so... ;)
 
There was a long discussion about this, and it turned out not to be working. I myself couldn't get it to work though
 
@kraftner I know you don't like my way :P I call it currently right after the add_action( 'plugins_loaded', 'cardio_load_textdomain' );
@JackJohansson If I can't do that it's useless to begin with because I use twig so it does not work the other way
Seems like I'm not the only one with this problem wordpress.stackexchange.com/questions/215297/…
 
Ah okay that might be it. Try wrapping your call like this
add_action( 'plugins_loaded', function(){ echo __("test", 'cardio');die(); }, 11 );
 
outputs just test like before
maybe I did a mistake in creating the pot file.. does it have to be created in a special way?
 
Not if you follow here
 
2:11 PM
Do you have xdebug or some other debugger in your setup? You can have a look into /wp-includes/l10n.php
 
I would just simply start a new plugin and implement stuffs again, see when does the code stop working
 
there is no "Click File -> New Catalog" in my poedit only new
I use xdebug I'll try that if creating the pot file does not work. Until now I just created a new file with Notepad++ and insert msgid "test"
msgstr "Fooo" in it
Or I downloaded existing po files and changed them
 
2:53 PM
@IamtheMostStupidPerson Honestly, if I were you ... I would just Bootstrap ... Make a parent theme with the basics. Including: any repetitive PHP functions, JS, CSS, Images, etc. Then each new project you get, make a child theme. Each new child theme you make, you can improve the parent theme, thus making it faster and easier to pump out new child themes as time goes on.
 
 
4 hours later…
6:30 PM
Can anyone provide some insight on performing multiple repetitious tasks, so that PHP doesn't timeout? Example: importing data.
 
7:09 PM
If it's a one time import I like $_GET paging.
 
7:30 PM
Hmm, good idea
 

« first day (2609 days earlier)      last day (312 days later) »