Forum Replies Created

Viewing 15 replies - 46 through 60 (of 73 total)
  • Thread Starter traveler

    (@visualeight)

    Hello customfit,
    Please do, I never found a solution to it, tried different PHP versions 7.0-7.2, none of it solved the issue for me.

    The site I posted about is hosted on WPengine, what host are you using? I’ve wondered if it had something to do with the caching object they use but I haven’t figured it out yet.

    I ended up moving back to single page forms to avoid the need to move data with the variables.

    @zodiac1978 YES! That worked for me as well. I appreciate your response. My CF json files were all coming back with mime type text/html. Adding that to functions.php solved the issue.

    @zodiac1978 Any chance you could post your code again, the one @dmatamales said worked for him? Your original uploads are not visible anymore.

    Thanks.

    Thread Starter traveler

    (@visualeight)

    Hey Joy, thanks. I think I’m just going to add it conditionally on the front end if the custom field exists. Thanks.

    If you want to have a link for “Story” in the left-hand vertical navigation, then yes, you’ll need to create a post type with CPT UI. You can use that field group on existing post types already without using CPT UI.

    Thread Starter traveler

    (@visualeight)

    Thanks Edward, that was my thought on this, just didn’t know if doing a direct export of the Joomla article table into at CPT table made more sense.

    Jan, I would argue differently, since my question was about developing custom post types in WordPress as well as database design and management.

    Just to add, I had to change another line in the same file referenced above by @mucha, around line 926 I had another instance of the ..( &$scripts ). So change:
    function wp_default_styles( &$styles ) {}
    becomes:
    function wp_default_styles( $styles ) {}

    This and the above fixed both errors I had after moving to PHP 7.2 on WPengine.

    Added this to .htaccess and it fixed it in all my staging installs:

    php_flag display_errors off

    Sounds like your CSS is off and needs to be adjusted.By default div tags and most block elements that I know of are 100% width of their parent, so you need to use your browser inspector to find the HTML elements surrounding this widget area and then use CSS to take off any left/right padding or margins, and make sure all parent elements have 100% width.

    Thread Starter traveler

    (@visualeight)

    Thanks for your reply, it didn’t fix it either unfortunately.

    Hey Divvy,
    I’m not familiar with the above snippet you included, but if you’re already inside the
    <?php ?> tags then you just would right it in the template code. I typically will save the custom field into a php variable on that specific template file that I’m working on changing in a manner like:
    $custom-field-var = get_field('custom_field_name');

    Then when I need the exact input from that field in my page template I’ll echo that variable within php tags:
    <img src="<?php echo $custom-field-var ?>" />
    I would use the above if I needed that src url from the backend into the front end. I would do this to create a <a href> link instead of having some other site admin manually wrap the <a href> around an element. From my experience, the less work a site admin has to do with the WYSIWIG editor’s buttons/inline styles the better.

    So having said all that, since you want to put a custom field into an html string, I would imagine within the ” marks that delineate the string you’ll need to use an opening and closing php tag since within the string and concatenate it with the string by opening and closing the string quote marks, inserting the variable/custom field, and then finishing the string by concatenating it with the rest of whatever you need in that file above. Look up Php string concatenation and you’ll see how to do it.

    • This reply was modified 8 years, 11 months ago by traveler.
    • This reply was modified 8 years, 11 months ago by traveler.
    traveler

    (@visualeight)

    Hey Clement, let me explain what I’m doing and perhaps it will influence your planning on this. But, I think your best option would be to take out the content that’s hardcoded into the theme and add widgets. I did this to a custom theme recently that had a hardcoded menu, and I replaced the hardcoded menu’s with widget shorcodes so the WP core menu system is capable of managing the individual links in each menu. Or, if you don’t have that many languages to work with, perhaps creating a subdirectory for each translation, or add the non-English language sites as a different install in a folder like: http://yoursite/spa for a spanish language. Then you can simply translate the copy in the theme according to that langauge.

    I have to make a site with all content/pages available in 8 languages. The site user needs to be able to select what language they want when visiting the home url. I also want to have the ability to change the language from a dropdown that is always present on the site, perhaps in the top-right corner. Furthermore, it’s carefully worded legal copy, so I also can’t rely on a plugin to translate, I will be provided all of the translations for the site.

    The site will have a custom post type that will be used for 200 different people because I do not want to create each of the 200 posts in 8 languages, that’s 1600 posts! So my thought was when making the custom post type, to give each required field, 8 fields, so each language is represented in it’s own field. This way, there’s only 200 posts.

    So in theory, if a site user selects “Armenian” as his/her language, then when they enter the site they’re only delivered the custom fields from each post holding the Armenian language copy. It’ll be a custom theme, and a fairly simply layout, so ideally this will work. If you have any thoughts to add, please do.

    traveler

    (@visualeight)

    Btw, the plugin you mentioned, Web Directory 2.0, will work for what I’ve been looking for, so thanks @ultramel1987

    • This reply was modified 9 years ago by traveler.
    traveler

    (@visualeight)

    If you need to add custom fields to accomplish this, I love Advanced Custom Fields which I imagine you should be able to add to each respective templates here, the one used to collect the information and the other used to display it on the site. It sounds like you just need additional simple text fields that they can overwrite as needed.

    traveler

    (@visualeight)

    You have to call that custom field into your theme/template file.

    You can pull any custom field into your theme/template by doing this:
    <?php the_field(''); ?>

    You’ll need to wrap that in whatever HTML tag you want.

    You can find more here: https://www.advancedcustomfields.com/resources/hiding-empty-fields/

Viewing 15 replies - 46 through 60 (of 73 total)