Laravel pagination links are hidden - php

I am fetching some products from the database
$products = Product::paginate(7);
return view("products.index", compact("products"));
In the view I am doing this
$products->links()
but the main problem is that pagination links did not appear in the page. I thought that probably these links were no rendered... but they are rendered and for some reason they are set to hidden.
What is the reason? I have never faced this issue before

I got an answer.... I just published the pagination in vendor then changed the styling from there.

Related

WordPress Custom Posts Page Not Displaying

I have just encountered a small but weird problem in WordPress. I have made page called 'nyheter' (translates to news in Norwegian), where I have made a custom page having a 'page-nyheter.php' in my template folder where I want to display all the posts on the website.
Please keep in mind that I don't want to display any posts on my front page.
I do also have a custom static front page that is just 'front-page.php' which works fine navigating to. However, choosing my front page as the homepage, and the 'nyheter' page as the posts page in the settings, ends up showing the homepage on the 'nyheter' page as well. All of the other pages works fine, and if I just remove the 'nyheter' page from the custom posts page, it works fine again.
What exactly am I doing wrong here? Could someone please help me?
The Posts page will use index.php for it's template, and the Static Front Page will use front-page.php
Is the Nyheter page powered by posts? Why not use index.php since is most suitable for posts than a page template.
https://wphierarchy.com/
If you are a developer please enable wp_debug to true. Then check your errors.

Add <?php the_content(); ?> to WooCommerce page template

I use Elementor page builder on my WordPress site. There is a problem with it - by default it doesn't allow editing WooCoomerce Shop/Products pages. The solution they say is to add to page templates code. I, being a beginner with no idea of coding, cannot figure out which file to add this code to and where in that file. I have been researching and trying to fix this myself for two weeks now, in vain. Please help me achieve this.
Here's what Elementor say: "Sorry, the content area was not found in your page. You must call the_content function in the current template, in order for Elementor to work on this page."
Go to Elementor setting and then check products in post types
Go to Products, click Edit on the product you want to edit, input something (ie. a full stop-sign '.') in the WP Editor, click Update. (See attached screenshot.)
Screenshot
There seems to be a misconception that Elementor can be used to "edit" any content.
For Elementor to work on a "Page" i.e. the post type that uses either the page.php or any theme declared page templates it requires the_content(); function to present in the code.
Issue #1: WooCommerce uses the woocommerce_content(); function to return the content of the shop.
Issue #2: The Shop output does not use the "Page" or Custom Page template - the output is equivalent to the index.php or home.php, neither of which are editable via Elementor.
Unless you are willing to write a pretty sophisticated function to collect all those elements' data and filter them into the_content(); function, there is currently no way of editing such content directly.
I know it's not the solution you are looking for but that is the current state of affairs. Having said that, some of us are working on all sorts of solutions and maybe, just maybe - we'll come up with a way to have this option available soon ;)
For shop page you should go to Elementor setting and then check products in post types.
Because shop page products are not the content but posts it's the solution.
So inlcude products in post types and edit with elmentor, if for some reason you can't see 'edit with elementor' under shop page, then just open shop page and add
/?elementor and it would enable elementor
NO need to add this code in any page follow these instruction.
You just need to clear cache and cookies your browser, Some time website take previous data to show the web page and give this error.
or
if you open your website private mode then login and go to the page by Elementor you will never face this problem.

Wordpress: Adding meta values like title and description for Pages from custom database

I have a plugin that creates plugin specific database table rows that then are turned into pages. I have got this work with URL redirect and have been able to lay out the page. Now I am having some problems.
Problems:
Creating header title for the page. It currently shows page not found.
Creating description for meta SEO. Meta description is currently blank.
Showing these custom created pages to be added in WP menu.
I know these are not pages, and I have lost most of the wp functionality by doing this and not using custom post types but one of the main requirements of the clients was that the database have separate tables for their data.
I need some help or reference regarding these problems. Links for examples and articles would do or any free plugins that actually do this.
I'd really appreciate the help.
As you mentioned your self, using your current technique you will not able to take advantage of WordPress in real sense. You may use custom posts and then use wp cron to copy get the data from there to your own table.

Missing Magento Pagination on my Brands page

I was hoping somebody could point me in the right direction with a Magento issue I'm having. On my 'Brands' page I'm missing the pagination on the bottom. My page is calling the correct toolbar with the pager included. Its displaying how many products there are, and how many products i can view on each page, but its not rendering the Pagination. All my other pages work great, just have been super stuck when it comes to the brands page. Here is the example:
http://www.strivved.com/brand/Champion.html
When you scroll to the bottom you can see the pagination is missing. I've tried updating the toolbar.phtml and even pager.phtml. They all work and render fine on all my other pages, just not on any of the pages rendered from brands/BRANDNAME.html. Anyone have any suggestions. I appreciate the input. Thanks!

WordPress - Cannot get custom fields to show on home page

I am trying to add the custom field "market" into the a href as links, which is working great on pages, however is not working on my home page.
The PHP is identical for both.
For the home page, the php is in the functions.php file, and for the theme-by-series page the PHP is in the page's .php file.
The page works, so it doesn't seem to be anything wrong with the PHP, seems more like it for some reason is not targeting the post id as it should.
Anyone know how to solve this?
Custom fields are saved per post/page, and this is likely why it's not loading on your index.php page. You need to replace $post->ID with the ID of the post/page you want to show your custom field for - the $post object is available on the page.php and single.php templates, which is why it works there. On the index page, it would only be available inside the loop.
Look up the WP Docs on how to Reset the main WP Loop Query:
http://codex.wordpress.org/Function_Reference/wp_reset_query
If you're getting different results in functions.php vs a page template, there's a good chance its because your page template has already started a query loop and its conflicting somehow. This is just off the cuff without looking at the code. I'm going by your description of the difference betweeen working and non-working models.

Categories