WordPress how to add all menus into post

1. Use a shortcode to display all menus

You can create a custom shortcode that lists all registered menus, then insert that shortcode into any post.

Here’s a simple way to do it:

Step 1: Add this to your theme’s functions.php file:

function list_all_menus_shortcode() {
    $menus = wp_get_nav_menus();
    $output = '';

    if (!empty($menus)) {
        foreach ($menus as $menu) {
            $menu_items = wp_get_nav_menu_items($menu->term_id);

            if (!empty($menu_items)) {
                $output .= '<h2>' . esc_html($menu->name) . '</h2>';
                $output .= '<ul>';

                foreach ($menu_items as $item) {
                    $output .= '<li><a href="' . esc_url($item->url) . '">' . esc_html($item->title) . '</a></li>';
                }

                $output .= '</ul>';
            }
        }
    } else {
        $output = '<p>No menus found.</p>';
    }

    return $output;
}
add_shortcode('all_menus', 'list_all_menus_shortcode');


Step 2: Use [all_menus] shortcode inside your post content.

✅ Now when you insert [all_menus] into any post or page, it will automatically display all menus with their items.


2. Use a shortcode to print all menu names quoted and separated by a comma

function print_all_menu_names_shortcode() {
    $menus = wp_get_nav_menus();
    $names = [];

    if (!empty($menus)) {
        foreach ($menus as $menu) {
            $names[] = '"' . esc_html($menu->name) . '"';
        }
        return implode(', ', $names);
    } else {
        return 'No menus found.';
    }
}
add_shortcode('print_menu_names', 'print_all_menu_names_shortcode');


How to use:

  • Add the code to your theme’s functions.php or your custom plugin.
  • Then just put this shortcode wherever you want the menu names to appear:
[print_menu_names]

✅ This will output something like:

"Main Menu", "Footer Menu", "Sidebar Menu"


3. Use a shortcode to print all menus in a custom sort

Each WordPress menu has a unique ID ($menu->term_id) and a name ($menu->name).
You can identify them either by their ID or by their name.

Then, you manually set the order you want.


Here’s how you can do it:

Update the shortcode function like this:

function list_all_menus_shortcode() {
    $menus = wp_get_nav_menus();
    $output = '';

    if (!empty($menus)) {
        // Step 1: Define the hard-coded order you want (by menu ID or menu name)
        $custom_order = [
            'Main Menu',     // by name
            'Footer Menu',
            'Sidebar Menu',
        ];
        
        // Step 2: Reorder the menus according to your custom order
        $ordered_menus = [];
        foreach ($custom_order as $name) {
            foreach ($menus as $menu) {
                if ($menu->name === $name) { // use $menu->term_id if you want to match by ID
                    $ordered_menus[] = $menu;
                    break;
                }
            }
        }

        foreach ($ordered_menus as $menu) {
            $menu_items = wp_get_nav_menu_items($menu->term_id);

            if (!empty($menu_items)) {
                $output .= '<h2>' . esc_html($menu->name) . '</h2>';
                $output .= '<ul>';

                foreach ($menu_items as $item) {
                    $output .= '<li><a href="' . esc_url($item->url) . '">' . esc_html($item->title) . '</a></li>';
                }

                $output .= '</ul>';
            }
        }
    } else {
        $output = '<p>No menus found.</p>';
    }

    return $output;
}
add_shortcode('all_menus', 'list_all_menus_shortcode');


Important notes:

  • Replace "Main Menu", "Footer Menu", etc., in $custom_order with your real menu names.
  • Alternatively, you can match by term_id instead of name if you prefer.

👉 To find your menu IDs easily, go to:
WordPress Dashboard → Appearance → Menus, then hover over a menu — you’ll see a URL like:

/wp-admin/nav-menus.php?action=edit&amp;menu=45

Here, menu=45 means term_id = 45.

If you want to match by ID, change the matching line:

