Remove a href from php - php

On my website the following php code displaying a list of items but i would like to remove the hyperlink from each list item.
Could someone please help me with this?
<?php
foreach($features_item as $fet_item){
echo '<li>'.$fet_item->name.'</li>';
}
?>

This will do it:
<?php
foreach($features_item as $fet_item){
echo '<li>'.$fet_item->name.'</li>';
}
?>

Related

PHP shortcode input variable

I'm displaying a gallery on my wordpress site using the following code:
<?php echo do_shortcode('[satellite gallery=2 auto=off caption=off thumbs=on]'); ?>
Now I've added a custom post value/field called 'guitLink' where I can add the gallery number which I want to then use in the above shortcode, so something like this:
<?php echo do_shortcode('[satellite gallery=' .get_post_custom_values('guitLink'). 'auto=off caption=off thumbs=on]'); ?>
Any ideas how to achieve this?
Use:
<?php $guitLink = get_post_custom_values('guitLink');
echo do_shortcode('[satellite gallery=' .$guitLink[0]. ' auto=off caption=off thumbs=on]'); ?>
Instead of
<?php echo do_shortcode('[satellite gallery=' .get_post_custom_values('guitLink'). ' auto=off caption=off thumbs=on]'); ?>

Wordpress Footer Text PHP

Currently in the PHP file it has:
<?php if($myfooter_text){?>
<?php echo of_get_option('footer_text'); ?>
<?php } else { ?>
something else here
<?php } ?>
What I would like is for it to insert the footer text it finds using $myfooter_text but also add a link to the end of whatever has been pre filled in the footer text. I tried to use concatenation with the following:
<?php echo of_get_option('footer_text') . 'mylink; ?>
However this still just shows the predefined footer text and not the additional content. Is there a way to do this? I'm aware it could be added in the footer area of the dashboard but this isnt what i want to do.
Try it like this:
<?php echo of_get_option('footer_text'); ?> mylink
You can concatenate them as well like this or do it your way and be sure you close all the quotes:
<?php echo of_get_option('footer_text') . 'mylink'; ?>

woocommerce: removing link on get_categories and get_tags

I have Woocommerce outputting get_categories and get_tags in the example below, but need them to be text only. At present, it outputs text with a link to the category / tag. Can the link component be removed?
<?php echo $child_product['product']->get_categories(); ?>
<?php echo $child_product['product']->get_tags(); ?>
Thank you.
In case anyone else was looking for a solution to this...
<?php echo strip_tags ($child_product['product']->get_categories()); ?>

Drupal- Looking for code to print tweet to node-type.tpl.php

I am using the Tweet module in Drupal 7. I need the code to use for printing the tweet field in the node-type.tpl.php. Unfortunately I have been unable to find the correct code to make the link appear in my node. Using contemplate I found the following code;
<?php echo $content['tweet']; ?>
<?php echo $content['field_tweet']; ?>
<?php echo render($content['tweet']); ?>
<?php echo render($content['field_tweet']); ?>
<?php print $node->content['body']['#object']->content['links']['tweet']['#theme'] ?>
<?php print $node->content['body']['#object']->content['links']['tweet']['#attributes']['class'][1]?>
<?php print $node->content['body']['#object']->content['links']['tweet']['#attributes']['class'][0]?>
<?php print $node->content['body']['#object']->content['links']['tweet']['#links']['tweet_Twitter']['html']?>
<?php print $node->content['body']['#object']->content['links']['tweet']['#links']['tweet_Twitter']['href']?>
<?php print $node->content['body']['#object']->content['links']['tweet']['#links']['tweet_Twitter']['title']?>
<?php print $node->content['body']['#object']->content['links']['tweet']['#links']['tweet_Twitter']['title']?>
But none of them work. Anyone have any ideas?
The Tweet module documentation states that it will render in the links section of the node. Add this to node--content-type-name.tpl.php where you want you're tweet links to render:
<?php print render($content['links']); ?>
And clear the cache.

codeigniter inside a php code need to add language type

this is the code where it load my dynamic menu
<?php echo $this->dynamic_menu->build_menu('1'); ?>
this is the code for my language type
<?php echo lanchor($uri, lang('menuenglish')); ?>
here i wanto to add like this
<?php echo $this->"<?php echo lanchor($uri, lang('menuenglish')); ?>"->build_menu('1'); ?>
i know the uper code is wrong but for makeing it clear..
instead of the dynamic_menu i wanto to echo from my language varaiables
one of my language variable inside the dymanic menu
regards
Just do this :
<?php
$menu = lanchor($uri, lang('menuenglish'));
echo $this->{(string) $menu}->build_menu('1');
?>
But if you search for this in Google, you will be able to find the answer.

Categories