Monday, August 24, 2020

How to Edit Your WordPress Site

Editing the content in your WordPress site is important if you want to keep it up to date and make sure it stays fresh. It’s also useful if you publish a post or page then realise that there’s a typo or you want to change something like an image or a link.

In this quick guide, I’ll show you how to edit the posts and pages in your WordPress site as well as how to edit your WordPress widgets and navigation menu.

If you want to learn how to make a WordPress site from A to Z, be sure to check out our complete guide.

You can also learn how to use WordPress with our free online course.

 

How to Edit Pages and Posts in WordPress

Editing posts and pages is the most common type of editing you're likely to do. There are two ways to access your posts and pages to edit them: via the admin screens and via the toolbar.

Accessing Posts and Pages via the WordPress Admin Menu

Open your WordPress admin screens and click the Posts link in the left hand menu. This opens the post listing screen, showing all of your published posts. To edit a page, do the same but click the Pages link in the menu.

post listing screen

Find the post you want to edit and click on the post title or hover over it and click on the Edit link beneath it.

This will open the post editing screen.

Accessing Posts and Pages via the Admin Toolbar

Another way to get to your post or page is via the admin toolbar that you’ll find at the top of the screen when you’re logged in.

admin toolbar

You can see this when you’re on your live site, as long as you’ve logged in. Navigate to the post or page you want to edit and click the Edit Post or Edit Page link in the toolbar. This will open the post or page editing screen. 

Editing Your Post or Page

You’re now in the post or page editing screen, where you can edit your content.

post editing screen

Now find the part of the post you want to edit. Maybe you want to correct a typo in your text. Or you want to add a new image, or turn a block into another kind of block.

To edit text, just click where you want to make the edits and start typing. Changing blocks is a little more complicated (but not much).

Adding a New Block

If you want to add a new block in the middle of your post, just hover over the bottom of the block above it and then click the plus icon.

adding a new block

Now choose the type of block you want and start creating it.

Alternatively you can just click at the end of a text block and hit the Return key on your keyboard to create a new block below it. By default this will be a paragraph block, but you can change it by typing a forward slash (/) to bring up a shortcut menu with the block types you use the most.

shortcut to choosing blocks

Choose the block type you want then add your content to it.

Changing a Block’s Type

If you already have content in your post but want to change the type of block it’s in, just select the block and click on the Transform to icon at the top left of the block.

changing block type

The type of block you can change a block to will depend on what type of block it is to start with. For example you can change a text block to another kind of text block but not to an image block. If you wanted to do that, you’d have to create a new block.

Saving Your Edits

Once you’ve made your changes, don’t forget to save them. Click the Update button at the top right of the screen to save your edits.

How to Edit Other Content in Your WordPress Site

Posts and pages aren’t the only thing you might need to edit in your site. You can also edit your widgets and menus.

Editing Widgets

To edit your widgets or swap them for different ones, go to Appearance > Widgets in the admin menu, or open the Customizer and select the Widgets option.

widgets screen

Here you can move widgets around by dragging them between widget areas. You can also delete widgets and replace them with new ones by dragging them over from the left hand side.

Editing the Navigation Menu

To edit your navigation menu, go to Appearance > Menus or open the Customizer and select Menus.

Menus screen

Select the menu you want to edit. Remove any links you don’t want or change their position in the menu by dragging them up and down. You can also drag them under another menu item to create multi-level menus.

To add a new page to your menu, select it in the Pages box on the left and click Add to Menu.

Summary

Editing your WordPress site is designed to be easy. You can edit your post and page content as well as your widgets and navigation menus. Follow this quick guide and you’ll be editing your site in no time.

You can learn a lot more about using WordPress here on Envato Tuts+. Stick around and check out some of our other tutorials and free courses.


by Rachel McCollin via Envato Tuts+ Code

Hencework

Hencework is a UI design & development agency from India. We create Premium Bootstrap Web Templates. We also help enterprises in designing innovative & intuitive custom dashboard interfaces. UI/UX design solutions tailored to your business.


by csreladm via CSSREEL | CSS Website Awards | World best websites | website design awards | CSS Gallery

Report: Facebook Is Piloting A Virality Kill Switch To Stop The Spread Of Misleading Information Across Its Platform

Facebook has been making efforts to tackle the spread of misleading information across its platform during the pandemic. From April to June of this year, the social media platform applied warning labels to nearly 98 million posts spreading misleading information about the coronavirus. The company...

