Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Så här visar du olika menyer för inloggade användare i WordPress

WordPress visar samma navigeringsmeny för alla. Du kanske dock vill anpassa menyn beroende på om en användare är inloggad eller inte.

Att visa olika menyer för inloggade användare i WordPress är ett bra sätt att skapa en mer personlig upplevelse. Det gör att du kan visa relevant innehåll endast för dem som är inloggade, till exempel kontouppgifter eller exklusiva resurser.

I den här guiden förklarar vi hur du ställer in olika menyer för inloggade användare med hjälp av 2 metoder.

Showing different navigtion menus to logged in and non-logged in users in WordPress

Varför visas olika menyer för inloggade användare i WordPress?

Genom att Changed olika area på din WordPress-webbplats baserat på dina besökare och deras aktivitet får din site en personlig känsla för varje användare.

Detta personliga innehåll hjälper dig att förbättra användarupplevelsen på din WordPress-webbplats.

Om du driver en webbplats där användarna inte behöver registrera sig eller logga in kan du förmodligen använda samma navigeringsmenyer på hela webbplatsen. Andra webbplatser kan dock ha stor nytta av att visa anpassade menyer för inloggade användare.

Webbplatser som t.ex. en webbutik, en onlineplattform för lärande eller en WordPress-medlemskapswebbplats kan alla dra nytta av personliga navigeringsmenyer.

En personlig navigeringsmeny för inloggade användare gör det lättare för dem att hitta saker som de har registrerat sig för.

Till exempel kan en användare i en webbutik hantera sitt konto, eller en medlem i en betalande community kan enkelt förnya sin prenumeration eller se de exklusiva onlinekurser som de har köpt.

I WordPress kan du som standard skapa så många navigeringsmenyer som du vill. Du kan dock bara välja att visa en meny på en viss plats i ditt WordPress-tema.

Innan du sätter upp menyer för inloggade användare måste du först skapa två separata navigeringsmenyer. Den ena menyn ska vara för inloggade användare och den andra för utloggade användare. Låt oss sätta igång.

Bara en snabb anmärkning! De metoder vi delar med oss av är utformade för personer som använder klassiska WordPress-teman. Om du använder ett blocktema med FSE-funktioner (Full Site Editing) från WordPress 5.8 och framåt kanske den här metoden inte fungerar.

Skapa menyer för inloggade och icke-inloggade användare i WordPress

För att skapa separata menyer för de två typerna av användare måste du gå till sidan Utseende ” Menyer i WordPress instrumentpanel.

Om du redan har en navigeringsmeny som du använder på din webbplats för alla användare kan den bli din standardmeny.

Main menu

Därefter kan du klicka på länken ”Skapa en ny meny” för att skapa en ny anpassad meny för dina inloggade användare.

Här kan du gå vidare och lägga till menyalternativ som du vill visa för registrerade eller inloggade användare. Du kanske till exempel vill lägga till en utloggningslänk i din meny.

På vänster sida av skärmen ser du en lista över dina webbsidor. Markera bara rutan bredvid den sida som du vill lägga till i menyn och klicka på knappen ”Lägg till i menyn”.

Logged in menu

Du kan också dra och släppa menyalternativen på höger sida av skärmen för att ordna om dem.

Längre ner på sidan kan du välja en plats där du vill visa din meny. Men du behöver inte tilldela en plats till den här menyn nu. Det gör vi senare i artikeln.

Glöm inte att klicka på knappen ”Save Menu” för att spara dina ändringar.

Mer information om hur du skapar menyer finns i vår nybörjarguide till navigationsmenyer i WordPress.

Nu är du redo att visa olika menyer för inloggade användare. Här är en snabb översikt över alla de metoder som vi kommer att gå igenom i den här guiden:

Låt oss dyka in i den första metoden.

Metod 1. Visa olika menyer för inloggade användare i WordPress med hjälp av ett plugin

Det enklaste sättet att visa olika menyer för inloggade användare är att använda pluginet Conditional Menus. Så låt oss installera och aktivera det först.

Mer information finns i vår steg-för-steg-guide om hur du installerar ett WordPress-plugin.

Efter aktivering måste du navigera till Utseende ” Menyer från din WordPress-panel. Gå sedan till fliken ”Hantera platser”.

