Loop with multiple custom field in different div with bootstrap 5 - wordpress

Ok guys.
This is the first time I've posted here on stackoverflow.
I think it's not such an impossible thing.
My client would like this page here, which I did in html5 and php via wordpress, to become interactive through the custom fields.
what the client want
I searched for many guides for a day, but I found nothing.
I would therefore need a code where the customer through the wordpress management system can load the custom fields and the gray blocks with the custom fields appear on the screen.
I tried this code, but to no avail:
<div class="col-lg-3 col-md-4 col-sm-6">
<div class="bg_light_grey block_informazioni mx-auto info mb-5">
<div class="block_informazioni_child">
<i class="far fa-dot-circle dark_blue"></i>
<h3 class="semibold dark_blue mt-2">
<?php echo "".get_name($post->ID,'',true); ?>
</h3>
<h4 class="regular dark_blue">
<?php echo "".get_post_meta($post->ID,'',true); ?>
</h4>
</div>
</div>
</div>

Related

Input type - Contact form 7

I have a newsletter sign up form on a site and I can't seem to figure out why the email section input type is set to 'tel' meaning on mobile, users get only access to the numerical keypad and not the actual keyboard. I am quite new to this, which is why I am after some help.
It is the homepage to, the subscribe form down the bottom: https://www.australianwildlife.org/
Can someone please advise how I might be able to change it to input ="email"? I have attached a screenshot where I can see it is set to input="tel"
Here is the contact form 7 code:
<div class="form-content">
<div class="subscribe_form">
<div class="row">
<div class="col-md-4 col-lg-3">
<div class="form-group mb-20">
[awctext* first-name label "First name"]
</div>
</div>
<div class="col-md-4 col-lg-3">
<div class="form-group mb-20">
[awctext* last-name label "Last name"]
</div>
</div>
<div class="col-md-4 col-lg-3">
<div class="form-group mb-20">
[awcemail* email label "Email"]
</div>
</div>
.col-md
[submit class:bttn class:secondary-alt1-bg class:btn class:radius-none class:white-color class:submit-btn class:ripple "Subscribe"]
Site
I think this is part of your theme, not so much part of contact form 7. The shortcode starts with awc, which should stand for Australian Wildlife Conservancy. Somewhere in the theme’s files these shortcodes are added. The bug should be in there.
You can start searching for awcemail on your file system in both the wp-content/themes folder and wp-content/plugins folder (since it might have been implemented in a plugin). If you cannot find it, try searching for the add_shortcode and see whether you can find out whether awcemail is a shortcode and where it is added. You can also do a file search for the following:
type="tel"
type='tel'
If that doesn't work you should found out how the code for your contact form is actually parsed. If you know which file(s) are responsible for that you might find in them where the [awcemail part is converted to the actual html.
If that doesn't work, get in contact with the developer, or post (parts of) the code in a github, for example, so we can examine it. I'm sure that if you post all the code, we are able to help you fix this bug, but that is up to you, of course.

WordPress Front Page not working

I'm very confused here. I am very familiar with Wordpress, however, I cannot get the home page of my site to display the HTML and PHP etc that is currently in my home page template.
I have gone to settings - reading and set the home page to a static home page under 'Home', which as you can imagine has the page template for the HTML/PHP I want to display.
I was wondering if anyone knew of any other external factors that affect the home page and the templates being brought through on my other pages are actually working - it's very odd.
I have checked the DOM on the browser multiple times, using Chrome, however none of the divs etc are showing.
Here is the code for the front page so far:
<?php
/* Template Name: Home Page Template */
?>
<?php get_header(); ?>
<div class="header_banner">
<div class="image_content">
<div class="image">
<video playsinline="" autoplay="" muted="" loop="" poster="" onplaying="this.controls=false">
<source src="<?php echo get_stylesheet_directory_uri(); ?>/videos/video_background.mp4">
Your browser does not support the video element.
</video>
</div>
</div>
<div class="main_content center center_absolute">
<h1>I create and design websites.</h1>
<h2>I specialise in HTML, CSS, jQuery and Wordpress.</h2>
</div>
<div class="center_scroll">
<div class="scroll">
<i class="fa fa-chevron-down" aria-hidden="true"></i>
</div>
</div>
</div>
<?php get_footer();
One possibility is that the page you selected in the dropdown menu under Settings > reading does not have "Home Page Template" template selected under "Page Attributes" Meta Box.
You could rename the file to page-home.php since this template will only be used once on your site. Maybe this helps.