[ This is a content summary only. Visit our website https://ift.tt/1b4YgHQ for full links, other content, and more! ]

by Arooj Ahmed via Digital Information World

Facebook's New Report Highlights Global Consumer Trends That'll Shape The Future

Last week, Facebook published new data which look at evolving trends during the coronavirus pandemic. The company analyzed internal data, commissioned surveys, and third-party research, and the reports are based on responses from more than 34K users. Facebook looked at the acceleration of already...

[ This is a content summary only. Visit our website https://ift.tt/1b4YgHQ for full links, other content, and more! ]

by Arooj Ahmed via Digital Information World

The Most Generous Companies and Individuals (infographic)

With charities relying on generous donations from both companies and individuals, it’s no wonder that the missions of some of the biggest companies and CEOs in the world is to donate to charity. Latona’s has analysed the most generous companies and individuals to reveal just how much they’ve...

[ This is a content summary only. Visit our website https://ift.tt/1b4YgHQ for full links, other content, and more! ]

by Web Desk via Digital Information World

How to Use Deno’s Built-in Tools

How to Use Deno’s Built-in Tools

One surprising difference between Deno and Node.js is the number of tools built into the runtime. Other than a Read-Eval-Print Loop (REPL) console, Node.js requires third-party modules to handle most indirect coding activities such as testing and linting. Deno provides almost everything you need out of the box.

Before we begin, a note. Deno is new! Use these tools with caution. Some may be unstable. Few have configuration options. Others may have undesirable side effects such as recursively processing every file in every subdirectory. It’s best to test tools from a dedicated project directory.

Install Deno

Install Deno on macOS or Linux using the following terminal command:

curl -fsSL https://deno.land/x/install/install.sh | sh

Or from Windows Powershell:

iwr https://deno.land/x/install/install.ps1 -useb | iex

Further installation options are provided in the Deno manual.

Enter deno --version to check installation has been successful. The version numbers for the V8 JavaScript engine, TypeScript compiler, and Deno itself are displayed.

Upgrade Deno

Upgrade Deno to the latest version with:

deno upgrade

Or upgrade to specific release such as v1.3.0:

deno upgrade --version 1.30.0

Most of the tools below are available in all versions, but later editions may have more features and bug fixes.

Deno Help

A list of tools and options can be viewed by entering:

deno help

Read-Eval-Print Loop (REPL)

Like Node.js, a REPL expression evaluation console can be accessed by entering deno in your terminal. Each expression you enter returns a result or undefined:

$ deno

Deno 1.3.0
exit using ctrl+d or close()
> const w = 'World';
undefined
> w
World
> console.log(`Hello ${w}!`);
Hello World!
undefined
> close()

$

Previously entered expressions can be re-entered by using the cursor keys to navigate through the expression history.

Dependency Inspector

A tree of all module dependencies can be viewed by entering deno info <module> where <module> is the path/URL to an entry script.

Consider the following lib.js library code with exported hello and sum functions:

// general library: lib.js

/**
 * return "Hello <name>!" string
 * @module lib
 * @param {string} name
 * @returns {string} Hello <name>!
 */
export function hello(name = 'Anonymous') {

  return `Hello ${ name.trim() }!`;

};

/**
 * Returns total of all arguments
 * @module lib
 * @param {...*} args
 * @returns {*} total
 */
export function sum(...args) {

  return [...args].reduce((a, b) => a + b);

}

These can be used from a main entry script, index.js, in the same directory:

// main entry script: index.js

// import lib.js modules
import { hello, sum } from './lib.js';

const
  spr = sum('Site', 'Point', '.com', ' ', 'reader'),
  add = sum(1, 2, 3);

// output
console.log( hello(spr) );
console.log( 'total:', add );

The result of running deno run ./index.js:

$ deno run ./index.js

Hello SitePoint.com reader!
total: 6

The dependencies used by index.js can be examined with deno info ./index.js:

$ deno info ./index.js

local: /home/deno/testing/index.js
type: JavaScript
deps:
file:///home/deno/testing/index.js
  └── file:///home/deno/testing/lib.js

Similarly, the dependencies required by any module URL can be examined, although be aware the module will be downloaded and cached locally on first use. For example:

$ deno info https://deno.land/std/hash/mod.ts

Download https://deno.land/std/hash/mod.ts
Download https://deno.land/std@0.65.0/hash/mod.ts
Download https://deno.land/std@0.65.0/hash/_wasm/hash.ts
Download https://deno.land/std@0.65.0/hash/hasher.ts
Download https://deno.land/std@0.65.0/hash/_wasm/wasm.js
Download https://deno.land/std@0.65.0/encoding/hex.ts
Download https://deno.land/std@0.65.0/encoding/base64.ts
deps:
https://deno.land/std/hash/mod.ts
  └─┬ https://deno.land/std@0.65.0/hash/_wasm/hash.ts
    ├─┬ https://deno.land/std@0.65.0/hash/_wasm/wasm.js
    │ └── https://deno.land/std@0.65.0/encoding/base64.ts
    ├── https://deno.land/std@0.65.0/encoding/hex.ts
    └── https://deno.land/std@0.65.0/encoding/base64.ts

For further information, see the Deno Manual: Dependency Inspector.

Linter (Syntax Checker)

Deno provides a linter to validate JavaScript and TypeScript code. This is an unstable feature which requires the --unstable flag, but no files will be altered when it’s used.

Linting is useful to spot less obvious syntax errors and ensure code adheres with your team’s standards. You may already be using a linter such as ESLint in your editor or from the command line, but Deno provides another option in any environment where it’s installed.

To recursively lint all .js and .ts files in the current and child directories, enter deno lint --unstable:

$ deno lint --unstable

(no-extra-semi) Unnecessary semicolon.
};
 ^
    at /home/deno/testing/lib.js:13:1

Found 1 problem

Alternatively, you can specify one or more files to limit linting. For example:

$ deno lint --unstable ./index.js
$

For further information, see the Deno Manual: Linter. It includes a list of rules you can add to code comments to ignore or enforce specific syntaxes.

Test Runner

Deno has a built-in test runner for unit-testing JavaScript or TypeScript functions.

Tests are defined in any file named <something>test with a .js, .mjs, .ts, .jsx, or .tsx extension. It must make one or more calls to Deno.test and pass a test name string and a testing function. The function can be synchronous or asynchronous and use a variety of assertion utilities to evaluate results.

Create a new test subdirectory with a file named lib.test.js:

// test lib.js library

// assertions
import { assertEquals } from 'https://deno.land/std/testing/asserts.ts';

// lib.js modules
import { hello, sum } from '../lib.js';

// hello function
Deno.test('lib/hello tests', () => {

  assertEquals( hello('Someone'), 'Hello Someone!');
  assertEquals( hello(), 'Hello Anonymous!' );

});

// sum integers
Deno.test('lib/sum integer tests', () => {

  assertEquals( sum(1, 2, 3), 6 );
  assertEquals( sum(1, 2, 3, 4, 5, 6), 21 );

});

// sum strings
Deno.test('lib/sum string tests', () => {

  assertEquals( sum('a', 'b', 'c'), 'abc' );
  assertEquals( sum('A', 'b', 'C'), 'AbC' );

});

// sum mixed values
Deno.test('lib/sum mixed tests', () => {

  assertEquals( sum('a', 1, 2), 'a12' );
  assertEquals( sum(1, 2, 'a'), '3a' );
  assertEquals( sum('an', null, [], 'ed'), 'annulled' );

});

To run all tests from all directories, enter deno test. Or run tests stored in a specific directory with deno test <dir>. For example:

$ deno test ./test

running 4 tests
test lib/hello tests ... ok (4ms)
test lib/sum integer tests ... ok (2ms)
test lib/sum string tests ... ok (2ms)
test lib/sum mixed tests ... ok (2ms)

test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out (11ms)

$

A --filter string or regular expression can also be specified to limit tests by name. For example:

$ deno test --filter "hello" ./test

running 1 tests
test lib/hello tests ... ok (4ms)

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 3 filtered out (5ms)

Longer-running tests can be stopped on the first failure by passing a --failfast option.

For further information, see the Deno Manual: Testing. A few third-party test modules are also available, including Merlin and Ruhm, but these still use Deno.test beneath the surface.

Continue reading How to Use Deno’s Built-in Tools on SitePoint.


by Craig Buckler via SitePoint

React vs Angular: An In-depth Comparison

Two knights jousting, with Angular and React logos on their shields

Should I choose Angular or React? Each framework has a lot to offer and it’s not easy to choose between them. Whether you’re a newcomer trying to figure out where to start, a freelancer picking a framework for your next project, or an enterprise-grade architect planning a strategic vision for your company, you’re likely to benefit from having an educated view on this topic.

To save you some time, let me tell you something up front: this article won’t give a clear answer on which framework is better. But neither will hundreds of other articles with similar titles. I can’t tell you that, because the answer depends on a wide range of factors which make a particular technology more or less suitable for your environment and use case.

Since we can’t answer the question directly, we’ll attempt something else. We’ll compare Angular and React, to demonstrate how you can approach the problem of comparing any two frameworks in a structured manner on your own and tailor it to your environment. You know, the old “teach a man to fish” approach. That way, when both are replaced by a BetterFramework.js in a year’s time, you’ll be able to re-create the same train of thought once more.

Two knights jousting, with React and Angular logos on their shields

We’ve just overhauled this guide to reflect the state of React, Angular, and their respective advantages and disadvantages in 2020.

Where to Start?

Before you pick any tool, you need to answer two simple questions: “Is this a good tool per se?” and “Will it work well for my use case?” Neither of them mean anything on their own, so you always need to keep both of them in mind. All right, the questions might not be that simple, so we’ll try to break them down into smaller ones.

Questions on the tool itself:

  • How mature is it and who’s behind it?
  • What kind of features does it have?
  • What architecture, development paradigms, and patterns does it employ?
  • What is the ecosystem around it?

Questions for self-reflection:

  • Will I and my colleagues be able to learn this tool with ease?
  • Does it fit well with my project?
  • What is the developer experience like?

Using this set of questions, you can start your assessment of any tool, and we’ll base our comparison of React and Angular on them as well.

There’s another thing we need to take into account. Strictly speaking, it’s not exactly fair to compare Angular to React, since Angular is a full-blown, feature-rich framework, while React just a UI component library. To even the odds, we’ll talk about React in conjunction with some of the libraries often used with it.

Maturity

An important part of being a skilled developer is being able to keep the balance between established, time-proven approaches and evaluating new bleeding-edge tech. As a general rule, you should be careful when adopting tools that haven’t yet matured due to certain risks:

  • The tool may be buggy and unstable.
  • It might be unexpectedly abandoned by the vendor.
  • There might not be a large knowledge base or community available in case you need help.
  • Both React and Angular come from good families, so it seems that we can be confident in this regard.

React

React is developed and maintained by Facebook and used in their products, including Instagram and WhatsApp. It has been around for around since 2013, so it’s not exactly new. It’s also one of the most popular projects on GitHub, with more than 150,000 stars at the time of writing. Some of the other notable companies using React are Airbnb, Uber, Netflix, Dropbox, and Atlassian. Sounds good to me.

Angular

Angular has been around since 2016, making it slightly younger than React, but it’s also not a new kid on the block. It’s maintained by Google and, as mentioned by Igor Minar, even in 2018 was used in more than 600 hundred applications in Google such as Firebase Console, Google Analytics, Google Express, Google Cloud Platform and more. Outside of Google, Angular is used by Forbes, Upwork, VMWare, and others.

Features

Like I mentioned earlier, Angular has more features out of the box than React. This can be both a good and a bad thing, depending on how you look at it.

Both frameworks share some key features in common: components, data binding, and platform-agnostic rendering.

Angular

Angular provides a lot of the features required for a modern web application out of the box. Some of the standard features are:

  • dependency injection
  • templates, based on an extended version of HTML
  • class-based components with lifecycle hooks
  • routing, provided by @angular/router
  • Ajax requests using @angular/common/http
  • @angular/forms for building forms
  • component CSS encapsulation
  • XSS protection
  • code splitting and lazy loading
  • test runner, framework and utilities for unit-testing.

Some of these features are built into the core of the framework and you don’t have an option not to use them. This requires developers to be familiar with features such as dependency injection to build even a small Angular application. Other features such as the HTTP client or forms are completely optional and can be added on an as-needed basis.

React

With React, you’re starting with a more minimalistic approach. If we’re looking at just React, here’s what we have:

  • instead of classic templates, it has JSX, an XML-like language built on top of JavaScript
  • class-based components with lifecycle hooks or simpler functional components
  • state management using setState and hooks.
  • XSS protection
  • code splitting and lazy loading
  • error handling boundaries
  • utilities for unit-testing components

Out of the box, React does not provide anything for dependency injection, routing, HTTP calls, or advanced form handling. You are expected to choose whatever additional libraries to add based on your needs which can be both a good and a bad thing depending on how experienced you are with these technologies. Some of the popular libraries that are often used together with React are:

The teams I’ve worked with have found the freedom of choosing your libraries liberating. This gives us the ability to tailor our stack to particular requirements of each project, and we haven’t found the cost of learning new libraries that high.

Continue reading React vs Angular: An In-depth Comparison on SitePoint.


by Pavels Jelisejevs via SitePoint