This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Caso o usuário esteja logado | |
if ( is_user_logged_in() ) : | |
?> | |
Aqui você coloca o seu conteúdo, normalmente é a função do WordPress | |
<?php the_content(); ?> | |
<?php | |
// Caso o usuário não esteja logado | |
else : | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Documentação completa em http://codex.wordpress.org/Class_Reference/WP_Query | |
$args = array( | |
'cat' => 1, //ID da sua categoria | |
'posts_per_page ' => 4, // Número de posts a exibir | |
); | |
$novo_loop = new WP_Query( $args ); | |
if ( $novo_loop->have_posts() ) : while ( $novo_loop->have_posts() ) : $novo_loop->the_post(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sync fork with original repository | |
# | |
# Requires an "upstream" remote, pointing to original repo | |
# e.g. `git remote add upstream git@github.com:user/repo.git` | |
alias git-sync-fork="git fetch upstream; git checkout master; git merge upstream/master" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$attachment_args = array( | |
'post_type' => 'attachment', | |
'numberposts' => -1, | |
'post_status' => 'any', | |
'post_parent' => get_the_ID() | |
); | |
$attachments = get_posts( $attachment_args ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SmoothScroll for websites v1.2.1 | |
// Licensed under the terms of the MIT license. | |
// People involved | |
// - Balazs Galambosi (maintainer) | |
// - Michael Herf (Pulse Algorithm) | |
(function(){ | |
// Scroll Variables (tweakable) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Exclude the files ajax, upload and WP CRON scripts from authentication | |
<FilesMatch "(admin-ajax\.php|media-upload\.php|async-upload\.php|wp-cron\.php|xmlrpc\.php)$"> | |
Order allow,deny | |
Allow from all | |
Satisfy any | |
</FilesMatch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
abstract class Adapter | |
{ | |
protected $config; | |
protected $connection; | |
public function __construct($config) | |
{ | |
$this->config = $config; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Class Mapper | |
*/ | |
abstract class Mapper | |
{ | |
/** | |
* @var PDO | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'C:\xampp\htdocs\PainelOO\classes\DB\DB.php'; | |
abstract class Crud extends DB{ | |
protected $table; | |
abstract public function insert(); | |
abstract public function update($id); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Dara\Db; | |
/** | |
* Class for Mysql database manipulation | |
*/ | |
class MysqlPDO extends \PDO | |
{ | |
/** | |
* Create a new database to work with |