How I can open Wordpress posts in fancy box?
Eg:
Lorem ipsum LINK lorem ipsum.
When I click on LINK - how to open some post in fancybox or other "popup" like Litghbox etc.
You can simply use the thickbox js provided by wordpress for creating fancybox as like :
<?php add_thickbox(); ?>
<div id="my-content-id" style="display:none;">
<p>
This is my hidden content! It will appear in ThickBox when the link is clicked.
</p>
</div>
View my inline content!
For more details, check out here : https://codex.wordpress.org/Javascript_Reference/ThickBox
Edit:
For loading content from another source or site.
<?php add_thickbox(); ?>
View the WordPress Codex!
Related
I'm very confused here. I am very familiar with Wordpress, however, I cannot get the home page of my site to display the HTML and PHP etc that is currently in my home page template.
I have gone to settings - reading and set the home page to a static home page under 'Home', which as you can imagine has the page template for the HTML/PHP I want to display.
I was wondering if anyone knew of any other external factors that affect the home page and the templates being brought through on my other pages are actually working - it's very odd.
I have checked the DOM on the browser multiple times, using Chrome, however none of the divs etc are showing.
Here is the code for the front page so far:
<?php
/* Template Name: Home Page Template */
?>
<?php get_header(); ?>
<div class="header_banner">
<div class="image_content">
<div class="image">
<video playsinline="" autoplay="" muted="" loop="" poster="" onplaying="this.controls=false">
<source src="<?php echo get_stylesheet_directory_uri(); ?>/videos/video_background.mp4">
Your browser does not support the video element.
</video>
</div>
</div>
<div class="main_content center center_absolute">
<h1>I create and design websites.</h1>
<h2>I specialise in HTML, CSS, jQuery and Wordpress.</h2>
</div>
<div class="center_scroll">
<div class="scroll">
<i class="fa fa-chevron-down" aria-hidden="true"></i>
</div>
</div>
</div>
<?php get_footer();
One possibility is that the page you selected in the dropdown menu under Settings > reading does not have "Home Page Template" template selected under "Page Attributes" Meta Box.
You could rename the file to page-home.php since this template will only be used once on your site. Maybe this helps.
This is with respect to a buddypress addon (plugin) whose theming I am unable to do. I searched many sites but unable to get a concrete solution. In the plugins page, Header is getting disturbed if its a buddypress theme but is working fine in default wordprress themes.
I am using this code at present at the top of the template page
<?php get_header('buddypress'); ?>
<div id="buddypress">
<div id="profile">
<div class="row">
Than the following stuff like
<?php do_action( 'bp_before_member_home_content' ); ?>
<div id="item-header" role="complementary">
<?php bp_get_template_part ( 'members/single/member-header' ) ?>
</div><!--#item-header-->
I feel this is not the right way to do. I want to know if the plugin has to copy the buddypress template header without disturbing footer or sidebar how it can be done. i.e my plugin should show only the plugin content and should not disturb any part of the buddypress template.
you have to edit your buddy press header with your html structure.
and keep buddy-press functionality as it is.
I'm trying to show at the category page only the content of the post that is before the <!--more--> tag. I'm using the latest Wordpress version.
In other words the structure will go like this
Content
<!--more-->
Content I want to be removed and only shown if the single post is displayed.
I've already got rid of the "Read More" link, and I've already tryed to use CSS and display:none; but none of those works fine
The code generated by wordpress is the following
<h2 class="entry-title">Post Name</h2>
<div id="chan" class="blanco">Content Shown</div>
<p><span id="more-50"></span>Post description.</p>
At the index.php I've managed to make it work since it shows the link and not the content itself, however in the page.php doesn't work.
Thank you very much in advance!
<?php the_content(); ?> will output the content, trimmed to just before the <!-- more --> tag, if the tag is used.
From the codex:
If the quicktag <!--more--> is used in a post to designate the "cut-off" point for the post to be excerpted, the_content() tag will only show the excerpt up to the <!--more--> quicktag point on non-single/non-permalink post pages.
I have started to learn how to make custom themes for wordpress and have problems when installing plugins that have shortcodes. I try to add a shortcode ( usually a form plugin, i have tried two different ones and also an ecwid shopping cart yet no shortcodes have worked, yes the plugins were activated) by creating a page and using the visual/html editor. When i check the page it does not show anything. here is my single.php..
<?php get_header(); ?>
<body>
<div id="maintopwrapper">
<div class="container" id="topwrapper">
<div class="row">
<div class="span8">
<?php while (have_posts()) : the_post(); ?>
<!-- Content Here -->
<div class="row"><div class="span8 greygrad round">
<div class="padding"><div class="content" style="margin-top:25px;"><?php the_content(); ?></div></div></div></div>
<div class="row margintop"><div class="span8 greygrad round">
<div class="padding">
<?php comments_template() ?>
</div></div></div>
<?php endwhile;?>
</div>
<?php get_sidebar(); ?>
</div>
</div>
</div> <!-- end of maintop wrapper-->
<?php get_footer(); ?>
It should show since the_content() is there right? Let me know if you need anything else for me to share. Plugins I tried a gravityforms, ecwid shopping cart, and quforms..all of which the shortcodes do not work. The only way I got one of them to work is by creating a custom page theme and adding hardcoded php to call the function but I rather have shortcodes working so the theme is usuable by people who dont code.
For live example: http://modernlogic.co/wp
the "contact" page in menu is actually hardcoded in the custom theme which is not using the shortcodes like I want in the "sample page" in menu
Thanks in advance
I am a idiot... I realized that I had no page.php and so when I tried adding the shortcode to a page it referred to the index.php instead of page.php(since there was none) and so it only showed the excerpt and not the content. I figured this out because I tried adding the shortcode to a post and so when it went to single.php, the shortcode worked since it has content and not just excerpt. oh well I guess trial and error.. Thanks for trying to help me anyway
I have just created my "About Us" page inside WP Admin Dashboard, that points to an about-us.php page template that I created and has a empty div content, i.e.
<div id="content"></div>
It is in here where I would like to grab the content that the wp-admin user enters in the dashboard About Us page and place this content within my
<div id="content">[Dashboard About Us Page Content to go Here]</div>
Basically want to take the whole content from the "About Us" WordPress page and feed this into my about-us.php page template content DIV.
How can I achieve this?
<?php if(have_posts()): while(have_posts()): the_post();
the_content();
endwhile; endif; ?>
Stick that inside the empty div and it will pull the content in dynamically. Read more about the loop here:
http://codex.wordpress.org/The_Loop