Wordpress Page Paginate - pagination

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.

Related

Using # in landing page url

I'm using mysite.com/#contact as a landing page URL in some of the PPC campaigns, but when Google or Bing ads their URL parameters, I get url like mysite.com/#contact?campaign=x&source=x.. and the browser doesn't scroll down to the #contact anchor.
Any way to fix this? Or do I need to use a different URL?
In order to scroll down to the anchor it has to be at the very end of your url mysite.com?campaighn=x&source=x[...]#contact
I never used PPC ads so I don't know how to fix it, but at least that's the issue.
You could try to detect the URL parameter and use JavaScript to scroll to the specific location if true.
Untested combination of PHP / JS:
<?php if ( isset( $_GET['campaign'] ) { ?>
<script type="text/javascript">
//JS stuff
</script>
<?php } ?>

Magento - Change links in header

I just started with magento. I try to replace the header links on the default page. I need to replace the text "My Cart" with the following font-awesome icon.
<i class="fas fa-shopping-cart"></i>
But I have no clue where I can change this, the documentation is complicated and not very beginner friendly.
I figured it out. You have to create your own design and assign it in the backend . Then you have to create the following folder structure if it does not exist yet.
\app\design\frontend\yourDesign\default\template\page\template
Now create a file called links.phtml with the following content:
<ul class="links"<?php if($this->getName()): ?> id="<?php echo $this->getName() ?>"<?php endif;?>>
//insert links here
</ul>

Customization of Navigation menu in Wordpress

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

Layout based on Page - OrchardCMS

I have encountered an issue when using Orchard that I am sure there should be a fairly simple fix / solution for, but I have yet to find it.
I am trying to establish a specific width content area for my home page (580px), and a larger width for content pages (800px).
Layout.cshtml Snippet:
<div id='content'>
#Zone(Model.Content)
</div>
Style:
#Content
{
[...]
width: 580px;
}
Currently - the Content div wraps all of my content regardless of the page (either Home Page or Content). I am wondering if it is possible to use a different div to wrap the content based on the Page, as shown:
Layout.cshtml Idea:
#if(Model.Page != "Home")
{
<div id='fullcontent'>
#Zone(Model.Content)
</div>
}
else
{
<div id='content'>
#Zone(Model.Content)
</div>
}
I'm unsure if the above suggested method is possible (or I am unsure how to check for the current Page) - but any other suggestions would be appreciated.
You can use the Designer Tools module (built-in all recent Orchard versions) and enable the URL alternates feature. You'll then be able to create a layout-url-homepage.cshtml alternate for your layout.
You can use the Layout Selector Module to assign a custom layout to any content item.
http://gallery.orchardproject.net/List/Modules/Orchard.Module.Orchard.DesignerTools
You could use the Vandelay.Classy module to add custom tags to the page that represents your homepage, although it does add a lot of fields to the Page content editor.

jQuery Mobile how to dynamically add html to dialog box

I am looking to open a dialog from a specific page and load dynamic data into the dialog.
On the main page I have a number of different links that when clicked provides more information on that link. All the data I have for that link is included on the main page. Somehow I would like to assign the dialog so that it is populated when the dialog opens.
I've tried something like this so far:
<?php foreach($offers as $offer) : ?>
<?php echo $offer->{'offer_name'}; ?>
<?php endforeach; ?>
Then I have an event catcher to catch the link click and then load the "data-desc" meta into the dialog but this doesn't work.
$('.offer').live('click', function(){
var data = $(this).attr('data-desc');
$("#data-desc").html(data);
$("#dialog-offer").dialog("open");
return false;
});
<div data-role="content" id="dialog-offer">
<p class="data-desc"></p>
</div>
I have been looking for an example on how to do this in jQM. This is such a basic necessity for jQM in general that I am surprised that I cannot find any examples. Could someone point me in the right direction. Thanks for the help.
You have a number of errors in your code:
You have given the id="dialog-offer" to a <div> with data-role="content". You should wrap that div in another div with data-role=page
You don't necessarily need to use $("#dialog-offer").dialog("open");. Just set <a href='#dialog-offer'>
You have the wrong selector for the html() call. The class name of the <p> is what you're using with an id-style selector
I have rewritten the code and posted it here: http://jsfiddle.net/PBb3h/
Not exactly like yours, but it does what you want.

Resources