You are reading the article How To Create An Image Gallery In WordPress 3.5 updated in November 2023 on the website Hatcungthantuong.com. We hope that the information we have shared is helpful to you. If you find the content interesting and meaningful, please share it with your friends and continue to follow and support us for the latest updates. Suggested December 2023 How To Create An Image Gallery In WordPress 3.5
WordPress just released a new update version 3.5, which includes a huge UI change to the media manager – among many other things. Creating image galleries in WordPress 3.5 is now much easier than it was in previous versions.
Let’s take a look at the process:
You can do this by dragging and dropping them to the media manager, or selecting the files from your computer. Remember that you can select more than one image at a time, by holding the “Ctrl” key on your keyboard while selecting your images.
3. Add a title, caption, alt text, and description to your images as needed.
4. If you want to remove an image from your gallery (maybe you changed your mind about it), just uncheck it (see screenshot below).
6. Next, you can add captions to your images if you haven’t already and rearrange the order of your images via drag-and-drop.
7. Don’t forget to customize your gallery settings. You can choose what to link your images to, the number of columns to use, and enable random ordering of your images if you’d like.
That’s it. You may want to preview your gallery to make sure everything is the way you want it. As you can see, the process is pretty straight forward and user-friendly.
Charnita Fance
Charnita has been a Freelance Writer & Professional Blogger since 2008. As an early adopter she loves trying out new apps and services. As a Windows, Mac, Linux and iOS user, she has a great love for bleeding edge technology. You can connect with her on Facebook, Twitter, Google+, and LinkedIn.
Subscribe to our newsletter!
Our latest tutorials delivered straight to your inbox
Sign up for all newsletters.
By signing up, you agree to our Privacy Policy and European users agree to the data transfer policy. We will not share your data and you can unsubscribe at any time.
You're reading How To Create An Image Gallery In WordPress 3.5
How To Create Custom Sidebars In WordPress? – Webnots
Most of the free WordPress themes offer a single sidebar for all pages and posts. Some commercial themes offer custom sidebar option. This option will allow you to create multiple sidebars and assign to different posts based on your need. Don’t worry, if your theme does not offer this option. Here is how you can create different sidebars on different posts in WordPress.
Why Do You Need Different Sidebar on Different Posts?When you run a site with large number of categories it does not make sense to show the same sidebar on posts. You may have the following situations:
Add different sidebar widgets only on certain section of your site.
Showcase different sidebar based on category
Show different sidebar on archive pages
Display different sidebar on custom pages like 404 page
Show different sidebar on individual post or page based on the need
There are varieties of plugins available on the WordPress repository for creating custom sidebars. But all the above listed needs can be simply fulfilled with a single custom sidebar plugin.
Installing Custom Sidebars PluginInstalling Custom Sidebars Plugin
Once activated, the plugin will create additional settings in different places. Let us checkout all options in detail.
Assigning Existing Theme’s Sidebar
On individual posts based on category or post types
On archives based on types, category or author
This will cover all possible options for you to assign different sidebars on different posts. Basically you don’t need to assign the default sidebar as it will be already assigned to all existing posts, pages and archives of your WordPress site. Ensure you have checked the “Allow this sidebar to be replaced” option to allow the plugin to replace the default sidebar with custom sidebar.
Creating Custom SidebarsCreating Custom Sidebar in WordPress
Enter the name and description for your sidebar.
Adding Widgets to Custom SidebarsOnce the custom sidebar is created, you can see it beside the theme’s sidebars. Drag and drop the widgets inside the custom sidebar similar to default theme’s sidebar.
Custom Sidebar Options
Assigning Custom SidebarAssigning Sidebar to Post Based on Category and Post Type
The plugin will replace the default sidebar on all posts matching the selected categories and post types with the new custom sidebar. Under “For Archives” section assign the sidebar to archive pages based on the archive type, category and author.
Assigning Sidebars on Archives
Bulk Change SidebarsThis looks simple as long as one post is assigned only one category. When a single post is assigned to subcategory 1, 2 and 3 then the sidebar will assigned based on the alphabetical order of the category. If you wanted to have different sidebars for those posts with multiple categories then use bulk edit option and assign the required sidebar.
Assign Sidebar in Post EditorThe plugin will add a new metabox called “Sidebars” in WordPress post and page editors. Here you assign the required sidebar to replace the default sidebar right from the editor.
Note: Considering full site editing future in WordPress, the developer discontinued Custom Sidebars plugin. However, you can use other plugins like Lightweight Sidebar Manager to create and manage multiple sidebars on your site.
How To Change The Aspect Ratio Of An Image In Photoshop
Preparing your images for print may require you to learn how to change the aspect ratio. In Photoshop, you can use the crop tool to resize your images to the exact specifications you need. This enables you to easily fit your images into the frame you have chosen, as the crop tool will help you change the aspect ratio in a few simple steps.
To change the aspect ratio of an image in Photoshop, select the Crop Tool (C) and set the Crop Preset to “Ratio.” Next, type in the desired ratio values in the upper setting bar to change the ratio of the crop overlay. Once positioned, press the checkmark to crop and update the aspect ratio.
Rather than struggling with the ruler tool and trying to resize your images using millimeters, inches, or pixels, the aspect ratio allows you to correct the image’s dimensions. This method is also used when you want to remove unwanted elements to focus on the focal point of your image.
So let’s start by learning the ratio feature of the crop tool!
How To Change The Aspect Ratio In PhotoshopIn this section, I will explain how you can set a specific aspect ratio for an image of any size. For this tutorial, I will be using the 16:9 aspect ratio. Depending on the current dimensions of your image, you may lose some of the background or foreground. However, you will have a correctly sized image for print or an image focusing on the right objects.
Step 1: Access The Crop ToolTo start, simply select the crop tool. You can find it on your toolbar on the left-hand side of your Photoshop screen. Alternatively, you can simply press C on your keyboard.
Once the crop tool has been selected, your previous settings used when using this tool will be applied. This will need to be changed to match the aspect ratio we want to use, which in this case is 16:9.
Step 2: Change The Crop Preset To “Ratio”The next step is to select the drop-down menu directly next to the crop tool icon on the top options bar. Changing the settings to “Ratio” allows you to set your image to any aspect ratio, which is great for printing images for specific frame sizes.
Here you will notice the previous crop settings are still selected. In this case, the “4 x 5 in 300 PPI” option is still selected.
Next, select “Ratio” at the top of the drop-down menu, as this will enable you to choose a ratio as desired. For our example, you will now type in “16” and “9” to the two blocks to the right of the drop-down menu.
Your image will now have the crop block based on your set ratio. You can move this block to make sure you keep the relevant parts of your image and crop the edges outside of the block as usual. Simply use the navigation arrows on your keyboard to move the block around the image, and hit enter to crop.
Can You Change The Aspect Ratio Without Cropping?Changing the aspect ratio may crop out parts of the image you wish to keep. This is especially true if you are using this feature to resize an image for print.
Unfortunately, if your image was not originally the aspect ratio that you require, you will likely need to crop certain elements of the image.
If you want to avoid cropping elements out of your image, there are two tricks you can use to manipulate the image. Unfortunately, one method will lead to some distortion, so it may not look aesthetically pleasing if you try to save too much of the image.
The first method is done by reducing the image size to fit inside the new aspect ratio before slightly stretching the sides of the image to reach the aspect ratio.
To stretch the image, make sure the “Delete Cropped Pixels” box is unticked after choosing your ratio and press enter or the checkmark in the options bar to finish the crop.
Next, select the image option on the menu bar and select “Canvas Size.” To use a shortcut press Control + Alt + C (Windows) or Command + Option + C (Mac).
Increase the canvas size in the width and height boxes, but be sure to keep them in multiples of the aspect ratio you have chosen. The width should be related to the first number of the aspect ratio, and the height is the second number.
Then simply drag the sides of the image to the end of the canvas. It will stretch your image slightly, so be aware of the distortion.
If you prefer not to stretch the image, increase the canvas size in line with your chosen aspect ratio before decreasing the image size to fit your canvas. Then simply create a white background around the image.
How To Save An Aspect Ratio As A Crop PresetIf you have a specific aspect ratio you want to use for multiple images, you can save your chosen aspect ratio as a preset. This will enable you to easily select this chosen aspect ratio from the drop-down menu.
Start by following the steps to change the aspect ratio, and once you have entered your chosen aspect ratio into the blocks, select the drop-down menu again and choose the “New Crop Preset” option.
A box will appear where you can enter a name for your new preset. In this case, I have chosen “My Aspect Ratio.”
Your preset will remain in the drop-down list until you choose to delete it. You can also add as many presets as you need.
Following these steps enables you to easily crop and resize your images to the correct dimensions for any frame size. This means you won’t have to worry about printing photographs that don’t fit your frames anymore. Try out the extra tips to avoid losing too much of your image, but be careful not to distort it too much.
Now, this tutorial covered how to crop the entire canvas, but what if you want to only crop a single layer? Luckily you can learn how here!
Happy Cropping!
How To Read An Image File In External Storage With Runtime Permission In Android?
android:layout_width = “match_parent” android:layout_height = “match_parent” tools:context = “.MainActivity” <Button android:id = “@+id/read” android:text = “read” android:layout_width = “wrap_content” <ImageView android:id = “@+id/imageView” android:layout_width = “wrap_content” import android.content.pm.PackageManager; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.Build; import android.os.Bundle; import android.os.Environment; import android.support.v4.app.ActivityCompat; import android.support.v4.content.ContextCompat; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.ImageView; import android.widget.Toast; import java.io.File; public class MainActivity extends AppCompatActivity { private static final int PERMISSION_REQUEST_CODE<100; Button read; ImageView imageView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); imageView<findViewById(R.id.imageView); read<findViewById(R.id.read); @Override String state<Environment.getExternalStorageState(); if (Environment.MEDIA_MOUNTED.equals(state)) { if (checkPermission()) { File dir<new File(Environment.getExternalStorageDirectory().getAbsolutePath() + “/images.jpeg”); if (dir.exists()) { Log.d(“path”, dir.toString()); BitmapFactory.Options options<new BitmapFactory.Options(); options.inPreferredConfig<Bitmap.Config.ARGB_8888; Bitmap bitmap<BitmapFactory.decodeFile(String.valueOf(dir), options); imageView.setImageBitmap(bitmap); } } else { requestPermission(); } } else { File dir<new File(Environment.getExternalStorageDirectory().getAbsolutePath() + “/images.jpeg”); if (dir.exists()) { Log.d(“path”, dir.toString()); BitmapFactory.Options options<new BitmapFactory.Options(); options.inPreferredConfig<Bitmap.Config.ARGB_8888; Bitmap bitmap<BitmapFactory.decodeFile(String.valueOf(dir), options); imageView.setImageBitmap(bitmap); } } } } }); } private boolean checkPermission() { int result<ContextCompat.checkSelfPermission(MainActivity.this, android.Manifest.permission.READ_EXTERNAL_STORAGE); if (result<= PackageManager.PERMISSION_GRANTED) { return true; } else { return false; } } private void requestPermission() { if (ActivityCompat.shouldShowRequestPermissionRationale(MainActivity.this, android.Manifest.permission.READ_EXTERNAL_STORAGE)) { Toast.makeText(MainActivity.this, “Write External Storage permission allows us to read files. Please allow this permission in App Settings.”, Toast.LENGTH_LONG).show(); } else { ActivityCompat.requestPermissions(MainActivity.this, new String[] {android.Manifest.permission.READ_EXTERNAL_STORAGE}, PERMISSION_REQUEST_CODE); } } @Override public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) { switch (requestCode) { case PERMISSION_REQUEST_CODE: Log.e(“value”, “Permission Granted, Now you can use local drive .”); } else { Log.e(“value”, “Permission Denied, You cannot use local drive .”); } break; } } <application android:allowBackup = “true” android:icon = “@mipmap/ic_launcher” android:label = “@string/app_name” android:roundIcon = “@mipmap/ic_launcher_round” android:supportsRtl = “true”
How To Change Font In WordPress Site? – Webnots
There are millions of WordPress sites using few popular themes that look similar in all aspects. Using different fonts is one of the easy ways for people to make their site unique. Even though this may seem like an easy task, sometimes it’s a bit complicated. In this article, we will explain few methods about how to change font in WordPress site. Depending on your skills and WordPress knowledge, you can choose which one of these methods is best suited for you.
Precautions Before Changing FontBefore you proceed with changing your font, you might want to take few precaution measurements. Even though this is not a significant change that you will make on your website, it’s better to be safe than sorry.
One of the most important measurements you will need is to take a backup of your site. By doing this, you will prevent any future troubles you might encounter. This is especially helpful especially if you are playing with theme’s CSS.
Decide the font family you want to use on your site. Besides standard font families like Arial (sans-serif), Times New Roman (serif), etc. Google offers 700+ custom fonts. Therefore, choose the family you want to use on your site.
Font change may affect the site’s layout. Hence, make sure to choose the correct font that suits your content and layout.
Another step you can take is changing your font in a test website. By doing this, you will learn how to perform this task without missing anything on your live site. We strongly recommend doing this to avoid making changes to your live site that was running for long time with different fonts.
How to Change Font in WordPress Site?Following are the three options available:
Check typography settings in theme panel
Install fonts plugin
Tweak theme’s CSS
1. Changing Fonts from Theme SettingsThe first and easy method of changing font on your website is using the build-in font changer. Most of the commercial themes offer typography options in customizer section to adjust the font and spacing settings. Just be on the lookout since some themes might not include this feature, or if you are using the free version of it, this feature might be available on the Pro version.
For us to show this, we will use the popular “Astra” theme.
Base Typography Astra Theme
Under “Headings” section, you can change the font family, size, and line-height for all the headings that your website might have, from H1 to H6.
Headings Typography Astra Theme
Using typography options of your theme is the best option as the developer might have tested for all the available fonts and variations. This will reduce your testing effort and most probably you can do the changes on the live site in few minutes.
Note that themes like Astra and GeneratePress allows you to choose system font for your site. This means the site will use font from the device it is being viewed. Since this will remove the loading time of font files from your domain, your page loading speed will drastically improve.
2. Changing Font with PluginPlugins are among the most useful features on WordPress; you can practically do almost anything with them. Changing your font is no different, especially if your theme does not offer typography options. There are plenty of plugins that can do this for you.
Fonts Plugin Options
You can change the font for your content, headings, and buttons under the “Basic Settings” section.
Fonts Plugin Basic Settings
While on the “Advanced Settings,” you can go into more detail and change the font for branding, navigation, content (here, you can change the font for titles, headings, and other parts of your content), sidebar, footer, and load fonts only.
3. Changing Font Through CSSThis is not a recommend method especially for beginners without appropriate knowledge of using fonts in CSS. In addition, you should be careful since you are going into the website code. So be cautious with what you edit, remove, and add.
Stylesheet CSS
Once you are there, WordPress by default open the Stylesheet called chúng tôi This is generally available as a first file; you need for changing fonts on your website.
Add the below code in order to change the font for your whole website.
*{font-family:" Name of your font"}
You will also need to define your font family at the top of the chúng tôi you can do this by adding these lines. Learn more on using font-face property here.
@font-face { font-family: "Name of your font"; font-weight: 100 900; /*These will decide how thick or thin your characters will be */ font-style: normal; /*Here you can put your style as normal, italic, or oblique*/ src: url (URL from which you got the font) format("format of font"); }Body CSS Code
After adding or changing the code, you will have to scroll down the page and press the “Update File” button. By doing that, your website should change the font automatically.
When you play with CSS, you have to load only the required fonts and delete unused fonts from your site. However, this will be highly difficult task for beginners as some themes use multiple fonts in CSS making the code more complex to read.
Will Font Change Affect My SEO?The answer is yes, font change will affect your search engine ranking if you do not plan and do it properly.
Loading font files will affect the page loading speed. Google PageSpeed Insights and other speed measurement tools will show warnings when fonts prevent the page content to load. In order to avoid this, choose only required font weightage to avoid loading bunch of font files on your site. as mentioned above, “Fonts Plugin” can help in this to load only required font weights. When you use theme settings or custom CSS, make sure to take care of this.
You have to preload font files used on your site to remove preload key requests errors in Google PageSpeed Insights. Learn more on how to preload font files in WordPress.
Make sure to have proper size and spacing on your site’s layout. Otherwise, you will see errors in Google PageSpeed like elements are too close and smaller font size.
Using external font like Google Fonts will increase the loading time and hence slow your site. You can use caching plugins like WP Rocket to optimize and combine all external Google fonts you use.
When you change the font, Google and other search engines will try to find the previous font files on your site. this will cause 404 errors as you would have deleted old fonts. Generally, you do not need to set 301 redirects for missing font files and ignore them as these errors do not affect users.
On other hand, if you have slow loading website, check the above-mentioned font issues. Probably changing to new font can help to improve the speed.
Closing RemarksAs you saw, changing a font can become quite a hassle sometimes, depending on which method you choose. Even if you are a more knowledgeable person regarding WordPress, we recommend going with the first or second method. After you have found the perfect font for you, your site will be more unique and eye-catching, and your viewers will appreciate your website even more.
Drawing A Cross On An Image With Opencv
OpenCV is an Open Source Computer Vision Library in python. It provides numerous functions to perform various Image and video processing operations. The library uses the Numpy module to represent all the video frames and images as a ndarray type. It needs the numpy library, we need to make sure that the numpy module is also installed in our python interpreter.
In this article, we will see different ways to draw a cross on an image using OpenCV Python. Let’s observe the input-output scenario to understand how to draw a cross on an image.
Input Output ScenariosLet’s discuss what are the different ways draw cross on an image.
Using cv2.drawMarker() functionThe function draws a marker on an image by a predefined position. And it supports several marker types. Following is the syntax of this function –
cv.drawMarker(img, position, color[, markerType[, markerSize[, thickness[, line_type]]]]) Parameters
img: The source image where to draw the marker.
position: The position where the crosshair is positioned.
color: It specifies the color of the marker.
thickness: It is an optional parameter. It specifies the line thickness of the marker.
markerType: The specifies the marker type. The available types are:
cv2.MARKER_CROSS: A crosshair marker shape.
cv2.MARKER_TILTED_CROSS: A 45-degree tilted crosshair marker shape.
cv2.MARKER_STAR: A star marker shape, which is combination of cross and tilted cross.
cv2.MARKER_DIAMOND: A diamond marker shape.
cv2.MARKER_SQUARE: A square marker shape.
cv2.MARKER_TRIANGLE_UP: An upwards-pointing triangle marker shape.
cv2.MARKER_TRIANGLE_DOWN: A downwards-pointing triangle marker shape.
thickness: it specifies the line thickness.
lineType (Optional): It specifies the type of line we want to use. The available 4 LineTypes are:
FILLED
LINE_4
LINE_8
LINE_AA
markerSize: it specifies the length of the marker by default it is set to 20 pixels
ExampleIn this example, we will draw a black cross on the input image.
import cv2 from random import randint img = cv2.imread('Images/butterfly1.jpg') cv2.imshow('Input image', img) cv2.drawMarker(img, (250, 160), color=[0, 0, 0], thickness=10, markerType= cv2.MARKER_TILTED_CROSS, line_type=cv2.LINE_AA, markerSize=100) cv2.imshow('Output image', img) cv2.waitKey(0) Input Image Output Image Using cv2.line() functionThe function draws a line between two connecting points pt1 and pt2 in the image. Following is the syntax of the line() function –
cv.line(img, pt1, pt2, color[, thickness[, lineType[, shift]]]) Parameters
img: The source image where to draw the marker.
pt1: A tuple with the x and y coordinates of the image where the line should start.
pt2: A tuple with the x and y coordinates of the image where the line should end.
color: It specifies the color of the marker.
thickness: It is an optional parameter. It specifies the line thickness of the marker.
lineType (Optional): It specifies the type of line we want to use. The available 4 LineTypes are:
FILLED
LINE_4
LINE_8
LINE_AA
shift: it specifies the number of fractional bits in the point coordinates.
ExampleLet’s take an image and draw a cross using the cv2.line() method.
import cv2 from random import randint img = cv2.imread('Images/flower-black-background.jpg') cv2.imshow('Input image', img) coordinates = [[(420, 280), (520,280)], [(470, 220), (470,350)]] cv2.line(img, coordinates[0][0],coordinates[0][1], color=[0, 0, 250], thickness=20) cv2.line(img, coordinates[1][0],coordinates[1][1], color=[0, 0, 250], thickness=20) cv2.imshow('Output image', img) cv2.waitKey(0) Input Image ExampleIn this example, we will draw cross lines by covering the 4 corners of the image. Initially, we will get the dimensions of an image using the shape attribute of the numpy array(image array), and from those values, we can identify the image corners.
import cv2 from random import randint img = cv2.imread('Images/Lenna.png') cv2.imshow('Input image', img) # image height = shape[0] # image width = shape[1] shape = img.shape cv2.line(img, (0,0),shape[:2], color=[0, 0, 250], thickness=20) cv2.line(img, (shape[1], 0), (0, shape[0]), color=[0, 0, 250], thickness=20) cv2.imshow('Output image', img) cv2.waitKey(0) Input Image Output ImageThis is how the python OpenCV functions cv2.lines() and drawMarker() are drawn a cross on the specific image.
Update the detailed information about How To Create An Image Gallery In WordPress 3.5 on the Hatcungthantuong.com website. We hope the article's content will meet your needs, and we will regularly update the information to provide you with the fastest and most accurate information. Have a great day!