Här visas en lista över tillgängliga menypositioner som definierats i ditt WordPress-tema och de menyer som visas för närvarande.

Till exempel visar vår ”Primary Menu”-plats för närvarande en ”Main Menu”.

Manage menu locations

Nu måste vi tala om för plugin-programmet att visa en annan meny när ett visst villkor uppfylls.

För att göra det, låt oss klicka på länken ”+ Villkorlig meny”. Sedan kan du välja den navigeringsmeny som du vill visa för de inloggade användarna i rullgardinsmenyn.

Select logged in menu

Därefter ska du klicka på länken ”+ Villkor”.

Detta kommer att visa en popup där du ser ett antal villkor att välja mellan.

Select logged in user aa the condition

Markera bara rutan bredvid alternativet ”User logged in” och klicka sedan på knappen ”Save”.

Du kan nu besöka din webbplats för att se den inloggade användarens meny i aktion. Du kan också logga ut från din WordPress-admin för att se den navigationsmeny som visas för alla andra användare.

Different menu for logged in users

Metod 2. Välj manuellt den inloggade menyn i WordPress med hjälp av kod

Den här metoden är obligatorisk för att du ska kunna add to kod till din website i WordPress. Om du inte har gjort det tidigare kan du ta en titt på vår guide om hur du copy and pastear code snippets i WordPress.

I allmänhet måste du lägga till en kodsnutt i ditt temas functions.php-fil eller ett webbplatsspecifikt plugin. Vi rekommenderar dock inte den här metoden eftersom den potentiellt kan orsaka problem med din webbplats.

Istället kan du använda plugin-programmet WPCode.

MedWPCode kan du lägga till anpassade kodavsnitt på din webbplats utan att redigera temats filer direkt. Det hjälper också till att hantera dessa kodavsnitt och säkerställer att de körs på ett säkert sätt, vilket minimerar risken för att din webbplats går sönder.

För att komma igång installerar vi plugin-programmet WPCode. Du kan använda gratisversionen av WPCode, eftersom den har allt du behöver göra för att visa olika menyer för inloggade användare.

När du har installerat vill du navigera till Code Sn ippets + Lägg till snippets.

Add Snippet button in WPCode

Detta öppnar WPCodes galleri med kodsnuttar.

Härifrån kan du klicka på knappen ”+ Add Custom Snippet”.

Add Custom Snippet button in WPCode

Du kommer då till WPCodes textredigerare.

Nästa steg är att lägga till en titel till ditt kodavsnitt och välja ”HTML-snippet” i rullgardinsmenyn ”Code Type”.

Adding snippet title and choosing code type in WPCode

När du har gjort det kopierar du bara och klistrar in följande kod i fältet ”Code Preview”:

function my_wp_nav_menu_args( $args = '' ) {
if( is_user_logged_in() ) {
// Logged in menu to display
$args['menu'] = 43;

} else {
// Non-logged-in menu to display
$args['menu'] = 35;
}
return $args;
}
add_filter( 'wp_nav_menu_args', 'my_wp_nav_menu_args' );

Så här kan det se ut i din WPCode-editor:

The custom HTML snippet in WPCode's Code Preview

Se till att du ersätter 43 och 35 med ID:n för de navigeringsmenyer som du skapade tidigare.

Du kan hitta ID för en navigeringsmeny genom att välja den på sidan ”Menyer”. Menyns ID-nummer visas i adressfältet i din webbläsare.

Find navigation menu ID

När du har kontrollerat att alla uppgifter är korrekta klickar du på den blå knappen ”Save Snippet”.

Och så var det klart! Vi hoppas att den här artikeln har hjälpt dig att lära dig hur du enkelt kan visa olika navigeringsmenyer för inloggade användare i WordPress. Du kanske också vill läsa vår guide om hur du låter användare bjuda in sina vänner att registrera sig i WordPress och hur du utformar navigeringsmenyer i WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Avslöjande: Vårt innehåll stöds av våra läsare. Det innebär att om du klickar på några av våra länkar, kan vi tjäna en provision. Se hur WPBeginner finansieras, varför det är viktigt, och hur du kan stödja oss. Här är vår editoriala process.

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

Den ultimata WordPress-verktygslådan