if ($menu->term_id == $id) {

instead of name matching.

A contemporary logo for a Cypriot ethical hacking group, combining traditional and digital motifs. The logo includes an abstract representation of a castle tower, signifying defense and strategy, with a circuit board pattern. The Cyprus flag is cleverly integrated into the tower design. Above the tower flies a stylized eagle, representing vigilance in cybersecurity. The group's initials, 'CEH', are interwoven into the base of the tower in a futuristic typeface.

How to convert certificate of Let’s encrypt to jks

To convert a Let’s Encrypt SSL certificate (issued as PEM files) into a Java Keystore (JKS), follow these steps:

Step-by-step guide:

Step 1: Get the files ready

After obtaining your certificate from Let’s Encrypt, you’ll typically have the following files:

  • cert.pem (your domain certificate)
  • privkey.pem (private key)
  • chain.pem (CA intermediate certificates)
  • fullchain.pem (combined certificate with intermediate)

Ensure these files are available on your machine.


Step 2: Combine your certificate and private key into PKCS12 format

Use OpenSSL to create a PKCS12 (.p12) file:

openssl pkcs12 -export \
  -in fullchain.pem \
  -inkey privkey.pem \
  -out certificate.p12 \
  -name your_alias

Replace your_alias with a meaningful alias, such as your domain name.

You’ll be asked to set a password. Remember this password, as you’ll need it to import into the keystore.


Step 3: Import PKCS12 file into JKS Keystore

Now, convert the PKCS12 file (certificate.p12) into a JKS keystore:

keytool -importkeystore \
  -deststorepass YOUR_KEYSTORE_PASSWORD \
  -destkeypass YOUR_KEYSTORE_PASSWORD \
  -destkeystore keystore.jks \
  -srckeystore certificate.p12 \
  -srcstoretype PKCS12 \
  -srcstorepass YOUR_PKCS12_PASSWORD \
  -alias your_alias

  • Replace YOUR_KEYSTORE_PASSWORD with the password you want for your new Java keystore.
  • Replace YOUR_PKCS12_PASSWORD with the password you set when creating the .p12 file in Step 2.

Step 4: Verify your JKS Keystore

To ensure your certificate is correctly imported, use:

keytool -list -v -keystore keystore.jks

You should see your imported certificate details listed.


Step 5: Use your JKS Keystore

Now you can use keystore.jks in your Java application or server (like Tomcat, Jetty, Spring Boot applications, etc.).

Example configuration (Tomcat server.xml):

&lt;Connector port="8443" protocol="HTTP/1.1"
           SSLEnabled="true"
           scheme="https" secure="true"
           keystoreFile="/path/to/keystore.jks"
           keystorePass="YOUR_KEYSTORE_PASSWORD"
           clientAuth="false" sslProtocol="TLS" />

Replace paths/passwords with your details.


Important notes:

  • Store your keystore securely and protect the passwords.
  • Let’s Encrypt certificates expire every 90 days, so automate renewal and conversion into JKS if possible.

That’s it! Your Let’s Encrypt certificate is now in JKS format, ready for Java applications.

A sophisticated logo design for a Cypriot ethical hacker team, featuring a 3D metallic shield that incorporates the outline of Cyprus. Overlaid on the shield is a digital phoenix, symbolizing rebirth and resilience in the cybersecurity realm. The colors of the flag are present in the form of dynamic streaks across the shield. The team's name, 'Cyber Guardians CY', is embossed in bold, digital font along the lower part of the shield.

How to Export Your Viber Chat History

Need to save a record of your Viber chats? It’s easy! Just follow these simple steps to export your messages:

  1. Open Viber on your mobile device.
  2. Go to More (usually found in the bottom-right corner).
  3. Click on Settings.
  4. Tap Calls and Messages.
  5. Select Email message history.

Alternatively, you can open this link directly from your mobile device:

viber://more/email_message_history_on

This action will allow you to save a zip file with all your conversations, which you can later share using other conventional methods.

Please note that the export file will only contain text messages and no media (photos, videos, etc.). If you need to save media, you’ll have to back those up separately.

That’s it! Your chat history will be emailed to the address you choose, and you can keep it safely stored for future reference.

An illustration for a logo that embodies a team of Cypriot ethical hackers, incorporating a sleek, modern shield with a stylized silhouette of Cyprus in the center. The shield is adorned with digital accents like a binary code halo and a keyboard pattern. The acronym 'CEH' for 'Cypriot Ethical Hackers' is boldly positioned across the shield, with a cybernetic font, set against a background that hints at a digital network.