Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #431862

    Hey there,

    First of all : thanks for enfold, such a great theme to work with :)

    Here is my issue : I use a lot of php in my pages.
    For that, I use “insert_php” plugin and I just have to put my php code inside these tags : [insert_php] and [/insert_php].

    QUESTION 1 : is this a decent way of working with php inside enfold ? Would you advise something else ?

    Of course, when editing a text block, I have to work in the “text view” instead of the “visual view”.
    HOWEVER, when I switch from text to visual, and back to text, it breaks the code : for example ‘=>’ becomes ‘ = & g t ; ‘ (without spaces)

    And whenever I save the page (or just open the page editor), it displays the “visual” mode => if I want to edit my code, everything is messy when I switch to the “text” mode.
    Therefore, every time I want to change my code, I have to :
    – erase all of my code in the page
    – use a text editor (koomodo) to edit the code
    – paste the code in the page,
    That is really user-unfriendly, especially in pages with several PHP blocks.

    QUESTION 2 : Is there a (much) simplier way of working with php code inside pages ?

    Thanks in advance,
    JM

    • This topic was modified 9 years, 8 months ago by jmaubert.
    #432570

    Hi jmaubert!

    Thank you for using Enfold.

    You can try the code block element. It’s not advisable to add php codes inside the wp editor even when you’re using a plugin.

    Cheers!
    Ismael

    #435268

    Hi Ismael,

    You can try the code block element.

    Unfortunately, it prevents the php shortcode from working (however, other shortcodes like the icon from enfold works inside the code block).

    It’s not advisable to add php codes inside the wp editor even when you’re using a plugin.

    Ok, but is there another way to do it ?
    Maybe I don’t fully understand, but are you saying that I should not use php ?
    But how can I personnalize my web site ?
    for example I have a profile page, where I need to retrieve several informations about the members.
    How can I do that without php in the page code ?

    Thx for your answers.
    JM

    #436571

    Hi!

    I’m not saying you shouldn’t use php, it’s just not advisable to use php inside the wp editor because it is meant to be use as normal text and html editor. And what if you change themes or decided to migrate to a different cms, what will happen to the multiple pages with multiple php codes? Maybe, it’s better if you use custom fields. Refer to this link: https://codex.wordpress.org/Custom_Fields

    You can add the modifications directly in the the template files like page.php, single.php or if you built the page with the advance layout builder, modify the template-builder.php file.

    Best regards,
    Ismael

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.