Preface:###
I quickly completed the website building in 10 days of fragmented time in March, with 95% of the backend work handed over to WP (WordPress). If you want to be lazy, WP is an excellent choice,估计 it should be done in about half a day.
Want to have your own little garden, but don't know things like PHP, don't understand CSS well, and know very little about HTML? It doesn't matter, CMS + frontend framework, just a little while, there's really very little that needs your own hands-on work.
P.S. Haven't had time to release the website building series, today I was angered by WP, almost rebuilt everything from scratch, so I have to write down the things I used first, to avoid looking for them again in the future
1. Website Building Conditions##
First, you need some hardware things:
-
Server space: The cheapest way is to use SAE or other "free" space; an economical way is to rent a virtual host; well, a more money-hurting way is to rent a cloud server. Just choose one of the three, depending on your wallet.
-
Domain name: Renting space usually gives you a free domain name, but you definitely won't like it. You can find a free one, such as .tk, etc.; or spend a little money to rent a domain name, .com/.cn/.net, etc. are all very cheap, the key is it looks comfortable.
-
Domain certificate: This is the so-called "filing" (beian), if it's a free domain name you definitely don't need to be so troublesome, but your own rented domain name needs filing, with it you're "legal". Generally domain providers will give a filing guide, you just need to run some errands, take photos and mail them over.
-
FTP tool: Install an FTP tool, then you can put things into your own space
Of course, if you want to make the website to your satisfaction, you also need some knowledge and skills: HTML, CSS, JavaScript, PHP/ASP and other server-side languages, SEO/semantic and other common sense
My configuration: 88/year 150M virtual host + 55/year .net domain + FileZilla
2. Solution Selection##
With hardware conditions met, don't rush to write HTML yet, let's choose a solution
Backend:
If you have enough time and energy, and your skill tree is quite broad, you can consider building the backend yourself: database design + layered design + PHP/ASP coding implementation
If time is limited, or you haven't learned many skills, you can use CMS, better ones include:
- WordPress, said to have very good SEO, massive templates, pseudo-static pages
- DedeCMS, said to be simple and easy to get started, true static pages, and, the name sounds good
- EmpireCMS, harder to get started than DedeCMS, but said to be more powerful
P.S. CMS is a tool that helps you manage the backend, supports basic publishing, querying, modifying, deleting information, and has RSS generation, automatic semantic/SEO and other benefits, with it, basic worries are gone
Frontend:
If CSS experience is not very rich, you can consider choosing a frontend framework, such as:
- Bootstrap, very powerful responsive layout, of course because it's responsive, it doesn't support [IE7-]
- YUI, full browser compatibility, very complete and powerful but also very "heavy"
- EasyUI, full browser compatibility, "lighter" than YUI
You can easily build good-looking pages with these frameworks, if you have CSS foundation, or want to exercise page design ability, it's better to make it yourself, may not look good, but looks comfortable to you
My solution: WordPress + JQuery
3. Quick Website Building##
- First step, test server space
Upload a simple html or php/asp file using FTP tool, try to access it. Of course, if the domain name is not yet bound to the space, you need to bind it first. Generally there won't be problems, if there are problems go to the seller's customer service to argue, they will help you fix it.
- Second step: Install CMS
Upload the CMS downloaded locally to the server, then follow the CMS guide to install step by step, must ensure this process has no errors
- Third step: Enter CMS backend management
Log into CMS backend, write something casually, add a page, post an article, etc., try the CMS functions
4. WordPress Related Issues##
1. How to show only excerpts on the homepage?###
WP defaults to showing full text on the homepage, one or two articles is okay, but when there are many articles it's unbearable, a very very long scroll bar, doesn't look comfortable. You can show only excerpts, specific method as follows:
-
Enter backend management page/Appearance/Edit
-
Find content.php in the right list, click and you can edit online (online says to change index.php, doesn't work in new versions)
-
Ctrl + F search "entry-content", change the code inside this div to:
<?php //comment in chinese is invalid if(!is_single()){ the_excerpt(); } else{ the_content(__('(more…)')); } ?>
Note the before and after, don't lose them, you can backup the content in the text box first, in case of accidents
2. How to modify the WordPress little tail in the footer?###
Generally there will be little tails like "Proudly powered by WordPress", "Another WordPress site", etc., can be easily modified:
-
Same as above
-
footer.php
-
Search "" to your own footer, after modification it might look like this:
<a href="<?php echo esc_url( __( 'http://wordpress.org/', 'twentytwelve' ) ); ?>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentytwelve' ); ?>">Powered by WordPress</a>
The header modification method is the same, just look in header.php
3. How to use Markdown?###
Markdown is a good thing, WP doesn't have native support, but you can find plugins, backend management/Plugins/Install Plugins, search and there's a bunch, pick one based on popularity
4. How to filter malicious comments?###
You can input js scripts in the comment box, this is very unscientific, but it's said WP comes with script filtering, but by default doesn't use it for administrators, we can enable script filtering ourselves:
-
Backend management/Appearance/Edit/functions.php
-
Insert code below the first block of comments:
/*comment filter*/ function code_escape( $incoming_comment ) { $incoming_comment = strip_tags($incoming_comment, ENT_QUOTES);//filter php, html and xml tabs return $incoming_comment; } add_filter( 'comment_text', 'code_escape' ); add_filter( 'comment_text_rss', 'code_escape' );
This way you can filter scripts, for example if you input comment, , after submission it will become XSS attack text
5. How to synchronize updates to Weibo, WeChat?###
Seniors gave a solution, very useful. Of course, this solution is an idea, not limited to solving sharing problems, can also be used to update custom pages, such as synchronously updating a certain file in a certain corner when publishing blog posts, very good
P.S. Just completed the calendar synchronization update function today, example please see Ayqy top left corner
6. Issues to note###
-
When modifying php files, never download-modify-upload, try to edit directly online, because after downloading and editing locally strange encoding problems may occur, BOM symbols, etc.
-
The modified code cannot have Chinese comments, because it will cause errors, adding a Chinese comment casually to fonctions.php immediately causes errors, and WP's error reporting is useless, struggled for a day, finally chose to delete and start over
-
Before modifying files, suggest must backup first, leave a way out, otherwise you'll be angry and sad
Afterword###
These are the simple website building related contents, currently still modifying, actually use relatively few WP functions, also at a half-understanding stage with WP, will introduce other functions and more solutions after exploring and becoming familiar
No comments yet. Be the first to share your thoughts.