Viewing 15 posts - 1 through 15 (of 20 total)
  • Posted in: Flexform
  • #204107
    trs-gretar
    Member
    Post count: 14

    I need help with the code snippet. I have a php code block I would like to use on the frontpage. I can’t find information or help about this issue anywhere. Is it possible for me to use php in this block and if so then how do I do it ?

    <?php ?> is not working…

    #204114
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    I guess you are using this asset https://www.dropbox.com/s/jkhzi84f11d6b6w/Screenshot%202015-08-14%2014.20.59.png?dl=0

    Try to don’t include the php tags

    -Rui

    #204136
    trs-gretar
    Member
    Post count: 14

    You mean like it is on the site now ? I removed <?php and ?> but it’s not working.

    #204138
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    But do you get any error?
    -Rui

    #204141
    trs-gretar
    Member
    Post count: 14

    No errors, you can see how the code appears on http://www.barnaskolinn.is on the right (red letters).

    #204156
    trs-gretar
    Member
    Post count: 14

    I managed to fix this by setting up PHP code for posts plugin and using the shortcode to display this on the site.

    #204158
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Great that you sorted it. I also didn’t manage to use the code snippet in my site.
    Will check this with the development team.

    Thanks

    -Rui

    #204162
    trs-gretar
    Member
    Post count: 14

    One more thing though I would like to know if possible. Can I move the dates for the posts to the top of the post ? As you can see on the frontpage the dates are below the text…

    #204168
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    Only customizing the code in the file recent-posts.php located at flexform/includes/page-builder/composer/lib/shortcodes

    -Rui

    #204169
    trs-gretar
    Member
    Post count: 14

    Ok thank you, I will take a look at that.

    #204173
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Great thanks to Rui.
    Mohammad

    #208494
    trs-gretar
    Member
    Post count: 14

    Hello again

    The solution I managed to set up is no longer working and I can’t figure out why. The PHP code is working on another site so I know there is no error in the code but the future posts are not showing up on the frontpage.
    I have updated the theme to the latest version and tried to use the code block in the Swift Page Builder but that is still not working.
    Any chance you guys can help me with this ?

    #208537
    David Martin – Support
    Moderator
    Post count: 20834

    Hi,

    Did you make your template changes within a child theme?

    When you run the update your files are updated meaning any modifications are overwritten.

    Thanks,
    David.

    #208814
    trs-gretar
    Member
    Post count: 14

    Hi. I’m not using a child theme and I know the updates I make are overwritten when I update the theme.

    The thing is I did not make any changes to the theme file. The PHP code I’m using is set up through this plugin https://wordpress.org/plugins/php-code-for-posts/ and then I insert a shortcode for the PHP code in the theme. But its not working on this page and like I said I have tested this on another site with another template and the code works there.

    #208841
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    My colleague will assist you shortly.
    Thanks
    Mohammad

Viewing 15 posts - 1 through 15 (of 20 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register