WordPress Toolset - Pagination error - php

My problem is simple, by I fear the sollution might not be.
I'm working on this site:
http://portugal.dk.linux134.unoeuro-server.com
It's a WordPress solution with Avada Theme and Toolset Plugins enabled.
The only other plugins i run, are BackupBuddy and Contact Form 7.
My problem is, is that the pagination on my blog/post views suddenly stopped working. I've tried several suggestions like turning op the "max_input_vars" to 3000, in php.ini. And increasing the memory_limit to 256M.
To see the problem "in action" try pushing the button "Indlæs flere", under the posts.
I've worked on issues there might be with the Ajax, Jquery og the Wordpress version it self. Nothing seems to be wrong, and the problem just appeared.
I know there is a very logical explanation to this, but i'm lost in trying to find it. So does anyone out there know about WordPress and specifically the Toolset plugin, and can you help me? :)
Here is the documentation on the "view" i'm working on:
SCREENSHOTS OF THE SETTINGS:
LOOP OUTPUT:
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop wrap="1" pad="true">
[wpv-item index=1]
<div class="col-sm-6 nth-blog-loop">
[wpv-post-body view_template="loop-item-in-home-blog-view-after-first-two"]
</div>
[wpv-item index=other]
<div class="col-sm-12">[wpv-post-body view_template="loop-item-in-home-blog-view-after-first-two"]</div>
[wpv-item index=pad]
<div class="col-sm-12"></div>
[wpv-item index=pad-last]
<div class="col-sm-12"></div>
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
[/wpv-no-items-found]
[wpv-layout-end]
TEMPLATE FOR THE VIEW
<article class="post-article col-sm-12">
<a href="[wpv-post-url]">
<div class="col-sm-12 desktop"><img src="[wpv-post-featured-image size="medium" output="url"]"></div>
<div class="col-sm-12 desktop">
<div class="row">
<h2>[wpv-post-title]</h2>
<p>[types field='headertekst'][/types]</p>
</div>
<div class="row">
<div class="post-info">
<i>[wpv-post-date]</i>
</div>
</div>
</div>
<div class="col-sm-12 mobile"><img src="[wpv-post-featured-image size="medium" output="url"]"></div>
<div class="col-sm-12 mobile">
<div class="row">
<h2>[wpv-post-title]</h2>
<p>[types field='headertekst'][/types]</p>
</div>
<div class="row">
<div class="post-info">
<i>[wpv-post-date]</i>
</div>
</div>
</div>
</a>
<i class="fa fa-angle-right" aria-hidden="true"></i>
</article>
FILTER:
[wpv-layout-meta-html]
[wpv-filter-meta-html]

Go into your View (in Toolset). Then go to the 'pagination' area and check what it says there. It may say 'Default setting = 10'. Just change that to 10. Save it all and refresh the page. This may also help you out: https://wp-types.com/documentation/user-guides/views-shortcodes/#wpv-items-found

Related

WP Simple Membership - How to display Error message for not registered users?

