Foundation5 Tabs - Uncaught Error Type? - html

Good day all, I hope everybody is well.
I am having some troubles executing Foundation 5 Tabs to my site.
I came cross this: http://foundation.zurb.com/forum/posts/856-foundation-5-tab-issues and found similar output, just that mine are not working.
It seems that something blocked my script. I tried to moved it to my header.php, different parts of footer.php, and single.php, but no luck.
Images of output can be seen at the bottom.
Hope someone can help me out with this.
<?php /* single.php */ ?>
<?php get_header(); ?>
<body>
<section class="common-title-wrap">
<div class="row"><h2><?php single_post_title(); ?></h2></div>
</section>
<section class="common-section">
<div class="single-column">
<div class="side-nav">
<?php
$options = array(
'sort_column' => 'menu_order',
'menu' => 'Equipment Menu',
'container' => false
);
wp_nav_menu($options); ?>
</div>
<div class="tab-column">
<ul class="tabs" data-tab role="tablist">
<li class="tab-title active" role="presentation">Equipment</li>
<li class="tab-title" role="presentation">Equipment Rental</li>
<li class="tab-title" role="presentation">Equipment Purchase</li>
<li class="tab-title" role="presentation"><a href="#panel2-4" role="tab" tabindex="0" aria-selected="false" aria-controls="panel2-4">Video<a></li>
</ul>
<div class="tabs-content">
<section role="tabpanel" aria-hidden="false" class="content active" id="panel2-1">
<p><?php echo the_field('equipment'); ?></p>
</section>
<section role="tabpanel" aria-hidden="true" class="content" id="panel2-2">
<p><?php echo the_field('equipment_rental'); ?></p>
</section>
<section role="tabpanel" aria-hidden="true" class="content" id="panel2-3">
<p><?php echo the_field('equipment_purchase'); ?></p>
</section>
<section role="tabpanel" aria-hidden="true" class="content" id="panel2-4">
<p><?php echo the_field('equipment_video'); ?></p>
</section>
</div>
</div>
</div>
</section>
<?php get_footer(); ?>
<?php /* Template Name: Footer */ ?>
<footer>
<div class="site-footer">
<div class="copyright">
<p>Copyright ©. All Rights Reserved.</p>
</div>
</div>
</footer>
<?php wp_footer();?>
<script src="/js/vendor/jquery.js"></script>
<script src="/js/foundation.min.js"></script>
<script src="/js/foundation/foundation.tab.js"></script>
<script>
$(function() {
$( "#tabs" ).tabs();
});
</script>
<script>
$(document).foundation();
</script>
</body>
</html>

Your script locations aren't pointing correctly. When you run scripts using that format "/js/something.js", you're telling the server to go to the root folder, find the 'js' folder and then run the file you've specified. With your WordPress install, this is in domain.com/js/something.js, not in wordpress.com/wp-content/themes/theme-name/js/something.js where everything is referenced through.
You need to do 1 of 3 things:
Move your JS files to the actual root of the domain in a folder called 'JS'. I don't really recommend this solution as you're then separating your JS from your theme and adding files to the root, but this would fix your problem easily.
Use the built-in WP functions like get_template_directory(), get_stylesheet_directory(), and other similar functions. With these, you can make your paths look like <script src="<?php get_theme_directory(); ?>/js/vendor/jquery.js"></script> and it'll point to the right spot. Look at the WP documentation and find the one appropriate for your situation.
Use the wp_enqueue_scripts() functions and features to load your scripts. This is the best way to do this and is the way you should be handling this. The benefit of this method is that WP will watch for scripts so none of them load multiple times (unnecessarily) and it'll ensure that dependencies for scripts are met (foundation.js loads after jquery.js and any plugin JS, etc.). This is the most difficult method, but it's not really that hard and you really have to know how to do this if you're going to be developing WP themes.
Good luck!

Related

ACF Repeater displays correct when logged in but empty for guest