Få GRATIS tillgång till vår verktygslåda - en samling WordPress-relaterade produkter och resurser som varje professionell användare bör ha!

Reader Interactions

99 kommentarerLämna ett svar

  1. Syed Balkhi

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Jan-Paul Kleijn

    First I thought of a plugin. Gotta quit thinking like that.
    Then I saw your post and was sold.
    Thank you for posting this, you helped me very nicely.

  3. Phil

    Thanks so much for that. Works perfectly.

  4. Ariet

    Hello,

    This totally works!
    But it change my footer menu too.. is there a way where my footer manu stay the same?

  5. Tarron Acuff

    So, I have 2 menus. One for the public and another that I would like employees to see when they are logged in. The employee menu would replace the main menu only when an employee is logged in.

    Here is what I am currently using in my functions.php file

    // Set the Role as a body class

    function add_role_to_body( $classes ) {

    $user = wp_get_current_user();

    $user_roles = $user->roles;
    foreach( $user_roles as $role ) {
    $classes[] = ’role-’ . $role;
    }

    return $classes;

    }

    add_filter( ’body_class’, ’add_role_to_body’ );

    ***Here is what I added for CSS***

    /* First hide the menu items for non ”employee” user */
    #top-menu li.menu-for-employee {
    display: none;
    }

    /* Show the menu items for the ”employee” user */
    .role-employee #top-menu li.menu-for-employee {
    display: initial;
    }

    When I log in as an employee both menus are showing.

    Thanks in advance.

  6. Wasim

    its not working for me. It display default menu after I add this code, even my primary menu gone.

  7. Joe

    Hi Guys,

    I nice tutorial but i was wondering could you use the same approach to replace a responsive menu at a certain screen size?

    I have two menus but would rather have just one responsive menu at 768 px by replacing the menu with another.

    Thanks

  8. Pet

    Awesome job with your guides. I am building my first wordpress site and I am finding your site incredibly helpful in guiding me along, thank you.

    I really wanted to show different menus for logged in users (like ’edit profile’) and for logged out users and that brought me here. The code you shared works alright for me. I now have two menus which are showing up nice. However, the last part of the code, add filter string, I believe, is messing me up a little bit. Now, another menu is showing under the sidebar widget. The ’logged-in’ menu. I am using sydney theme and I have tried to no avail to remove this unnecessary menu. Any idea on how I can make it not display?

    • WPBeginner Support

      Hi Pet,

      Please check Appearance » Widgets page to see if you have a custom menu added as a widget there. If it is there then you can just delete that widget.

      Administratör

      • Pet

        What genius! It worked! Thanks for the wonderful tip!! :-)

      • Jomcy Johny

        Me too have the same problem..Please help me..but I dont have widgets..Thank you..!

  9. Alex Hammerschmied

    Works like a charm…
    Thanks for that.
    Btw i love theses short tutorials ;)

  10. giovanna

    Hi can you help me please? I have another trouble please? I need to hide one menu to all and allow only the vendors to see what I have to do please? what is the specific code i have to use please?

  11. ericlee

    When you modify the functions.php like so- wouldn’t it get wiped when you upgrade your WP next version ?

  12. Ramona

    Will this work for a Buddypress install? Thanks.

  13. Nikhil Chaudhari

    the function set secoundary menu also? i only want to set primary menu. how to do that

  14. Nikhil Chaudhari

    this above function set secondary menu all i want to set only header menu?
    how to do that

  15. Asfaha

    Hi,

    thanks a lot for this solution, I’ve applied and woks perfect and saved me installing one more plugin.

  16. Shafaq

    this is the code for replacing existing menu to logged user menu by addming location top-menu and with menu loggedin no need else statement with this

    add_filter( ’wp_nav_menu_args’, function ( $args )
    {
    if( is_user_logged_in() && $args[’theme_location’] === ’top-menu’ ) {
    $args[’menu’] = ’loggedin’;
    }
    return $args;
    });

  17. Ashraf Ali

    ———————————————————–
    function my_wp_nav_menu_args( $args = ” ) {

    if( is_user_logged_in() ) {
    $args[’menu’] = ’logged-in’;
    } else {
    $args[’menu’] = ’logged-out’;
    }
    return $args;
    }
    add_filter( ’wp_nav_menu_args’, ’my_wp_nav_menu_args’ );
    ———————————————————–

    Now how do i get it to work with

    —————————————————

    ———————————————————————————————————————-

    Please Advice

  18. Iqbal Mahmud

    If I want to hide a page from logged out user from a single menu what have to do?

    • Kasper

      You can lock pages to hide them from logged out users. There are several plugins that make this very easy to do. Users Ultra comes to mind.

  19. Zev

    Everything worked perfectly.

    However, I still have the issue of a repeated primary menu in the secondary navigation menu section which I can’t seem to remove (I don’t have a secondary menu set up).

    • Vince

      I’m having the exact issue. The change reflects in the secondary menu location out of nowhere and I too don’t have a secondary menu setup. :/ Please advice how to deal with it.

      Thanks in advance.

  20. Chiranjeevi Vinodkumar

    LISTEN!!!

    Most of us, uses themes.
    So first go to the functions.php of your theme.
    Search with navigation as keyword.

    In case of Shopkeeper theme..

    ==================================================================
    register_nav_menus( array(
    ’top-bar-navigation’ => __( ’Top Bar Navigation’, ’shopkeeper’ ),
    ’main-navigation’ => __( ’Main Navigation’, ’shopkeeper’ ),
    ’footer-navigation’ => __( ’Footer Navigation’, ’shopkeeper’ ),
    ===================================================================

    This is how you look.. so pick the one which is primary, In my case, Its ”Top Bar Navigation” hence used ”top-bar-navigation”

    I used the following code and worked like a charm!!!

    This is my way of thanking the author.

    Good day !!

  21. Ann Novakowski

    Here’s what worked for me with WP . I used this to create a specific primary menu for logged-in Buddypress users. It will NOT affect my footer menu OR social media menu for any visitors, so everyone sees the same secondary menus regardless of whether they’re logged in or not. This is based on all of the comments above (HT to Fransiska!).

    Added the following to my Child Theme’s functions.php file:

    // CHANGE MAIN MENU =ONLY= IF MEMBER IS LOGGED IN

    function my_wp_nav_menu_args( $args = ” ) {
    if ($args[’theme_location’] == ’primary’) {
    if( is_user_logged_in()) {
    $args[’menu’] = ’logged-in’;
    }else{
    $args[’menu’] = ’logged-out’;
    }
    }
    return $args;
    }

    add_filter( ’wp_nav_menu_args’, ’my_wp_nav_menu_args’ );

    • Oliver

      Don’t know what happened why my comment, but –> ” <– these are correct!

    • fidel toro

      thanks!! help me a lot

  22. Matthias Campbell

    Hello,
    I added this code (probably wrongly) in my functions.php within my theme in wordpress editor and now I have a constant 500 server error. Even after removing the code.

    Before this i attempted to create a site specific plugin but that didnt work. Could you please tell me if the snippet requires an opening and closing bracket?
    If so how do i do that?
    My host cant help me now and they’re requesting I pay a programmer to help me for 50Eu per hour. Please help me. Its urgent.
    I am still logged into wordpress but what ever I click I get the 500 error with this specific error.
    PHP Parse error: syntax error, unexpected ’}’ in line 1194.
    This is because I pasted the snippet after all the text in the functions.php file.
    I then removed the snippet to see if that would fix it, via editor and FTP and I still get the error.
    I look forward to hearing your response.
    Kind regards

    • WPBeginner Support

      It depends on where you are adding the code. If there is a closing PHP tag before it then you need to add a php start tag like <?php

      If this code is the last thing in the functions file then you don’t need to add a closing tag.

      Administratör

  23. Hubert

    If you have multiple menu locations and want to apply different menus for each location you can use the code bellow:

    function my_wp_nav_menu_args( $args = ” ) {

    // Primary menu location
    if( ’primary-main’ == $args[’theme_location’] ) {

    if( is_user_logged_in() ) {
    $args[’menu’] = ’Primary-Logged-In’;
    } else {
    $args[’menu’] = ’Primary-Logged-Out’;
    }

    return $args;
    }

    // Secondary menu location
    if( ’secondary-menu’ == $args[’theme_location’] ) {

    if( is_user_logged_in() ) {
    $args[’menu’] = ’Secondary-Logged-In’;
    } else {
    $args[’menu’] = ’Secondary-Logged-Out’;
    }

    return $args;

    }

    }
    add_filter( ’wp_nav_menu_args’, ’my_wp_nav_menu_args’ );

    • Haji

      This does not work, anyone that does know the proper code if you have 2 or more menus?

  24. Ravikant

    Perfect bro .Its work …. awesome work

  25. Leopold

    This was almost too easy!
    Thanks alot for the simple article.

    In this way I don’t have to install any plugin..

    • Chris

      Hi Gaurang,
      I’m curious to know why you feel using the plugin is better, than coding the functions.php file? I was told a while ago to watch how many plugins are actually used for a wordpress site, and the code above seems simple enough; minus the having to monitor every time your theme updates….

      Thanks,

  26. Rub

    Great, how I can use it to show menu for logged user that have certain role?

  27. Kit Johnson

    This worked so simply and neatly. I didn’t think it would be this easy. Thank you!

  28. Jason Sisson

    this is awesome tried it. works. but i also would like to redirect by role
    is that simple or much harder

  29. Ryan R. Bayne

    Thanks. Working with menu functions for the first time.

    Creating the WTG Portal Manager plugin which will allow a portal to be defined very quickly. Every portal having it’s own menu. The plugin make the relationship between portal and menu clearer plus provide other unique options.

  30. veer2412

    how can i show different posts to different users??

  31. veer2412

    thnkx for the help.. but what if i want to show different users different posts on my site.. is there any way to do that using coding??

  32. WPBeginner Staff

    Under Appearance > Menus you need to choose a location for your menu. Seems like there are two areas on your site where you can add menus. So you need to create two different menus and then assign a location to them.

    • Heather Gile

      what would the revised code for this be, if there was a distinction of ’Primary’ and ’Top’?
      $args[’primary-menu’] = ’logged-in’;
      $args[’top-menu’] = ’logged-in’;

      else

      $args[’primary-menu’] = ’logged-out’;
      $args[’top-menu’] = ’logged-out’;

      ?

    • Kyle

      WordPress will not let me put 2 menus in my ”top header” location. The code you provided works, but it changed ALL of my menus to the logged in or out, and is not displaying my normal nav menu

  33. b2995

    I have a top menu as well as a site menu (under logo). How would I change the code to switch just that top menu. Right now, ALL my menus change.

  34. Rob

    OMG, this made me laugh it was so simple… thank you!

  35. Melih

    Illustrative and easy, thank you so much.

  36. Rohit Gahlot

    Working .. :D Thanks a lot

  37. Seth

    Thanks for this.

    On the homepage, menu names that have a submenu (a drop-down menu) do not show the drop-down. When I go to any other page that isn’t my homepage, this isn’t a problem, and all menu items are shown.

    This is the case on the homepage for both logged-in and logged-out items. Any idea how to fix this? Thanks

    http://www.viridianmgt.com/wordpress

  38. Wouter Bredenbeek

    Only changing a certain menu can be achieved by changing $args[’menu’] = ’logged-in’;
    into $args[’secondary-menu’] = ’logged-in’; for example. Should do the trick!

    • DANIEL

      That code doesn’t work. I have registered a ’primary-menu’ and ’secondary-menu’ and trying the function provided with your change in args no menú changes.

      I fix this using this code:

      function my_wp_nav_menu_args( $args = ” ) {
      if ($args[’theme_location’] == ’secondary-menu’) {
      if( is_user_logged_in()) {
      $args[’menu’] = ’logged-in’;
      }else{
      $args[’menu’] = ’logged-out’;
      }
      }else{
      $args[’menu’] = ’Principal’;
      }
      return $args;
      }

      add_filter( ’wp_nav_menu_args’, ’my_wp_nav_menu_args’ );

      NOTE: ’ Principal is the name of the primary static menu.

      • Rory PQ

        So close, both my footer and main menus are changing. I’m trying to just change my footer menu. I’ve tried so many variations of this code but no dice. Any solution thoughts?

        When I inspected my theme with Firebug it said my footer is ”id=footer-nav”. Should I use this name rather than ”secondary-menu”?

        Many Thanks

  39. lemonthirst

    Hurray! Finally found it, it never crossed my mind that this simple function would ease up my work so much.
    Thank you guys!

  40. Grant

    When I try to enter the code into the functions.php file it gives me the following error:

    Parse error: syntax error, unexpected ’03’ (T_LNUMBER) in /home/grantkessler/public_html/wp-content/themes/GameNews/functions.php on line 201

  41. Stevie Allison

    Perfect just what I was looking for. i´m going to try it now. Thank You

    • Stevie Allison

      It works perfect. Thank You

  42. Alex

    Big thanks for sharing code but it really add this menu in all areas! Is there a way to show it only in specific menu ?

  43. shanewaj rahman

    Thanks,
    You made it so easy.

  44. zaman

    I created site specific plugin and menu’s working fine, but my footer menu is also changed, its not showing the one i selected but the logged-in or logged-out.

    • WPBeginner Support

      Zaman WordPress menus have locations assigned to them. Make sure you are using a different menu for the footer menu location.

      Administratör

  45. Grant

    Hi when I try to put in the code it messes up my site completely giving the error message:

    function my_wp_nav_menu_args( $args = ” ) { if( is_user_logged_in() ) { $args[’menu’] = ’logged-in’; } else { $args[’menu’] = ’logged-out’; } return $args; } add_filter( ’wp_nav_menu_args’, ’my_wp_nav_menu_args’ );
    Warning: Cannot modify header information – headers already sent by (output started at /homepages/5/d156331781/htdocs/reviewthegame/wp-content/themes/Made-Theme/made/functions.php:12) in /homepages/5/d156331781/htdocs/reviewthegame/wp-includes/pluggable.php on line 899

  46. joseph

    Is there a way to only apply this to a specific menu?
    I have tried this:
    if( $args->theme_location == ’primary-menu’ ) {
    //Code here
    }
    but it doesn’t work. any ideas how to achieve this?

    • shanewaj rahman

      This is what I have done to over come two menu problem.
      I have removed that function and put this code in the header.php
      where I was calling my menu.

      false,
      ’menu_id’ => ’nav’,
      ’menu’ => ’Registered’,
      ’items_wrap’ => ’%3$s’)
      );
      }
      else
      {
      wp_nav_menu( array(’container’ => false,
      ’theme_location’ => ’primary’,
      ’menu_id’ => ’nav’,
      ’items_wrap’ => ’%3$s’,
      ) );
      }?>

    • Fransiska

      Use

      if ($args[’theme_location’] == ’primary’)

      instead and it’ll works

      • Gerald Tyler

        Fransiska, can you explain your suggestion further? I have several sub-menus I’m putting in sidebars, and the solution on this page makes all those short menus now full menus with all of the Primary menu names, none of my various custom menus. Your suggestion sounds like we can apply this trick to just the primary menu position, not the sidebars. Make sense? Can you provide the full code? I’m not having any luck guessing on how it goes together.

        joseph
        Oct 25, 2013 at 1:16 am

        Is there a way to only apply this to a specific menu?
        I have tried this:
        if( $args->theme_location == ‘primary-menu’ ) {
        //Code here
        }
        but it doesn’t work. any ideas how to achieve this?

        Fransiska
        Jan 31, 2014 at 2:53 am

        Use

        if ($args[‘theme_location’] == ‘primary’)

        instead and it’ll works

  47. Jamie Mannion

    Great tip, that came at a perfect time in my site development.

    Works a treat! I think I’ll extend on this to show different menus for different user_meta.

    Thanks for sharing!

  48. karen

    Hi, thanks for that, most helpful. though I’m still not sure where to put the code?
    (After creating the menus, add this code in your theme’s functions.php file or a site-specific plugin) – where is the functions.php file?
    cheers

    • WPBeginner Support

      Go to Appearance » Editor you will see functions.php file in the list of files on your right hand. However, if you do not see a functions.php file there, then this means you are using a theme framework or a child theme. In that case you need to create a site specific plugin for your site and add this code inside that plugin. See our guide on site-specific plugin.

      Administratör

  49. Cathy Earle

    Great tip. Looking forward to using it in an upcoming design.

Lämna ett svar

Tack för att du väljer att lämna en kommentar. Tänk på att alla kommentarer modereras enligt våra policy för kommentarer, och din e-postadress kommer INTE att publiceras. Vänligen använd INTE nyckelord i namnfältet. Låt oss ha en personlig och meningsfull konversation.