I am about to write some posts which has some Java code, and I would like to format it properly by coloring the Java keywords. Like in Eclipse.
I am looking for some recommendation for a theme / plugin to use.
It looks like it's rather standard nowadays:
[code language="css"]
Your code here
[/code]
As described here by WordPress itself.
The Chili code formatter is a good WordPress plugin to do that.
Alternative link: WP Chili
You could have some other plugins with this page or this other one.
However, it has not been updated for since 2010. Maybe you should use much recent one like the WP Code plugin.
It seems new versions of WordPress have already included the support of code posting. It is very interesting for me too, LOL.
Related
This Gutenberg update looks sweet, but it's immediately frustrating trying to follow any of the documentation.
I started with the very simple looking tutorial that is the first result on Google. It has code that looks to make sense for what I'm trying to do here. Great.
Except it says nothing about where to put this code to make it work.
Other tutorials are all about "download our plugin and we'll create one for you" - but I don't want to add that huge nest of code when what I'm really looking for is a fairly simple static block of code I can have users drop into a page.
Back in the day we'd just register a short code in the functions.php file and call it a day.
Can someone explain to me:
Where to put this registration code?
Where to put this JS code it references?
If I'm somehow going about this with a huge misunderstanding of how Gutenberg works?
Thanks
To actually solve this properly would need a couple of chapters of a book... but here's the very condensed answer.
Taking a very quick look at the link you shared, the code should be put in a plugin as there are calls to the function plugins_url(). So you need to first create a plugin. It's not difficult to build a simple plugin but it does take a bit of time getting used to how things need to be registered and how everything is glued together (that's why I said that a proper answer would take a couple of chapters of a book :D).
Once you have the plugin, the code should be within the plugin (or in any PHP file that is included by the plugin) and the JS file should go inside the plugin directory in a folder called step-01
There's a git repo from WordPress with some Gutenberg examples. I haven't looked to hard at them, but It might be a good idea to follow the code in there with the tutorial of how to build a plugin (and the WordPress code reference site opened too :D). If you are going to be developing things for WP, I recommend you to get Zeal or Dash to be able to browse the documentation in an easy and fast way.
Edit
I just found that you can create the scaffolding with wp cli. Wordpress has a tutorial on how to use the wp scaffold block command here.
I'm looking for a WordPress Plugin, or any other way to display ELM code in my blog. I tried to use Crayon, but since it has no special support for elm, the code is colored wrong.
How can I do so?
This https://runelm.io/new provides a way to embed runnable snippets of Elm code on an Elm website. I don't know how easy to do this is because I haven't tested it but the example they give looks promising.
so.. I am trying out Adobe Brackets as my editor right now and I really like it so far, but there is one thing I am missing and I wonder if there is an extension for that..
I mainly code php, css and javascript for wordpress themes / plugins etc. I was using sublime 3 before, where I had a plugin that, if I type a wordpress function name and use the autocomplete, automatically inserts the parameters of that function. So in sublime it looks like this http://i.imgur.com/FxxUOy8.png
In Adobe Brackets I tried every wordpress extension that I found but I cant get the same result. The hints for wordpress functions do work but when I accept a hint it wont insert the parameters of that function http://i.imgur.com/25HsuSe.png
So I wondered if anyone knows an extension that offers autocompletion like in the sublime screenshot. Or am I missing sth else to get that?
Thanks in advance!
I haven't yet installed this, but I came across it today and will be trying it out myself. It's an extension for Brackets called "Brackets WordPress Hint". It looks like the repository hasn't been contributed to in a while, but I haven't (yet) found anything newer.
https://github.com/Tusko/brackets-wp-hint
I've been tasked with modifying the frond end of a Wordpress site, which is something I have not done before. I was first thinking of using Handlebars an Bootstrap, but I'm not even sure that will even work with the Wordpress framework.
If those don't work, what would be a good way to create a nice UI for the Wordpress site? Is creating my own theme a viable option? What tools am I even available to use?
Thank you.
Some of my favorite starter themes are:
http://themble.com/bones/ and http://underscores.me/
You can also look at frameworks like:
http://themeshaper.com/thematic/ or http://my.studiopress.com/themes/genesis/
I've used AngularJS with WordPress in the past, so I don't see why you wouldn't be able to use Handlebars (I haven't done it myself, but if you search, I'm sure you'll find some help there).
If you still want to use Bootstrap, there some tutorials on how to integrate it: http://digitalfellows.commons.gc.cuny.edu/2013/11/18/learn-bootstrap-part-2-adding-bootstrap-to-wordpress/
I'd like to implement a 'stackoverflow' type answer and question for my wordpress blog. Any suggestions?
If you aim to provide a service such as this you should be able to code it yourself.
Check the following sites for information on where to start:
Writing a Plugin
WP Tutorial: Your First WP
Plugin
How to Write a WordPress Plugin – Introduction
Create a Custom WordPress Plugin From Scratch
Anatomy of a WordPress Plugin
If, by some reason you want to use a pre-written plugin I found one called UnAnswered that, according to the maker allows you to have a similar functionality to the one you are after. You should be able to customize it to your needs and likes.
I just released a plugin + theme that does the job : http://wp-answers.com/
I am using AnsPress, http://wordpress.org/plugins/anspress
Demo: http://open-wp.com/
This plugin is actively developed and have many cool features. I use this plugin on my site and its very easy.
I also love the support by its developer, he respond very fast and try to solve any issue I have.
I have this plugin if you are interested..
http://www.sabaidiscuss.com/
demo here: http://demo.sabaidiscuss.com/
You can use Sabai-Discuss plugin by onokazu. I like it.
Also there is Wpmu-dev's Q&A Plugin which is quite similar.