I have an ACF repeater setup to show a bunch of images with links. Works perfectly when logged in, but when viewing the same page as a guest it shows empty html without the urls for images/links e.g:
<a href="” target=”blank”>
<img src="” width=”260″ height=”130″>
I am using PHP widget plugin, embedded in an elementor page section. ACF code is added to php widget (don't usually have problems with this method)
Code below, as mentioned works perfectly for a logged in user, but when logged out all you see is "<a href="” target=”blank”>
<img src="” width=”260″ height=”130″>"
```` <div id="supplier-container">
````<?php while (have_rows('suppliers')): the_row(); ?>
```` <div class="supplier-single">
````<?php if (get_sub_field('supplier_link')): ?>
```` <a href="<?=get_sub_field('supplier_link')?>" target="blank">
````<?php endif; ?>
```` <div class="image-container">
```` <img src="<?=get_sub_field('supplier_image')?>" width="260" height="130">
```` </div>
```` </a>
````<?php endif; ?>
```` </div>
````<?php endwhile; ?>
```` </div>
````<?php endif; ?>

Social share buttons on success.phhtml magento2

Can anyone guide me how can i add social share buttons in Magento 2 ?
In success.phtml i have discounted code on that . I want to just send that on social share.
Below is the file that want create. If any module or custom code then help me anyone?
SHare your code i have already done but i am getting issue how to add below sharing option using custom coding.
Below is the success.phtml file
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
<?php /** #var $block \Magento\Checkout\Block\Onepage\Success */ ?>
<div class="checkout-success">
<div class="main-inside-checkout">
<?php if ($block->getOrderId()) :?>
<div id="main-checkout-first">
<?php if ($block->getCanViewOrder()) :?>
<h1 class="order_status">Your order is Confirmed!</h1>
<img src="<?php echo $block->getUrl("pub/media/icon/")?>order-imge.jpg"/>
<p class="order-number"><?= $block->escapeHtml(__('Your order number is: %1.', sprintf('<strong>%s</strong>', $block->escapeUrl($block->getViewOrderUrl()), $block->getOrderId())), ['a', 'strong']) ?></p>
<?php else :?>
<p><?= $block->escapeHtml(__('Your order # is: <span>%1</span>.', $block->getOrderId()), ['span']) ?></p>
<?php endif;?>
<h5><?= $block->escapeHtml(__('Get 25% Off your next order')) ?></h5>
<p class="order-disc-details">When your friends use your referral code to place their first order,you'll both get <span class="off-percentage">25% Off</span>. It's a win win 🙂</p>
</div>
<div id="main-checkout-second">
<p class="main-input-checkout"><input type="text" value="LGL174" id="discounted-code"><button class="button-for-copy" onclick="copyToClipBoard()">COPY</button></p>
</div>
<div id="main-checkout-second">
Share via Whatsapp
</div>
<?php endif;?>
<?= $block->getAdditionalInfoHtml() ?>
<div class="actions-toolbar">
<div class="primary">
<a class="action primary continue" href="<?= $block->escapeUrl($block->getContinueUrl()) ?>"><span><?= $block->escapeHtml(__('Continue Shopping')) ?></span></a>
</div>
</div>
</div>
</div>
<script type="text/javascript">
function copyToClipBoard() {
var content = document.getElementById('discounted-code');
content.select();
document.execCommand('copy');
}
</script>
If anyone have idea then please let me know

I've tried converting a HTML site to WordPress but only the content is displayed and the CSS is not working

I want a HTML site to be converted to a WordPress site with the same theme.
I've added the 'wp_enqueue_style' to the functions.php file for WordPress to find the CSS file but still it's not working.
functions.php
<?php
function our_theme_dependencies(){ ?>
<script>alert("its working"); </script>
<?php
//css libraries
wp_enqueue_style('main-style', get_stylesheet_directory_uri().'/assets/css/style.css');
wp_enqueue_style('bootstrap-style', get_stylesheet_directory_uri().'/assets/css/jquery.bxslider.css');
wp_enqueue_style('plugin-set', get_stylesheet_directory_uri().'/assets/css/plugin.css');
}
add_action('wp_enqueue_scripts', 'our_theme_dependencies');
?>
front-page.php
<?php get_header(); ?>
<div class="notice-board-row">
<div class="container notice-board-container">
<div class="notice-board-wraper">
<h3>Notice Board</h3>
<div class="notice-board-slider">
<div class="notice-item">
<div class="date">
<span class="month">Jan</span>
<span class="no">22</span>
<span class="year">2020</span>
</div>
<?php get_footer(); ?>
I am expecting the same theme as in the HTML version of the site to be converted to WordPress site.
converted html page to wordpress
css is not working

how to change widget area from aside to inline?

Here is my website:
http://steelpony.com/shop/shop-by-look/
The header is trying to kill me. I have tried everything in my knowledge base in the header.php, page template, style.css, index.php and function.php to get rid of most of the white space, place the shopping cart and shopping cart search widgets inline with the navigation menu and nothing is working. Here is what I want the header to look like (minus the top line - don't really care about that): http://www.shopthreedots.com/Home.aspx
I believe that the way to change the position of the widget areas is by changing the <aside> attributes but is it to display=inline that I change it? Here is the header code:
</head>
<body <?php body_class(); ?>>
<div id="page" class="hfeed">
<header id="branding" role="banner">
<div align=center><div id="topcontent">
<div class="topcart">
<div id="secondary" class="widget-area" role="complementary">
<?php if ( ! dynamic_sidebar( 'sidebar-1' ) ) : ?>
<aside id="archives" class="widget">
<h3 class="widget-title"><?php _e( 'Archives', 'twentyeleven' ); ?></h3>
<ul>
<?php wp_get_archives( array( 'type' => 'monthly' ) ); ?>
</ul>
<aside id="meta" class="widget">
<h3 class="widget-title"><?php _e( 'Meta', 'twentyeleven' ); ?></h3>
<ul>
<?php wp_register(); ?>
<li><?php wp_loginout(); ?></li>
<?php wp_meta(); ?>
</ul>
</aside>
<?php endif; // end sidebar widget area ?>
</div><!-- #secondary .widget-area -->
<div align=center><strong>Checkout</strong></div>
</div><!-- topcart -->
So, what do I change to
get the widget areas inline and looking like the desired ex given vs my current page reality and
How do I re divide up the header to eliminate the white space and create a logo area like in the example I gave?
Correction: changing the attributes from <aside> to <div display=inline> but I do not know if that is how to get the widget area on the same line as the navigation menu on line with those category tabs ...
I inspected your code. Go to your CSS file. You want to edit the id main content (#maincontent) to decrease the white space. I noticed that the height of this is 956px. You should decrease this amount, which should get rid of the white space.

When Logged out, one blog shows - logged in, all blogs show

I've coded this Wordpress site but I'm finding difficulties with the blog area. Only one blog shows in the blog section but with I am logged in as an admin, I can see all the blogs on the page. I need it to show for everyone, whether they are logged in as a user or just a visitor to the website.
I have attempted to see if it was a wordpress issue by checking the 'Settings >> Reading' settings and they are set just fine, showing to be 10 posts per page.. It could be something wrong with the loop. I have the blog pulling from the index.php.
http://www.ilovepennycakes.com/category/blog/
Here is the direct link to the blog not showing in the feed.
http://www.ilovepennycakes.com/thanksgiving-thoughts/
The code is as follows:
<?php get_header(); ?>
<!-- Article Loop -->
<article>
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<div class="news-top"></div>
<div class="news">
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="post-header">
<h1 class="meander"><?php the_title(); ?></h1>
<p class="likes m500"><?php comments_popup_link( '0', '1', '%' ); ?></p>
<div class="clear"></div>
</div><!--end post header-->
<!--div class="entry clear"-->
<div class="blog-content m500">
<?php if ( function_exists( 'add_theme_support' ) ) the_post_thumbnail(); ?>
<?php the_content(); ?>
<?php wp_link_pages(); ?>
</div>
<!--/div--><!--end entry-->
<p class="date M500">Posted <?php the_time( 'j M Y' ); ?></p>
<p class="M500"><?php edit_post_link( __( 'Edit', 'pennycakes' ), '<span>', '</span>' ); ?></p>
<!--end post footer-->
</div><!--end post-->
</div>
<div class="news-bottom"></div>
<?php endwhile; /* rewind or continue if all posts have been fetched */ ?>
</div><!--end navigation-->
<div class="navigation index">
<div class="alignleft"><?php next_posts_link( 'Older Entries' ); ?></div>
<div class="alignright"><?php previous_posts_link( 'Newer Entries' ); ?></div>
<?php else : ?>
<?php endif; ?>
</article>
<!-- //Article Loop -->
Any help will be appreciated.
Hmmm... are your posts still "Drafts" or published? If they are drafts, it is normal to be able to see them only if you are logged in, because a draft is not published so not supposed to be seen by any visitor. That's my guess. Otherwise, please give more info.
Ok, so I have the answer for you: index.php is not the file used to display http://www.ilovepennycakes.com/category/blog/. The file used for this type of archive display is "category.php". If there is no such file in your theme folder, add it (possibly duplicate index.php as you have programmed it or take it from a default example template).