Add GA Experiments to .php for specific homepages for an a/b test

I have been really struggling with something, wondered if anyone could help.
I am trying to run a Google Experiment to A/B test my homepage to a variation homepage that i've already created in Wordpress.
I need to add the Google analytics code to the of the two homepage's, i think i need a php code to target the two homepage's.
I previously used (many) Wordpress plugin's and each plugin wouldn't let me specify where the code hit, it just ran the code across the whole site, so I was getting the variation homepage on every link i clicked through on my site.
This is my header.php and i think i need a php code to specify the two homepage's to attack with the Google experiment code?
<header class="banner container" role="banner">
<div class="row">
<div class="col-lg-12">
<a class="brand" href="<?php echo esc_url(home_url()); ?>/"><?php bloginfo('name'); ?></a>
<nav class="nav-main" role="navigation">
<?php
if (has_nav_menu('primary_navigation')) :
wp_nav_menu(array('theme_location' => 'primary_navigation', 'menu_class' => 'nav nav-pills'));
endif;
?>
</nav>
</div>
</div>
</header>
Thanks in advance, any help would be much appreciated.
Matt (SEO and CRO intern)

When I'm logged in I can see elements that disappear when I'm not logged in as Admin

I changed some sections in my Wordpress website and also added some.
The really strange thing is that when I am logged in and I see the website in the logged in view I can see the sections but when I'm not logged in I can't see that, every change at the website is not visible.
I empty the cache and tried to change some texts and every change was visible.
The plug-ins installed are:
Akismet
Contact Form 7
iThemes Security
Roots Rewrites
Soil
W3 Total Cache
WordPress SEO
WPML Media
WPML Multilingual CMS
WPML String Translation
I can't understand how resolve this problem :(
With these informations, we can only say that you must look at Wordpress Codex:
http://codex.wordpress.org/Function_Reference/is_user_logged_in
Maybe you accidentally hid some sections for not logged in users. If not, please be more spesific about your question.
Sorry, I can't see the "user logged in" function.
the code that I add is this
<div class="container">
<div class="row">
<div class="col-sm-8 col-sm-offset-2 col-md-6 col-md-offset-3">
<hr/>
<h2 style="text-align: center;"><?php _e('Charter of services','fratesole'); ?><br/>
<small><?php _e('Private Hospital','fratesole'); ?></small></h2>
<p style="text-align: center;"><a class=" btn btn-primary" href="#" target="_blank" ><?php _e("Download Pdf","fratesole"); ?></a></p>
<hr class="in-btn"/>
</div>
</div>
</div>
</section>

Wordpress, short codes wont work in custom theme I made

I have started to learn how to make custom themes for wordpress and have problems when installing plugins that have shortcodes. I try to add a shortcode ( usually a form plugin, i have tried two different ones and also an ecwid shopping cart yet no shortcodes have worked, yes the plugins were activated) by creating a page and using the visual/html editor. When i check the page it does not show anything. here is my single.php..
<?php get_header(); ?>
<body>
<div id="maintopwrapper">
<div class="container" id="topwrapper">
<div class="row">
<div class="span8">
<?php while (have_posts()) : the_post(); ?>
<!-- Content Here -->
<div class="row"><div class="span8 greygrad round">
<div class="padding"><div class="content" style="margin-top:25px;"><?php the_content(); ?></div></div></div></div>
<div class="row margintop"><div class="span8 greygrad round">
<div class="padding">
<?php comments_template() ?>
</div></div></div>
<?php endwhile;?>
</div>
<?php get_sidebar(); ?>
</div>
</div>
</div> <!-- end of maintop wrapper-->
<?php get_footer(); ?>
It should show since the_content() is there right? Let me know if you need anything else for me to share. Plugins I tried a gravityforms, ecwid shopping cart, and quforms..all of which the shortcodes do not work. The only way I got one of them to work is by creating a custom page theme and adding hardcoded php to call the function but I rather have shortcodes working so the theme is usuable by people who dont code.
For live example: http://modernlogic.co/wp
the "contact" page in menu is actually hardcoded in the custom theme which is not using the shortcodes like I want in the "sample page" in menu
Thanks in advance
I am a idiot... I realized that I had no page.php and so when I tried adding the shortcode to a page it referred to the index.php instead of page.php(since there was none) and so it only showed the excerpt and not the content. I figured this out because I tried adding the shortcode to a post and so when it went to single.php, the shortcode worked since it has content and not just excerpt. oh well I guess trial and error.. Thanks for trying to help me anyway

Resources