How do i hide date section from my post page? - html

Hi everyone i want to hide date from my AD section (http://prntscr.com/lgsb8), i tried few CSS codes with inspect element but they seems to be not working.
Any one please check and provide me correct CSS code to hide or remove this from page.?

You can use nth-child to achieve this.
.short-features div:nth-child(3){
display: none;
}
Here you have some information about it, let me know if that helps.

You can change the date display in the theme editor by commenting out this code in your template:
<?php the_time('F j, Y'); ?> at <?phpthe_time() ?>
do this:
<!--<?phpthe_time('F j, Y'); ?> at <?phpthe_time() ?>-->
these will leave the code intact in case you ever want to put the date back in. As long as the code is commented out the date will not appear on the live page.

Related

Merge description & additional information tab in woocommerce

I am using woocommerce on my wordpress website and I want to merge the description and additional information tabs on the product pages. I want to place the content of both tabs underneath eachother. Note that there is a similar question (with answer) posted here: Merge Description and additional information tab in Woocommerce
However, this answer places the content of the tabs in two columns instead of underneath eachother. I tried using this answer and tweaking it in order to get the contents to show underneath eachother, but my knowledge of html and css is not sufficient enough to solve this problem (I am new to coding, and even though I am proud to say that I managed to do some edits and minor fixes, this problem is definitely out of my league...)
Is there anyone who could help me out?
Thanks in advance! :)
I found out a simple way to do this. (review would be great!) The content shown in description and additional information tabs is extracted from the database and displayed in these files:
theme/woocommerce/single-product/description.php
theme/woocommerce/single-product/additional-information.php
By copying the following code of additional-information.php to description.php the content of the two are merged into one tab.
global $product;
$heading = esc_html( apply_filters(
'woocommerce_product_additional_information_heading', __( 'Specification',
'rehub_framework' ) ) );
?>
<?php if ( $heading ) : ?>
<div class="rh-woo-section-title"><h2 class="mt0"><?php echo ''.$heading; ?
>: <span class="rh-woo-section-sub"><?php the_title();?></span></h2></div>
<?php endif; ?>
<?php do_action( 'woocommerce_product_additional_information', $product ); ?>

Remove Top bar/header/Main Nav links from one page

I am creating a landing page and I would like to remove the topbar and header/main Nav links from this page, and this page only.
Currently, I use this CSS code to remove it:
.top-headers-wrapper{display:none;}
However, it leaves a big blank white space in place of the header. Ideally this white space would be removed and the big background image would go all the way to the top of the page.
I illustrate the difference below, where the page with -test appended to the URL has the CSS to remove the header. The original URL does not have the code to remove the header.
How can I modify the code to remove this white space as well as the header/topbar?
https://www.californiabeardco.com/summer-giveaway/
https://www.californiabeardco.com/summer-giveaway-test/
Your content-area class has a top-margin of 133px. If you are removing the header altogther then you should be able to remove the top margin like this
#page_wrapper.transparent_header .content-area {
top-margin: 0;
}
It looks like there are a couple of instances of this in the various #media queries in the CSS file. So you will have to find each instance.
Also like Obsidian mentions in the comments when I access your site I was logged in with admin privileges, you should change this as soon as possible. Hope that helps.
You should disable admin bar by more elegant way, like go to Profile > uncheck the options Show Toolbar when viewing site.
Or if you want to completely disable admin bar for all logged in users, insert this code to your theme's functions.php file.
function remove_admin_login_header() {
remove_action('wp_head', '_admin_bar_bump_cb');
}
add_action('get_header', 'remove_admin_login_header');
Another way is use filter, completely disable for all logged in users too.
add_filter( 'show_admin_bar', '__return_false' );
Ultimately, I found a solution. It's a bit of a workaround but it worked nonetheless.
The solution I found was to create a page template (e.g., "Landing Page") with no headers, footers, or sidebar. This results in a blank page which, when using a page designer like Visual Composer, allows me to design on a blank canvas, perfect for creating a landing page.
I followed the steps from this tutorial but will post them here for anyone else with the problem:
1) create a new php file
2) paste in this code
<?php
/**
* Template Name: Clean Page
* This template will only display the content you entered in the page editor
*/
?>
<html <?php language_attributes(); ?> class="no-js">
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php wp_head(); ?>
</head>
<body>
<?php
while ( have_posts() ) : the_post();
the_content();
endwhile;
?>
<?php wp_footer(); ?>
</body>
</html>
3) Upload the php file to the server hosting your Wordpress instance. The location should be your theme directory. Something such as ../wp-content/themes/YourThemeName
I added the php file to my child theme which worked fine, if you use a child theme, which is usually recommended protocol as I understand it.
4) Log onto the Wordpress admin console and when you create a new page, look for your newly added Template as an option.

