Display Menu item "Note description" in frontend Joomla 2.5 - overriding

I'm working with Joomla 2.5, every menu item has got a "Note" field that normally is used just only as a description in the back end, it's possible to display that content on the frontend of my site? the best is to display it via the override...

You can get the "Note" field by using menu Item id
$menuitemid = JRequest::getInt('Itemid');
$db =& JFactory::getDBO();
$query = "SELECT note FROM #__menu WHERE published = 1 and id = '".$menuitemid."' ";
$db->setQuery($query);
$note = $db->loadResult();

Related

Wordpress's Category & Tag is not show after choosing

Wordpress v 6.0.1, 6.0.3
Firstly, I choose category & tag in default Post. Then, I save and publish.
After refreshed, selected category is missing. In Post list dashboard, Category & Tag is not show. How to fix it.
45sec short-clip: https://vimeo.com/779149812
In Public site screen,
$category = get_the_category();
$category = $category[0];
$categoryName = $category->cat_name;
In browser console's Elements,

Wordpress / WooCommerce - dynamic hyperlink based on current product

I'm running WooCommerce in Wordpress here and on some products, I will be embedding a block of text which includes a hyperlink to a contact form. I would like the Subject on the contact form to populate with the name of the product where the hyperlink was clicked
I have established that I can populate a CF7 field by appending a query string to the URL (e.g. www...co.uk/contact-form/?subject=blah,blah), so if there was some method of dynamically altering the hyperlink in the aforementioned block of text when the product page is loaded so as to append the product name after the query string
Maybe to describe this a little clearer...
The block of text on the product page will look like this:
<a href='...co.uk/contact-form/?subject={NEED-TO-DYNAMICALLY-APPEND-PRODUCT-NAME-HERE}>Contact us...</a>
Any ideas folks of how I might approach this or has anyone tried something similar?
Thanks
So you want the title of product name ?
$product = wc_get_product( id );
$product_name = $product->get_title();
<a href='...co.uk/contact-form/?subject=<?php echo $product_name; ?>'>Contact us...</a>
If you want the title of the page you can give this parameter to your href
$pageTitle = get_the_title();

Get setting form wordpress customizer and display in a url

How can I create a custom url like this :
www.my-wordpress-blog.com/?layout=fullwidth
www.my-wordpress-blog.com/?layout=grid
www.my-wordpress-blog.com/?layout=list
See Example what excepted as output,
http://themes.themegoods2.com/letsblog/?layout=fullwidth
http://gleedthemes.com/themes/elora/?layout=2
I tried looking on Google, but no "how to" tutorials show up for anything like this.
How create custom URL
Step:1 Login to admin panel and go to "Appreance->Menu"
Step:2 Use the Custom Links panel to add a custom link to your menu, such as a link to an external website.
Step:3 Simply type in the website URL in the URL field and the menu name in the Link Text field.
Step:4 Click the Add to Menu button when done. Use the same steps outlined previously to adjust the order of the menu item and click the Save Menu button at the top or bottom of the screen to save your changes.
Please refer following for more information,
http://www.templatemonster.com/help/wordpress-add-custom-link-menu.html#gref
How To set Layout page
Add page from page menu
Select a Right side Page attribute select a template from there.
publish page and visit a menu from front side.
Final Solution Suggested By [Sociopath]
Path : wp-content/themes/yourtheme/functions.php
add this code at the end of file.
if( ! function_exists( 'themename_demo_set_the_header_layout' ) ){
/**
* Set the demo header layout from child theme.
* #param unknown_type $header
* #return Ambigous <NULL, string>
*/
function themename_demo_set_the_header_layout( $header = 'layout1' ) {
$header = isset( $_GET['header'] ) ? trim( $_GET['header'] ) : null;
// Add more checking conditions here.
return $header;
}
add_filter( 'themename_set_my_header_layout', 'themename_demo_set_the_header_layout', 10, 1 );
}

How to display the menu name of a menu in wordpress

I have created a menu with the name "alggemeen" and added some items to it.
I have assigned the menu to the theme location Footer menu with the slug 'footer-menu'.
Now I know how to display the content of menu and also the menu_location. But I want to display the name the wordpress admin will provide in backend for the menu, on my website.
I would like to echo the name of the menu that has been allocated to the menu with a theme location of 'Footer Menu(slug = 'footer-menu')'.
So as shown above in the picture Currently alggemeen is the menu assigned to Footer Menu so my front end should echo algemeen.
Try this code :
$menu_location = 'header';
$menu_locations = get_nav_menu_locations();
$menu_object = (isset($menu_locations[$menu_location]) ? wp_get_nav_menu_object($menu_locations[$menu_location]) : null);
$menu_name = (isset($menu_object->name) ? $menu_object->name : '');
echo esc_html($menu_name);

Wordpress: Editing 2 columns

I would like some advice on the following issue:
What would be the best way to edit a page that has 2x columns via the editor?
You can try it with the Custom Field Template.
For the first column you can use the default editor of Wordpress and for the second you can create a custom field in which the plugin shows a textarea with TinyMCE support.
Posible code for the "custom field template" to show a textarea in a custom field area:
[column_2]
type = textarea
rows = 4
cols = 40
tinyMCE = true
htmlEditor = true
mediaButton = true
(you have to enter that code in wp-admin panel of the plugin).
To get the data from the custom field in your the template-file you can use the
get_post_custom_values function:
//returns an array
$colum_2_content = get_post_custom_values("column_2", $post_id);
echo $colum_2_content [0];

Resources