I have such a text container. He would like it to appear only on the first page of the blog's pagination.
<div class="column mcb-column mcb-item-c0belar2g one column_visual">
<h2>Title</h2>
<p>Lorem Ipsum Dolor</p>
</div>
I have a text container generated by Muffin Page Builder in WordPress. He would like it to appear only on the first page of the blog's pagination. I tried to create a code like this:
if (1 == $ paged) {
your container code
}
Unfortunately it doesn't work and I don't know if I need to create a function to hide this container on the following pages of pagination?
Here is a link to this blog page
I am trying to find information on the Internet, but so far I have not been able to find anything about it. Please help.
Image of this container
Related
Is it possible to set the initial page in blogdown? Instead of the default one that shows the posts I would like to have a custom one. I want to have my own index.html (the root one).
Thanks.
Assuming you are using Lithium - A simple responsive Hugo theme, one possible way to do this is the following.
1] Copy layouts/_default/list.html to a new layout file named layouts/_default/home.html
2] Edit layouts/_default/home.html so it contains this:
{{ partial "header.html" . }}
<main class="content" role="main">
<h1>
My heading
</h1>
<p>
My paragraph
</p>
</main>
{{ partial "footer.html" . }}
Your home page will now contain "My heading" and "My paragraph," along with the Lithium header and footer. If you do not want to use the Lithium header and/or footer, remove those partial calls from home.html.[*] There's a lot more that you can do with Hugo layout files, which you can learn about in my Hugo tutorial in the section 15. Explore the layouts directory and at gohugo.io's Category: templates.
I hope this is enough to get you started with Hugo layout files.
[*] If you remove the header partial, you need to put something like <!doctype html><title>a</title> at the top. More about this is in What's a valid HTML5 document? - Stack Overflow
I am using this shortcode to show all products of a specific product category on custom a template.
[products limit="12" columns="3"]
Now, as I am developing a new theme so the output of this shortcode is breaking the design.
I want to know where or which file I should take or edit to change the layout I want?
Check this image:
Here you can see the rectangle box div's is coming from the content-product.php page but I want to add/change few div before that div's
Like where the <div class="row"> and <div class="woocommerce columns-3 "> is coming? I want to change it.
i try this code to display image in my post in wordpress but image doesnot show in my post
<article class="media">
<h2>About the venue</h2>
<img class="pull-left" src="images/hotels/contempo.jpg" alt="Hotel Contempo"/>
<p>All CAC speaking events located at 309 1st Avenue, in Downtown Seattle..</p>
</article>
is this code a proper way to display images in wordpress ??...i donot want upload image method
if not correct ..how can i write code to display this image?
If you want to show the static images you need to give proper url to the images.
src="/wp-content/themes/your-theme-name/images/hotels/contempo.jpg"
Odd question and maybe my logic is off on this one, but I have this structure in Wordpress:
Page 1
Child page of page 1
Child page of page 1
Page 2
Child page of page 2
Child page of page 2
Child page of page 2
In my theme I output this as one page per parent.
For example:
The layout is
<h1>title of page 1</h1>
<p>content of page 1</p>
After that a few small blocks:
<div class="box first child-page">
box with content of child page of page 1
</div>
<div class="box second child-page">
box with content of child page of page 1
</div>
<div class="box last child-page">
box with content of child page of page 1
</div>
But; now my problem! When someone uses the search box, The child pages, with their unique permalink are also shown, which is correct, but I need them to link to the parent page. Child pages should not be visited as a unique page, but the content has to be searchable (because, the content does exist on the webpage). Hope you guys understand what I'm trying to tell. I tried to 301 redirect the child pages to the parent page, but I need something easier for my client to be able to create child pages, and not having to worry about 301 redirects.
Regards.
to get parent url you can do this inside the loop of child page
<?php
$parent = get_permalink($your_child_loop_variable->post_parent);
?>
Ads on this page (Fixture Info) are not displayed at same position as this (Home Page). Both have the ads placed in <div class="right-ad">, and use the same style rules.
Any idea how to fix this & display ads on Fixture Info in same position as Home Page?
You should add more detail in your question and not really expect people to go to your site and analyse your code.
Never-the-less..
Check your code and you will notice that on your Home Page the <div class="right-ad">'s parent is <div class="main">. Whereas on Fixture Info the <div class="right-ad">'s parent is <div class="container">.
I would assume that this is the cause of your problem. Go over your code and you'll probably find that on the Fixture Info page, putting the ad's <div> in the <div class="main"> will solve it.
I.E:
Your Home Page:
Your Fixtures Page: