insert php variable at the end of url string with an iFrame - iframe

Here is what i've done so far but i just keep getting an error
<?php echo (($flag_show_product_info_model == 1 and $products_model !='') ? '<li>' . TEXT_PRODUCT_MODEL . $products_model . '</li>' : '') . "\n"; ?>
<iframe src="http://www.madisonb2b.co.uk/stockenquiry.aspx?id=B8FxKDnJ%2bIdaPT1Nw5wo4r87qHuHcCQIPZzeUE%2fI36LIFOM%2bayBi2RSXHzIJS5Hj97JNSyYL80Q%3d&code=<?php {$product_model} ?>"</iframe>
Any ideas?
Thanks,
Scott

<iframe src="http://www.madisonb2b.co.uk/stockenquiry.aspx?id=B8FxKDnJ%2bIdaPT1Nw5wo4r87qHuHcCQIPZzeUE%2fI36LIFOM%2bayBi2RSXHzIJS5Hj97JNSyYL80Q%3d&code=<?php echo $product_model ?>"</iframe>
(will work if $product_model is defined by the time you echo it, of course.

Did you want to say
echo $product_model
instead of
{$product_model}
?

Related

Add (PHP) echo Css Style

This one is original and works properly.
echo "<font face=arial size=2><b>Users Online: $n_u_online</b>";
?>
https://1.bp.blogspot.com/-HSDMjVHkrOA/YFt3AdZd8tI/AAAAAAABFo0/VjKId5hHbmElgfcgIK7x90TiPJjU0sJGQCLcBGAsYHQ/s16000/Ads%25C4%25B1z2.png
But I want to do this with Css. I coded it like this but I cannot print the online issue "$ n_u_online" is reflected on the site
echo '<div class="view-meta">Users Online: $n_u_online</div>';
?>
https://1.bp.blogspot.com/-fiQtwYBO2Fo/YFt3AY2JbWI/AAAAAAABFo4/KhRJb7Q6XMQK4_ddLjGZAZWF64dm4XaogCLcBGAsYHQ/s16000/Ads%25C4%25B1z.png
Help me please.
Try this :
echo "<div class='view-meta'>Users Online: $n_u_online</div>";
Or this :
echo '<div class="view-meta">Users Online: '.$n_u_online.'</div>';

Templating a Wordpress Plugin?

I have just created a simple Wordpress Plugin which basically gets some data from sources and displays it using a loop.
I want to be able to template this so that users can have a choice in how it displays or even create their own.
Something like Smarty would be fantastic but I can't seem to find a way to do this?
Currently my code is like this:
echo '<div class="row">';
foreach ($results->products as $product) {
echo '<div class="col-md-4 col-xs-12 text-center fiflitem">';
echo '<div class="thumbnail"><img src="' . $product->thumbnail . '" width="125px" height="125px"></div>';
echo '<div class="prodname">'.$product->product_name.'</div>';
echo '<div class="store"><img src="'.$product->merchant_logo.'" alt="'.$product->merchant_name.'"></div>';
if ($product->price_was!='0.00') {
echo '<div class="pricing">£'.$product->price.' (was £'.$product->price_was.')</div>'; }
else {
echo '<div class="pricing">£'.$product->price.'</div>';
}
echo '<div class="buybutton"><a href="' . $product->link . '" target="_blank" class="btn btn-default">More Info</div>';
echo '</div>';
}
echo '</div>';
So as you can see it is going to be quite complicated for somebody to edit, however if it was using something like Smarty (or similar) I could simplify the templates a lot more for users to be able to edit it.
Where would I start trying to get something like this working inside the plugin?
In the end I just installed Smarty as part of the plugin and using that function for templating the plugin.

Wordpress : display ACF checkbox label on front end

I have created chekboxes with ACF, now I can display the values ​​of the checkboxes on my front end but I would like to show the associated labels to.
Here is my code :
echo "<ul>";
$profession = get_field('profession');
foreach($profession as $key => $check){
echo "<li>".$check."</li>";
};
echo "</ul>";
Thanks a lot !
try this: http://www.advancedcustomfields.com/resources/functions/get_field_object/
You can return all the field's metadata with get_field_object().
if( get_field('field_name') ):
echo '<div class="class_for_display">';
echo 'Label:'; echo'<p>' .the_field('field_name').'</p>';
echo '</div>';
endif;
i use this code in function.php of child theme

disable comment rss

i am using this to automatic display the rss in the header.php
automatic_feed_links();
in the header appears feed=rss2 and feed=comments-rss2
now i just want to disable the comments-rss2 since i dont use comments in the theme.
if i use remove_action( 'wp_head', 'feed_links', 2 ); both are removed from the head.
I just want to remove the comments-rss2 -
couldnt find any reference how to this.
anyone know?
feed_links function in wp-includes/general-template.php contains echo command for both feed and not be able to disable with argument. Comment out // this line: (wp-includes/general-template.php #1614 for wp3.1)
echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr(sprintf( $args['comstitle'], get_bloginfo('name'), $args['separator'] )) . '" href="' . get_feed_link( 'comments_' . get_default_feed() ) . "\" />\n";

WordPress: output custom post type not displaying

I'm trying to output a custom post type but nothing shows up. The code is very simple - what could I be missing?
<?php
$favorites = new WP_Query(array('post_type' => 'favorites', 'posts_per_page' => 10));
while ($favorites->have_posts()) : $favorites->the_post();
echo '<li><img class="rounded" src="' . bloginfo('template_directory') . the_post_thumbnail(array(101,99)) . '" alt="' . the_title() . '" /></li>';
endwhile;
?>
Have you checked that;
You have definitely registered a post type called favorites (note plural)
The browser is not choking on your markup (your HTML is invalid - for starters, you should wrap list items in a <ul>
The function simple_fields_get_post_value() exists and is working correctly

Resources