I need help with the Wordpress plugin - WP Simple Membership (https://simple-membership-plugin.com).
I have a problem to display the Message when a user try to login but is not registered. I can see it in my source code, this snippet:
<!--
<div class="swpm-forgot-pass-link">
<a id="forgot_pass" class="swpm-login-form-pw-reset-link" href="http://lions.giftgruen.com/anmelden/password-reset/">Passwort vergessen?</a>
</div>
<div class="swpm-join-us-link">
<a id="register" class="swpm-login-form-register-link" href="">Noch kein Mitglied? Registriere dich hier! </a>
</div>
<div class="swpm-login-action-msg">
<span class="swpm-login-widget-action-msg">Benutzer unbekannt</span>
</div>
-->
But it is somehow not displayed. I don't know how to fix that. Can anyone help? Thanks in advance.
it's commented out, the <!-- and --> are html comment brackets
replace that snippet with:
<div class="swpm-forgot-pass-link">
<a id="forgot_pass" class="swpm-login-form-pw-reset-link" href="http://lions.giftgruen.com/anmelden/password-reset/">Passwort vergessen?</a>
</div>
<div class="swpm-join-us-link">
<a id="register" class="swpm-login-form-register-link" href="">Noch kein Mitglied? Registriere dich hier! </a>
</div>
<div class="swpm-login-action-msg">
<span class="swpm-login-widget-action-msg">Benutzer unbekannt</span>
</div>
I don't know if that will fix your problem though,
It's probably meant to be commented out if it was.

Hide a tab with no content on a Magento EE product page

I have successfully added a tab to my view.phtml page located at app/design/frontend/enterprise/aps/template/catalog/product.
I tried an if statement to hide it if the Specifications field is empty, i.e. no content. The issue is, it doesn't work. It still shows the tab even if there is no content.
My code is below at the end of post.
2 Questions:
Am I taking the correct approach? Basically, I am making a tab to have an Expert Review tab. I originally was going to use a cms block, but figured purposing the Specifications field was easier, for one, but also I could ignore the tab if no content
Can you please help ? :)
Thanks so much and here is my code and I attached a screenshot of the empty tabs.
<div class="wa-product-details-tab product-description">
<div class="wa-product-details-tab-heading product-desc-tab">
<div rel=".wa-product-tab-details-item-1" class="wa-product-heading-item wa-product-heading-item-1 wa-product-heading-item-active">
<span>Description</span>
</div>
<div rel=".wa-product-tab-details-item-2" class="wa-product-heading-item wa-product-heading-item-2">
<span>Specs</span>
</div>
<div rel=".wa-product-tab-details-item-3" id="review-form" class="wa-product-heading-item wa-product-heading-item-3">
<?php
$summaryData = Mage::getModel('review/review_summary')
->setStoreId(Mage::app()->getStore()->getId())
->load($_product->getId());
?>
<span >Reviews (<?php echo $summaryData->getReviewsCount();?>)</span>
</div>
<div rel=".wa-product-tab-details-item-4" class="wa-product-heading-item wa-product-heading-item-4">
<span>APS Advisor Review</span>
</div>
</div>
<div class="wa-product-tab-details product-desc">
<div style="display: block;" class="wa-product-tab-details-item wa-product-tab-details-item-1">
<?php echo $_product->getDescription(); ?>
</div>
<div style="display: none;" class="wa-product-tab-details-item wa-product-tab-details-item-2">
<p> <?php echo $this->getChildHtml('additional')?></p>
</div>
<div style="display: none;" class="wa-product-tab-details-item wa-product-tab-details-item-3">
<p>
<?php echo $this->getChildHtml('review_form') ?>
<?php echo $this->getChildHtml('product_additional_data_review') ?>
</p>
</div>
<div style="display: none;" class="wa-product-tab-details-item wa-product-tab-details-item-4">
<?php if ($_product->getSpecifications()); ?>
</div>
</div>
I am not sure if I understood your issue correctly. I am assuming that you want to hide the "APS Advisor Review" tab if there is no content in it.
For this you can use an if condition to check if $_product->getSpecifications() has any content, and show the tab title only if there is any content like this
<?php if( !empty($_product->getSpecifications()) ){ ?> <!-- displays the tab title only if the product has any specifications -->
<div rel=".wa-product-tab-details-item-4" class="wa-product-heading-item wa-product-heading-item-4">
<span>APS Advisor Review</span>
</div>
<php } ?>

How can I display this logo on all the pages except the home page?

I have this code PHP:
<?php if (!is_home()){ ?>
<div class="container-fluid">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12 style="">
<img src="wp-content/themes/WordPressBootstrap-master/images/LOGOb.png" class="img-responsive center-block" style="min-width:156px;min-height:83px">
</div>
</div>
</div>
<?php } ?>
This is site:
http://avocat2.dac-proiect.ro/
I want this logo to be displayed on all pages of the home page less and unfortunately tried my code does not work.
Is something wrong?
What should be corrected so that it works?
How can i solve this problem?
Thanks in advance!
you might want to try:
!is_front_page()
or
!is_page('home')
use the latter if the slug for your homepage is 'home'
is_home() only works for the posts page, so unless your homepage is the blog, it won't produce results.

Php to auto populate grids

I have the following html code:
<div class="media row-fluid">
<div class="span3">
<div class="widget">
<div class="well">
<div class="view">
<img src="img/demo/media/1.png" alt="" />
</div>
<div class="item-info">
Title 1
<p>Info.</p>
<p class="item-buttons">
<i class="icon-pencil"></i>
<i class="icon-trash"></i>
</p>
</div>
</div>
</div>
<div class="widget">
<div class="well">
<div class="view">
<img src="img/demo/media/2.png" alt="" />
</div>
<div class="item-info">
This is another title
<p>Some info and details go here.</p>
<p class="item-buttons">
<i class="icon-pencil"></i>
<i class="icon-trash"></i>
</p>
</div>
</div>
</div>
</div>
Which basically alternates between a span class with the widget class, and then the widget class without the span3 class.
What I wanted to know was if there was a way to have php "echo" or populate the details for and details under the "item-info" class. Would I need to use a foreach statement to get this done? I would be storing the information in a mysql database, and while I can get it to fill in the info one by one (repeatedly entering the and echoing out each image and item title) it's not practical when the content needed to be displayed is over 15 different items. I'm not well versed in foreach statements so I could definitely use some help on it.
If someone could help me perhaps structure a php script so that it can automatically output the html based on the number individual items in the database, that'd be greatly appreciated!
I'm wondering if the html + php (not including the foreach) would look like this:
<div class="span3">
<div class="widget">
<div class="well">
<div class="view">
<img src="img/<? $file ?>" alt="" />
</div>
<div class="item-info">
<?$title?>
<p>Info.</p>
<p class="item-buttons">
<i class="icon-pencil"></i>
<i class="icon-trash"></i>
</p>
</div>
</div>
</div>
EDIT:
I wanted to add some more information. The items populated would be based on a type of subscription - which will be managed by a group id.
I was initially going to use <? (if $_SESSION['group_id']==1)>
echo <div class="item-info">
$title
<p>$info</p>
</div>
so that only the subscribed items would populate. But, I would need it to iterate through all the items for group1 table and list it. Currently I know that I can do
<? (if $_SESSION['group_id']==1)
while ($row=mysql_fetch_assoc($sqlItem))
{
$itemInfo = $row['info'];
$image = $row['image'];
$title = $row['title'];
$url = $row['url'];
};
>
$sqlItem for now can only be assigned one thing (manually - as in: $sqlItem = '123'), unless I iterate through which is what I'm trying to figure out.
Just read that 'mysql_fetch_assoc' is being depreciated with 5.5, here is the new way and looks better, easier I think.. Hope this helps, was updated today.
I hope this helps http://php.net/manual/en/mysqli-stmt.fetch.php
replace the printf with echo '//then your html stuff
This will iterate through the rows in your database until their are no more matching records.
shouldn't a while be enough? It depends on the structure of your database and website (we didn't need so much HTML I think. Some more PHP maybe). Hope this helps.

Drupal 7 - Adding blocks to a page

This is my current set up.
I have created a new custom theme with the following regions.
regions[header] = Header
regions[content] = Content
regions[footer] = Footer
page.tpl.php
<div id="Header">
<div class="row">
<div class="span12" style="text-align:center;padding-top:20px;">
<div><img src="logo.png" width="150" height="150" alt="KT Logo"></div>
</div>
</div>
<div class="row"> </div>
</div><!-- /Header -->
<div id="Navigation">
<div class="row" style="text-align:center;">
<div class="span12" style="text-align:center;">
<?php print render($page['header']); ?>
<hr class="style-two">
</div>
</div>
</div><!-- /Navigation -->
<div id="Content">
<div class="row"> </div>
<div class="row">
<div class="span8 offset1">
<h1><?php print $title; ?></h1>
</div>
</div>
<div class="row"> </div>
<div class="row">
<div class="span10 offset1">
<?php print render($page['content']) ?>
</div>
</div>
<div class="row"> </div>
</div><!-- /Content -->
<footer>
<div class="row">
<div class="span12">
<img src="separator.png" alt="separator">
<?php print render($page['footer']); ?>
</div>
</div>
<div class="row"> </div>
</footer>
</div><!-- /container -->
This all works well and I have created several basic pages fine. The problem comes when I want to have a custom "content type" with 2 blocks on a page, one with main content on left, one with a sidebar on right. Now I'm not completely understanding how the regions work.
I am wanting something like the sidebar_second effect but I'm not sure how it would set in with my widths. Here is a screenshot of my regions. http://goo.gl/XFVnl
So I think I need to change the way my content region is displayed so that it can include the sidebar region?
Thanks for any help
Content-type specific templates are usually node.tpl.php files, and page templates are page.tpl.php files.
page.tpl.php file is already included when you are using a node.tpl.php
First, add ALL the regions to the .info file of them theme. This directly affects which regions are available in blocks administration page.
It's not necessary to have all the regions you defined (in .info file) to present in all page.tpl.php files.
As you have 3 regions in the page.tpl.php file, leave it and it will continue to work.
But to override the page.tpl.php for specific node types, you will have to set them in the theme's template.php file. You simple "ask" Drupal to use this page.tpl.php file is node type is a "page" (for example).
Add this to your template.php file. Drupal will not look in to page--node-book.tpl.php file for an alternative page.tpl.php file if the node type is (machine name) is "book".
<?php
function themename_preprocess_page(&$variables) {
if (!empty($variables['node'])) {
$variables['theme_hook_suggestions'][] = 'page__node_' . $variables['node']->type;
}
}
?>
Now you can copy the page.tpl.php file to page--node-[type].tpl.php and make your changes there. Whatever you put in this file will be used for page template for that node type.
(Note: 2 hyphens between "page" and "node", and one between "node" and "[type]")
Remember to clear caches if you can't see the changes.
I believe the first step is to declare a sidebar region in your .module file along with your other regions even if it will not be displayed on every page.
In your page template you can check (psuedo-code)
if (isset($page['sidebar'])) {
<div sidebar float left theme this how you want>
print render($page['sidebar']);
</div>
}
Now when you create a block you can specify a specific path for it to show up on or a specific content type for it to show up on. The code above will check if the page has a block in your sidebar and render it accordingly.
You will probablly be more likely to get answers if you post on drupal stack exchange.
https://drupal.stackexchange.com/

Categories