I'm new in Wordpress. I run the wordpress using xampp. Themes have a limited navigatiob menu, and I want to add two to four navigation menus with sub-menus in my theme. How can I do that? What file should I edit to add some navigation menus?
Please help me.
Thank you!
In your theme functions.php you should register the menu location by adding the following code:
register_nav_menus(
array(
'menu_1' => 'Menu name #1',
'menu_2' => 'Menu name #2'
)
);
For more instruction about the register_nav_menus() function you can visit the related codex.
Then in your theme files, you should use the following code:
wp_nav_menu(
array(
'menu' => 'menu_1'
)
);
For more instructions about the wp_nav_menu() function you can visit the related codex.
Finally, the sub menu items can be manipulated from within the WordPress dashboard. You can see this video for more information.
<?php register_nav_menu( 'menu-id-1', 'Menu Label1' ); ?>
<?php register_nav_menu( 'menu-id-2', 'Menu Label2' ); ?>
<?php register_nav_menu( 'menu-id-3', 'Menu Label3' ); ?>
put this in your 'functions.php' file
Related
I stuck in the condition where I clicked on the modal pop-up's grid view pagination link, modal pop up gets closed and shows further records in browser tab.
I got the answer by adding renderAjax($viewPath) instead of renderPartial($viewPath). It works for me but now when I click on pagination, first time works but second time it doesn't work. I saw in console.ajax call is making but response not showing in modal popup.
You should put the pagination code outside the Pjax.
<?php Pjax::begin() ?>
// code here
<?php Pjax::end() ?>
<?php echo \yii\widgets\LinkPager::widget([
'pagination' => $pages,
'options' => ['class' => 'pagination']
]); ?>
Hope that helps.
I have a bottom menu module in my joomla CMS which works fine in footer 1 position. However, when I try to create another menu module in the footer 2 position. it assigns the same articles to this menu item as my first one?
You go to folder "template/{name of template}" and open file "index.php". Then create new module menu footer:
<?php if ($this->countModules('footer_menu')): ?>
<jdoc:include type="modules" name="footer_menu" style="none" />
<?php endif; ?>
After that, you go to backend and config position.
i have got following problem with Joomla! 3.3.4: after entering text to the Browser Page Title window in article options, the title doesn't change. In that place is only displayed the global sitename. In older Joomla everything works properly.
To change the field title you need to edit the menu item options. When you go to the detail view of menu item in question, navigate to the Page Display tab. The first field is Browser Page Title, enter the title you want to appear and save.
That should sort it out for you...
Please try to switch to the default template and if it works there is something wrong with your template.
In order to set browser title you could use setTitle() method.
<?php
$this->setTitle( $title );
?>
You could check setTitle usage at: Joomla Docs.
If you want to set title in article template you could make an addition to:
/templates/*template_name/html/article/default.php
An example code that could set the article title to browser title would be:
<?php
$this->setTitle( $this->item->title );
?>
Hope this helps
Go to Global Configuration -> Site -> Include Site Name in Page Titles and set it to Before or After. Of course you also have to set a Site Name.
I'm using the Leaf theme in Wordpress and the page only posts a maximum of 10 posts. I want there to be a bottom bar paginating to older (or newer) posts but am not sure how to accomplish this. There is a leaf_pagination function however it does not work on the home page.
you can use WP-PageNavi or WP-Paginate plugin. For WP-PageNavi plugin you just need to replace below code
<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyten' ) ); ?></div>
<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentyten' ) ); ?></div>
in template file with
<?php wp_pagenavi(); ?>
Visit http://wordpress.org/support/topic/pagination-issue-10?replies=3 to find a solution in the home.php file.
I'm working on a wordpress, and have used this http://wp.tutsplus.com/tutorials/quick-tip-display-excerpts-of-child-pages-with-a-shortcode/ to make a short tag to list child pages on parent page.
However, I need to add a pagination into this, to list only 9 recent child pages on this page where I have short tag.
Any idea how to do it? Or some other idea to replace this with something that can support pagination to list child pages.
You need to adjust the $args to have a limit using posts_per_page.
$args = array(
'post_parent' => $post->ID,
'post_type' => 'page',
'posts_per_page' => 9
);
To get pagination working, I recommend Simple Pagination. Once installed, call this where you would like it to appear like so:
<?php if(function_exists('wp_simple_pagination')) {
wp_simple_pagination();
} ?>
Pagination doesn't work for Pages in Wordpress. Pages are not to be meant by paginated.