Open page as pdf with DOMPDF

I am currently working on a semi dynamic page where I use some GET functionality to personalize it. I also echo the date a couple of places. At the bottom of this page, I would like to have a button that gives the visitor the option to download/open this page as PDF. Without the header. I have integrated DOMPDF, but I simply cant get it to work properly and need some help. I have tried a couple of things found here on Stackoverflow, with no success.
In basic, I need the whole page printed in the PDF, but it should not open when page is loaded. But triggered by the button. And then without the header (one spesific div). Is this possible?
<?php
require_once("dompdf/dompdf_config.inc.php");
$html =
'<html><body>'.
'<p>This is a test for '.
'<?php echo htmlentities(substr(urldecode($_SERVER["QUERY_STRING"]), 1)); ?> </p>'.
'<p>Thank you for reading.</p>'.
'</body></html>';
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("the_inquiry.pdf");
return true;
?>
<html>
<body>
<div class="shouldnotPrintToPDF">
Content.
</div>
<div class="shouldPrintToPDF">
Sensitive content.
Open or save as PDF
</div>
</body>
</html>
This is basically our one page presentation. And contains a lot of text, so I will not present all of that here. But in this way, I have to write the page twice, in $html = as well as inside the actual tag. And the PDF save/open option pops up right from the start, which it should not. I also wish to append the echo htmlentities part to the actual pdf-name.. is this possible? The PDF opens and contains what put into the $html = just fine. But not triggered by the link.
Update:
When i do exactly what you perform here, I get an error "The requested URL /inquiry.php&pdf=1 was not found on this server." I have the page I am trying to print in pdf on root level, but the DOMPDF is in /dompdf.. I dont know if that has anything to do with it?
Update:
When i edited the link, i get all this information up in a new page, like below.
[_parse_properties(margin:=1.2cm)(empty)_parse_properties]
[_parse_sections[section[_parse_properties(display:=-dompdf-page)
(counter-reset:=page)(empty)_parse_properties]#html#section]
[section[_parse_properties(empty)_parse_properties]#empty#section]
_parse_sections][_parse_sections[section[_parse_properties(display:=block)
(empty)_parse_properties]#div##map##dt##isindex#section]
[section[_parse_properties(empty)_parse_properties]#empty#section]
_parse_sections][_parse_sections[section[_parse_properties(page-break
-before:=avoid)(display:=block)(counter-increment:=page)
(empty)_parse_properties]#body#section]
[section[_parse_properties(empty)_parse_properties]#empty#section]_parse_sections]
[_parse_sections[section[_parse_properties(display:=block)(margin:=1em
0)(empty)_parse_properties]#p##dl##multicol#section]
[section[_parse_properties(empty)_parse_properties]#empty#section]_parse_sections]
[_parse_sections[section[_parse_properties(display:=block)(margin-left:=40px)
(empty)_parse_properties]#dd#section]
[section[_parse_properties(empty)_parse_properties]#empty#section]_parse_sections]
[_parse_sections[section[_parse_properties(display:=block)(margin:=1em
40px)(empty)_parse_properties]#blockquote#section]
[section[_parse_properties(empty)_parse_properties]#empty#section]_parse_sections]
[_parse_sections[section[_parse_properties(display:=block)(font-style:=italic)
(empty)_parse_properties]#address#section]
[section[_parse_properties(empty)_parse_properties]#empty#section]_parse_sections]
[_parse_sections[section[_parse_properties(display:=block)(text-align:=center)
(empty)_parse_properties]#center#section]
Do you have any idea what it might be caused by?
Breakthrough:
When I activated DOMPDF_DPI it actually opens as PDF, but now all of the text comes on first line of the second page of the PDF. Like, all the text comes out on top of each other. Also, when it opens the PDF, the ?&pdf=1 are included in the htmlentities query string, which looks very messy since it is supposed to be a personalized page as well as the PDF.
You can set dompdf to parse CSS #media queries for standard media types (screen, print, voice, etc.). By default dompdf parses the "screen" media type styles, but you can change this in the configuration file. See the DOMPDF_DEFAULT_MEDIA_TYPE configuration setting. Then you just need to pass the original URL querystring with an appended variable telling the page to render to PDF. If your original URL is something like the_inquiry.php?name=Joe then your PDF URL could be the_inquiry.php?name=Joe&pdf=1.
Your code would then look similar to the following:
<?php
ob_start();
?>
<html>
<head>
<style>
#media print {
.shouldnotPrintToPDF, .pdflink { display: none; }
}
</style>
</head>
<body>
<div class="shouldnotPrintToPDF">
Content.
</div>
<div class="shouldPrintToPDF">
Sensitive content.
Open or save as PDF
</div>
</body>
</html>
<?php
if ( isset( $_GET['pdf'] ) ) {
require_once 'dompdf/dompdf_config.inc.php';
$html = ob_get_clean();
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("the_inquiry.pdf");
}
?>

formatting posts in wordpress

I'm developing a wordpress theme, but I'm stuck in formatting the single.php.
I have in my posts a slideshow plugin which is load with the_content() function, togheter with the text of the post, and with the_title() load the title.
that seen like this:
<h1>the_title()</h1>
<div id=post>the_content</div>
the problem is, I need customize how it's display.
I need display:
<div>theplugin</div>
<div id=post>
<span>the_title</span>
the text
</div>
I try to do that with add_filters but I wasn't lucky.
I hope you can understand my explanation, if you need more details, just tell me.
Thanks in advanced.
If users can add plugin components to posts in the editor, they are usually added via shortcodes.
If that's the case with your plugin, you can add it with apply_filters(). Here's an example of how to add a slideshow from the popular nextgen gallery plugin outside the post content:
<?php
$slideshow = apply_filters('the_content', '[slideshow id=1]' );
echo $slideshow;
?>
The above code can be added into single.php, any static page's page template file or directly into header.php to display on all pages.
If you specify the plugin you're using, I'll update the answer accordingly.
If it should indeed be called directly via a function, I second Ancide's answer.
You just need to change the place of where the functions are situated. Like this:
<div>theplugin</div>
<div id=post>
<span><?php the_title(); ?></span>
<?php the_content(); ?>
</div>
Edit: I misunderstood the description of the problem. Here's my answer now that I understand what the problem is:
The plugin uses a hook for the_content function. If you look inside all the php-files inside wp-content/plugins/your-plugin there will be a file with this code:
add_action('the_content','some-function-name');
This tells wordpress to run the function some-function-name everytime the function the_content is run. So you need to look for the some-function-name to figure out how to customize the output.

Cakephp Link is not recognized in HTML

I generate in Cakephp with Html->link a link
echo $this->Html->link('Download',array(
'plugin'=> 'galleries',
'controller'=> 'galleries',
'action'=> 'download',
$download),array('class'=>'down'));
The output is
Download
This link is not recognized. I can not click on it.
But if I put the output link and implement it in the HTML code, all is fine
After this I tried to echo the link - same problem.
This is a snippet from my view
<nav>next<?php if($download){ echo $this->Html->link('Download',array('plugin' => 'galleries', 'controller' => 'galleries','action' => 'download', $download),array('class'=>'down')); } ?>prev</nav>
Maybe somebody can give me a little hint?
Solution:
It was not a PHP Problem but CSS Problem... specially a z-index Problem in my Jquery Plugin (ImageViewer) rolleyes
The schemata of the HTML is:
<article><div class="info"><nav></nav</div></article><article><div class="info"><nav></nav</div></article><article><div class="info"><nav></nav</div></article>
The Problem were the nav tags in every article tag. The "prev&next" links appear in every nav structure but not the "download" link. ergo: i can click on the "prev&next" links but not on the "download" link... So, for a fast solution i set the z-index for my current article view. But i must rework my HTML Code structure
Thanks for reading my question.