Change PHP to a Link to a Page - php

I need to replace this get_option('mycruisine_menu_page_url') with a link to an actual page. Can anyone tell me what I need to change to do this? Thanks so much in advance. Apologies if I somehow didn't get the code to display properly. Edit: When I say actual page, I mean a link I can put in like http://www.mydomian.com/nursery.html.
<span><?php esc_html_e('Click Here To Find Out More!','MyCuisine'); ?></span>
<div id="bottom-shadow"></div>
</div> <!-- end .container -->

this:
<?php $my_link = "http://google.com/"; ?>
<span><?php esc_html_e('Click Here To Find Out More!','MyCuisine'); ?></span>
//or
<span><?php esc_html_e('Click Here To Find Out More!','MyCuisine'); ?></span>

Related

Link in php echo

How can I have a php echo that work as link.
I saw other answer on that theme but I can't achieve a working solution.
My script is:
<?php if(get_post_meta($post->ID,'website',true)):?>
<div class="info-inner">
<label><?php _e('Web:','colabsthemes');?></label>
<span><?php echo get_post_meta($post->ID,'website',true);?></span>
</div>
<?php
echo 'Link content';
?>
You add the rest.
Specify what do you want to achieve - link to a post with a specific id or what?
Thank you everyone for your intent to help me.
In the end I paid a professional who helped me with a very simple solution, which is:
<label><?php _e('Web:','colabsthemes');?></label>
<span><?php echo get_post_meta($post->ID,'website',true);?></span>

How can I display the value of a field in WordPress?PHP

I have this site:
link
I installed the plugin Types and tried this code to display the value field in a div.
<div class="selectat">
<div>
<?php $variable = do_shortcode("[types field='descriere' ]");?>
<?php echo $variable;?>
</div>
</div>
My field is called descriere..I put a picture to see more clearly.
Unfortunately this blank although I do not see anything on the site and basically my div is empty ..
It is wrong the way I wrote the code?
I must call another function?
You can help me solve this problem please?
Thanks in advance!
You dont need to use any shortcode you could use
<div class="selectat">
<div>
<?php $variable = the_field( 'descriere' );
<?php echo $variable;?>
</div>
</div>
But if you want to echo the code straight away you can just use get_field('') which echos the value straight to the page.
<div class="selectat">
<div>
<?php $variable = get_field( 'descriere' );
</div>
</div>

How can i display footer depending on the language website?PHP

This is the code I tried but unfortunately does not work
<?php if(get_the_ID()==22) : ?>
<p class="dg-design"> website by dgdesign </p></p>
elseif(ICL_LANGUAGE_CODE=='es'){
<p class="dg-design"> websadsasite by dgdessadsadaign </p></p>
}
<?php endif; ?>
Can you tell me what is wrong please?
At the moment when I run the site does not change anything
I use a wordpress theme.
Can you give an example to show me how can I solve this problem?
Thanks in advance!
<?php if(is_page(22)){?>
<?php if(ICL_LANGUAGE_CODE=='en'){?>
<p class="dg-design"> website by
dgdesign
</p>
<?php }elseif(ICL_LANGUAGE_CODE=='es'){?>
<p class="dg-design"> websadsasite by
dgdessadsadaign </p>
<?php }?>
<?php }?>

Embedding a Dynamic Map into Php

my name is Chris and this is my first help question.
I am having some issues trying to figure out how to embed a Minecraft Server Dynamic Map into my PHP.
The map is 209.105.236.244:8123
The code in which I am trying to embed it is
<div class="span6">
<?php if( protectThis("1, 2") ) : ?>
<h1 class="page-header"><?php _e('You have the ability to view this map'); ?></h1>
<p><?php _e('You will only be able to see this content if you have a <span class="label label-info">special</span> user level. ')?></p>
<?php else : ?>
<div class="alert alert-warning"><?php _e(' ***Dynamic Map Here***'); ?></div>
<?php endif; ?>
</div>
I am just not able to figure out how to make the map display here instead of them just going to the url. :3
If anyone can provide me with a solution or even a jumping off point on how to go about this, that would be simply amazing! Please and thank you :)
I'm assuming you intend to call javascript based on the page source at 209.105.236.244:8123
You could forgo the echo <?php _e(' ***Dynamic Map Here***'); ?> and include your map related scripts here just as you did with your other html tags. It should still fall within your "else" condition so that these scripts are only called if your requirements are met.
In this case, any time protectThis("1, 2") is not true, the map should be displayed.
<?php if( protectThis("1, 2") ) : ?>
<h1 class="page-header"><?php _e('You have the ability to view this map'); ?></h1>
<p><?php _e('You will only be able to see this content if you have a <span class="label label-info">special</span> user level. ')?></p>
<?php else : ?>
<div class="alert alert-warning">
<script type="text/javascript" src="js/script.js"></script>
<script type="text/javascript" src="js/script.json.js"></script>
</div>
<?php endif; ?>

Drupal Block PHP

Im created a custom block, with the below code, but im having some trouble turning the Group Title into an link, that will take the user back to the group at anytime.
Below is the code ive used, I thought active turns it into a link, but perhaps im being stupid.
<div class="active"><h2><?php print $group_title; ?></h2></div>
Below is the full code:
<?php $group_title = og_get_group_context()->title; ?>
<?php $group_nid = og_get_group_context()->nid; ?>
<?php $forum_link = og_forum_get_forum_container($group_nid); ?>
<div class="active"><h2><?php print $group_title; ?></h2></div>
<div class="content"
<div class="item-list">
<ul>
<li class="user-input-link"><a title="Add a new Forum topic"href="/node/add/forum?gids[]=<?php print $group_nid; ?>">Add a new forum topic</a>
</ul>
</div>
</div>
You need to create URL for it to work.
Here is the link to API with more info: http://api.drupal.org/api/drupal/includes--common.inc/function/l/6
<div class="active"><h2><?php print l($group_title, "node/{$group_nid}"); ?></h2></div>
You need to do an anchor tag, like:
<div><h2><?php print $group_title; ?></h2></div>
I don't know how to get the url in Drupal though..

Categories