Find answers, ask questions, and connect with our
community around the world.

Activity Forums Web Design Can I add the same php code twice with different name?

  • Can I add the same php code twice with different name?

    updated 2 weeks, 6 days ago 0 Member · 1 Post
  • Maverick

    Member
    October 28, 2019 at 1:47 am

    Hi, in WordPress, I use a plugin for my mobile theme, so I have 2 themes (1 is plugin). I added a code in functions.php which excludes a certain catogory from showing on home page. The code isnt activated on my mobile theme when I add it to my desktop theme, so I have to add it in both functions.php, but when I do this it says “cannot redeclare… precious declared in…”, so I simply changed the function name 1 character and it seems to work now, but I wonder if this won’t cause any conflicts as the code itself is the exact same, except the name. Is this the way to fix it or it there another way? – by hq overview Izzy9595 – –

Reply to: Maverick
Your information:

Cancel
Original Post
0 of 0 posts June 2018
Now